---
title: "Api Get Search Facets"
method: POST
path: "/v1/instant_search/facets"
tags: ["embed v1"]
---

# Api Get Search Facets

`POST /v1/instant_search/facets`

## Request

- Base URL: `https://api.branchly.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.branchly.io/v1/instant_search/facets`
- Auth: none declared

## Headers

- `x-api-key` string, nullable

## Request body

- FacetsRequest
  - `session_id` string, required
  - `navigator_id` string, required
  - `locale` string, required
  - `field_key` 'page_metadata.article.tags' | 'custom_metadata.tags', required: The field key to get facets for. Should exclude 'metadata' prefix, e.g. 'page_metadata.article.tags'.
  - `filters` FacetFilter[]: List of existing filters to apply to the facets request, e.g. if user has already selected a tag, this will be used to filter facets by that tag.
    - `field_name` 'tags', required: The field name for the facet filter, currently only 'tags' is supported.
    - `key` 'page_metadata.article.tags' | 'custom_metadata.tags', required: The key for the facet filter. Must be inferred from application settings or style.
    - `match` MatchValue, required
      - `value` union, required
        - string
        - boolean
        - integer
        - string[]

## Response `200`

Successful Response

- FacetsListResponse
  - `total_items` integer, required
  - `items` FacetResult[], required
    - `value` union, required
      - string
      - boolean
      - integer
    - `count` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/branchly/apis/branchly-io-api.md) · [All operations](https://skmtc.dev/branchly/apis/branchly-io-api/llms.txt) · [OpenAPI document](https://skmtc.dev/branchly/apis/branchly-io-api/revisions/9ffb024f8ec8?raw)
