Skip to navigation

Filtering

Some API methods support filtering, which allows you to limit the list of results and avoid retrieving multiple pages of results you don’t need.

Filters are applied using AND logic, meaning all filters must evaluate to true for an item to be included in the results.

Filter syntax

When working with individual API methods, you’ll filter using the filters object in the request body. The filters object contains nested objects, where each nested object represents a property you can filter on and the available filters nested a layer deeper.

For example, using List Resources, this request filters for production and internal production resources that contain PII:

Example: Filtering resources by environment and data classes
{
"queryParams": { ... },
"sorts": [ ... ],
"filters": {
"environment": {
"In": [ "PROD", "PROD_INTERNAL" ]
},
"dataClasses": {
"ContainsAllOf": [ "PII" ]
}
}
}

For the specific properties that can be filtered, see the reference page for the API method you’re using.

Supported operators

The filter operators you can use depend on the type of property you’re filtering by. This section provides an overview of the filter operators you can expect to see for each property type.

Note that this is a general pattern, and some operators may be omitted in a specific API method. Always refer to the specific API method docs for the complete list of supported operators.

String filters

Filters for string properties allow you to compare the original string to a list of values.

OperatorTypeDescription
instring[]Matches if any string in the comparison array equals the value of the original string property.
notInstring[]Matches if none of the strings in the comparison array equals the value of the original string property.
containsstring[]Matches if any string in the comparison array is a substring of the original string property.
notContainsstring[]Matches if none of the strings in the comparison array is a substring of the original string property.

Array filters

Filters for array properties allow you to compare the original array to a comparison array.

OperatorTypeDescription
containsAnyOfstring[]Matches if any string in the comparison array is present in the original array.
containsNoneOfstring[]Matches if none of the strings in the comparison array is present in the original array.
containsAllOfstring[]Matches if all strings in the comparison array are present in the original array.

Date filters

Filters for date properties allow you to compare the original date to a comparison date.

OperatorTypeDescription
startDatedateMatches if the date in the original property is on or later than the comparison date.
endDatedateMatches if the date in the original property is on or earlier than the comparison date.