Skip to main content

Filters and sorting

Filters​

Use the q parameter in the field:value format. In the API reference, each endpoint lists the fields it accepts.

curl "https://carchost.fieldcontrol.com.br/customers?q=name:Padaria" \
-H "X-Api-Key: SUA_CHAVE" \
-H "User-Agent: MinhaIntegracao/1.0"

To combine filters, separate them with a space (%20 in the URL):

/customers?q=name:Padaria%20archived:false

Values with spaces can be sent in quotes: q=name:"Padaria Pão Quente".

Date operators​

Date filters such as created_at accept operators at the end of the field name:

FilterMeaning
created_at:2026-10-13T14:30:00ZEqual
created_at>=:2026-10-01Greater than or equal
created_at<=:2026-10-31Less than or equal
created_at>:2026-10-01Greater than
created_at<:2026-10-31Less than

Special characters​

The characters below have a special meaning in the URL and must be replaced by their URL-encoding code inside the filter value:

CharacterCode
&%26
#%23
+%2B
;%3B

For example, to search for the customer Roberto&Augusto:

/customers?q=name:Roberto%26Augusto

Accented letters must also be encoded by your HTTP library (e.g. João becomes Jo%C3%A3o).

Sorting​

Use the sort parameter with one of the values accepted by the endpoint. The - prefix reverses the order:

ValueOrder
created_atFrom oldest to newest
-created_atFrom newest to oldest
curl "https://carchost.fieldcontrol.com.br/customers?sort=-created_at&limit=2" \
-H "X-Api-Key: SUA_CHAVE" \
-H "User-Agent: MinhaIntegracao/1.0"

An invalid filter or sorting returns 422 with the parametersValidationErr code.