# Filters (https://terac.com/docs/developers/guides/filters)

Target participants using typed slug filters with structured operators.

Filters let you target participants by demographics, geography, profession, and participation history. Each filter is a single-key object where the key is a typed slug and the value contains operators.

## Typed Slug Format [#typed-slug-format]

Filters use the format `{type}--{attribute}`. For example: `integer--age`, `multi_select--country`.

### Why typed slugs? [#why-typed-slugs]

The `{type}--{slug}` format encodes the filter's data type in the slug itself. This is intentional:

* **Self-describing payloads.** You can validate operators client-side without fetching the catalog first. An `integer--` filter takes `$gte`/`$lte`, a `multi_select--` filter takes `$in`/`$eq`.
* **Future cross-platform portability.** The typed slug format is designed to enable mapping filters from other panel providers in the future.

## Operators [#operators]

| Operator | Meaning               | Applies to                                   |
| -------- | --------------------- | -------------------------------------------- |
| `$eq`    | Equals                | `single_select`, `multi_select`              |
| `$in`    | Any of                | `single_select`, `multi_select`, `reference` |
| `$gte`   | Greater than or equal | `integer`                                    |
| `$lte`   | Less than or equal    | `integer`                                    |
| `$all`   | All of                | `reference`                                  |

There is no exclusion operator, so list the values to include. An operator that a filter does not support returns a `BAD_REQUEST` error.

## Example [#example]

```json
[
  { "integer--age": { "$gte": 25, "$lte": 45 } },
  { "multi_select--country": { "$in": ["US", "CA"] } },
  { "multi_select--job_function": { "$eq": "engineering" } }
]
```

## Supported Filters [#supported-filters]

This API is in beta. Only filters listed in the [filter catalog](https://terac.com/docs/developers/guides/filters/catalog) are supported. Unrecognized slugs will return a `BAD_REQUEST` error. Support for additional custom filters and cross-platform filter mapping is on the roadmap.