# Filter

Use `$filter` to narrow the resources returned by an API request.

The current OpenAPI specifications document `$filter` for:

* DAM list operations: `GET /dam/images` and `GET /dam/files`
* Catalog list and changelog operations, such as `GET /catalog/Products`


## Syntax

```text
$filter=PROPERTY_NAME operator VALUE
```

Example:

```http
GET https://api2.saleslayer.com/catalog/Products?$filter=contains(prod_title,'EC')
```

## Supported expressions

Filtering can use comparison operators, logical operators, and string functions where supported by the endpoint.

Examples:

```text
prod_ref eq 'ABC-001'
contains(prod_title,'EC')
cat_ref eq 'LPG' or cat_title eq 'Products'
```

## Supported properties

For Catalog resources, use metadata endpoints to confirm the fields available for filtering.

For DAM images and files, use the [DAM endpoint reference](/apis/dam-v2.0) for supported query fields and examples.

## Date filters

DAM `createdOn` and `modifiedOn` values are UTC timestamps in ISO 8601 format with a `Z` suffix. Date values in `$filter` must use the same format. For example:

```bash
curl --get 'https://api2.saleslayer.com/dam/files' \
  --data-urlencode '$filter=modifiedOn gt 2026-10-01T08:00:00Z' \
  -H 'X-API-KEY: YOUR_API_KEY'
```

The same expression works on `/dam/images`. Convert local times to UTC before building the filter. Date comparisons use UTC instants; a value without a time zone is not the documented DAM format.

Catalog system dates such as `*_creation`, `*_modify`, and changelog `modified_at` are UTC instants returned with `Z`. Convert local checkpoints to UTC before filtering them. Custom attributes of type Date instead hold the app's date and time without a time zone: a returned value such as `2026-10-21T16:22:00` can be used directly in `$filter`, for example `prod_date eq 2026-10-21T16:22:00`. To filter a full local calendar day, use a range without `Z`, such as `prod_date ge 2026-10-21T00:00:00 and prod_date lt 2026-10-22T00:00:00`. A value with `Z` or a negative offset is interpreted as an instant and compared at its Europe/Madrid date and time; a positive offset containing `+` cannot be written in `$filter`. A date enclosed in single quotes is rejected. Confirm the field name and type using resource metadata before building a Catalog date filter.

For Catalog changelog endpoints, filterable fields are `id`, `item_id`, and `modified_at`; `author_type` accepts `eq` only, `author_id` requires an `author_type` condition, and `attribute_id` accepts `eq` only with a field key of that entity. The `changes` field cannot be filtered. Changelog `modified_at` values represent UTC time. Convert a local checkpoint to UTC before filtering.

## Limitations

Based on the migrated documentation and the current API descriptions:

* Filters apply to the root resource being requested.
* Filtering nested resource properties is not documented as supported.
* Property names, operators, and value formats must match the resource metadata and API reference.


## Example with `$select`

```http
GET https://api2.saleslayer.com/catalog/Products?$select=prod_ref,prod_title&$filter=contains(prod_title,'EC')
```

## Notes

* Use URL encoding when filter values contain spaces, quotes, or special characters.
* Combine multiple conditions with `and` or `or` when supported.
* Test filters with small page sizes before running large synchronization jobs.


## Related pages

* [Pagination and filtering](/guides/pagination-and-filtering)
* [Logical operators](/guides/logical-operators)
* [String functions](/guides/string-functions)
* [Catalog REST API overview](/apis/catalog)