Filters
Learn how to use filters to query specific resources.
Last updated
Learn how to use filters to query specific resources.
Last updated
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:
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.
Selects resources where the value of the field is greater than the given value.
Selects resources where the value of the field is greater than or equal to the given value.
Selects resources where the value of the field is less than the given value.
Selects resources where the value of the field is less than or equal to the given value.
Selects resources where the value of the field is included in the given list of values.
Selects resources where the value of the field is not included in the given list of values.
Selects resources where the value of the field is not equal to the given value.
Performs a logical OR operation on a list of two or more expressions and selects resources that satisfy at least one of the expressions.
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 insensitivity
m
toggles multi-line support
x
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
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:
where
JSON query selectors
order
Comma seperated list of fields