This feature enhances the flexibility of our API by allowing clients to refine the results of requests.It is particularly useful for retrieving specific subsets of data based on criteria like creation dates, states, or values.

To use filters, add the filters query parameter in your request. The syntax follows the LHS Brackets format, where filters are specified using a field, an operator, and a value, separated by brackets ([]). Filters can be combined using logical operators. Each filter must be separated by a semicolon (;). If a filter contains multiple conditions, these should be separated by a comma (,). For the in and nin operators, separate values using a pipe (|).

Available Logical Operators:

  • and
  • or

Available Filter Operators:

  • eq (equals)
  • gt (greater than)
  • gte (greater than or equal to)
  • lt (less than)
  • lte (less than or equal to)
  • last (targets the last element in an array, currently supports strings only)
  • like (search for a pattern similar to the specified value)
  • in (matches any of the values specified in an array)
  • nin (does not match any of the values specified in an array)

Note: The last operator performs an equality check on the last element of an array and is currently limited to string elements.

Examples

  • Filter by Specific ID:
    ?filters=id[eq]=399ca839-abd5-4a7d-981b-f187e7777ec8
  • Filter by the current status:
    ?filters=states.status[last]=ACTIVE
  • Filter by ID and Value Range:
    ?filters=id[eq]=399ca839-abd5-4a7d-981b-f187e7777ec8;and(amount.value[gt]=1,amount.value[lt]=10)
  • Filter by multiple types:
    ?filters=type[in]=CHECKING|SAVING