List options for a filter

GET
/filters/{filter_slug}/options

Lists the allowed values for one filter; send an option's id, not its name, as the value in an opportunity's filters. search matches ids, names and alternate names, ignoring case and accents. Results are paged by number with page and per_page, and meta.total counts every match. State options need country_id, and city options need country_id with an optional state_id; without country_id both lists are empty. An unknown filter_slug returns 400.

Authorization<token>

API key as Bearer token: Authorization: Bearer

In: header

Path Parameters

filter_slug*string

A filter's slug from GET /filters, such as multi_select--country. A filter with no options_url returns an empty list.

Query Parameters

search?string

Text to match against option ids, names and alternate names, ignoring case and accents.

page?integer

1-based page number. Defaults to 1.

Default1
Range1 <= value
per_page?integer

Options per page, from 1 to 100. Defaults to 50.

Default50
Range1 <= value <= 100
country_id?string

ISO 3166-1 alpha-2 country code, such as US. multi_select--state and multi_select--city list nothing without it; other filters ignore it.

state_id?string

Narrows multi_select--city to one state or province: the state option's id (US-CA) or its bare code (CA). Other filters ignore it.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://terac.com/api/external/v2/filters/string/options"
{
  "data": [
    {
      "id": "string",
      "name": "string"
    }
  ],
  "meta": {
    "total": 0,
    "page": 0,
    "per_page": 0
  }
}
{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "API key required. Include Authorization: Bearer <key> header."
  }
}

{
  "error": {
    "code": "FORBIDDEN",
    "message": "This account is not permitted to use the API."
  }
}

{
  "code": "NOT_FOUND",
  "message": "Not found",
  "issues": []
}
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Retry after 61 seconds."
  }
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}