Filters
Learn how to use filters to query specific resources.
Some API resources expose a /filter
endpoint which you can use to filter and order resources based on given query selectors. It allows you to narrow down specific items using a standard API.
It consists of the two URL encoded fields:
| JSON query selectors |
| Comma seperated list of fields |
Filter endpoints accept a where
parameter which includes JSON holding the query selectors. For example:
You can also build more complex queries with query operators:
For example, the following query scopes projects with in_progress
status
with most recently created projects being first.
Warning: Unsupported query selectors will result in a 422
HTTP response.
Query Operators
$gt
Selects resources where the value of the field is greater than the given value.
$gte
Selects resources where the value of the field is greater than or equal to the given value.
$lt
Selects resources where the value of the field is less than the given value.
$lte
Selects resources where the value of the field is less than or equal to the given value.
$in
Selects resources where the value of the field is included in the given list of values.
$nin
Selects resources where the value of the field is not included in the given list of values.
$ne
Selects resources where the value of the field is not equal to the given value.
$or
Performs a logical OR operation on a list of two or more expressions and selects resources that satisfy at least one of the expressions.
$regex
Selects resources where the value of the field matches the given regular expression. It must be a string representation of a PCRE compatible regular expression.
Supported regular expression flags are:
i
toggles case insensitivitym
toggles multi-line supportx
toggles an "extended" capability. When set,$regex
ignores all white space characters unless escaped or included in a character class.
Selects all resources where their name
field starts with "Some", ignoring the case:
Order
order
is a string parameter containing comma separated list of fields to sort by. If a field is prefixed with a -
the sort order will be descending. For example, the following order specification will sort resources by status
ascending and created_at
descending order:
Last updated