API Reference
Log In

Filters

This guide describes how to use Modzy’s search filters in requests to customize responses.

Overview

Modzy’s collection routes accept search filters. To filter responses, add query parameters to the request’s header and set their values accordingly.

Filter options

You can use filters to search for elements in different ways.

Match any value: OR

Separate query values with a , to return elements that match any value.
Example: return the API key prefixes that contain "b" or "1":

GET api/accounting/accounts/demo-account/access-keys?prefix=b,1 HTTP/1.1
GET api/accounting/accounts/demo-account/access-keys?prefix=b&prefix=1 HTTP/1.1

the endpoints above return:

[
    "apikeya1",
    "apikeyb1",
    "apikeyb2",
    "apkeyb3"
]

Match all values: AND

Separate query values with a ; to return elements that match all values.
Example: return the API key prefixes that contain "b" and "1":

GET api/accounting/accounts/demo-account/access-keys?prefix=b;1 HTTP/1.1

returns:

[
    "apikeyb1"
]

Multiple query parameters

Separate query parameters with a & to return elements that match all the parameter’s values.
Example: return the API key prefixes that contain "b" or "1" in their prefix and "a1-name" in their name:

GET api/accounting/accounts/demo-account/access-keys?prefix=b,1&name=a1-name HTTP/1.1

returns:

[
    "apikeya1"
]