> For the complete documentation index, see [llms.txt](https://docs.elevateab.com/elevate-helpcenter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elevateab.com/elevate-helpcenter/developer-reference/external-api/api-reference/filter-values.md).

# Filter values

The Elevate A/B Testing External API /filter-values endpoint lists the values a field holds in an experiment, most common first.

```http
GET /experiments/{testId}/filter-values
```

Returns the values a free-text field actually has in an experiment, most common first, so you can offer them as choices or check the spelling before filtering.

## Parameters

| Parameter                              | Description                                                                                                                                        |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `testId`                               | Path parameter, from [`/experiments`](/elevate-helpcenter/developer-reference/external-api/api-reference/experiments.md)                           |
| `key`                                  | Required. The field to list, such as `utm_campaign`, `city` or `source`                                                                            |
| `search`                               | Only values containing this text, ignoring case, up to 100 characters                                                                              |
| `limit`                                | 1 to 200, default 20                                                                                                                               |
| `startDate`, `endDate`, `timeZoneName` | The [date window](/elevate-helpcenter/developer-reference/external-api/dates-and-time-zones.md), so you list values from the period you care about |

`key` accepts `browser`, `os`, `region`, `city`, `sales_channel`, `source`, `referrer_url`, `entry_path`, `page_entry`, `page_url`, `utm_source`, `utm_medium`, `utm_campaign`, `utm_content` and `utm_term`.

## Response

| Field    | Type              | What it holds                   |
| -------- | ----------------- | ------------------------------- |
| `testId` | `string`          | The experiment you asked about  |
| `key`    | `string`          | The field you asked for         |
| `values` | `array of string` | The values, most frequent first |

```bash
curl "https://elevateab.app/api/external/v1/experiments/TEST_ID/filter-values?key=utm_campaign&search=summer&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json
{
  "success": true,
  "data": {
    "testId": "3f2a9c1e-5b7d-4e8a-9f10-2c4d6e8a0b12",
    "key": "utm_campaign",
    "values": ["summer_sale", "summer_retargeting"]
  }
}
```

## Worth knowing

* **Fields with fixed values return `400`** with the accepted list: `size`, `country`, `currency` and `visitor_type`. For `custom_event`, use [`/custom-events`](/elevate-helpcenter/developer-reference/external-api/api-reference/custom-events.md).
* **Values are per experiment**, so a campaign that never sent traffic to this experiment will not appear.
