---
title: "Update facet configuration"
method: PATCH
path: "/v2/facets/{facet_name}"
tags: ["Facets"]
---

# Update facet configuration

`PATCH /v2/facets/{facet_name}`

**🔐 This endpoint requires [HTTP authentication](https://docs.constructor.com/reference/main-authentication) (either [Basic](https://docs.constructor.com/reference/main-authentication#basic-authentication) or [Bearer](https://docs.constructor.com/reference/main-authentication#bearer-authentication)).**
For authenticating with Bearer token, required scopes are: `facets(w)`.

Partially update facet configuration with specified `facet_name`.

## Path parameters

- `facet_name` string, required

## Query parameters

- `key` string, required — The key of the index to use.
- `section` string — The section of the index to use. Defaults to `Products`.
- `c` string — The ID of the client and version that the request is coming from, such as `cio-js-2.90`.

## Request body

- FacetV2PatchRequestBody
  - `name` string — The facet name used to refer to the facet in your catalog. Must be unique inside the section and key.
  - `path_in_metadata` string — The path in metadata of each item where this facet is present. Must be unique inside the section and key.
  - `type` 'multiple' | 'range' | 'hierarchical'
  - `display_name` string — The name of the facet to present to end users. Default value is `null`, in which case the `name` will be presented.
  - `sort_order` 'relevance' | 'value' | 'num_matches'
  - `sort_descending` boolean — `true` if this facet group's options should be sorted in descending order, `false` to sort ascending. Default value is `true` if `sort_order` is `relevance` or `num_matches` and `false` for `value`. Setting `sort_order: relevance` will set `sort_descending: true` for `POST`, `PUT`, `PATCH` endpoints if `sort_descending` is not explicitly set in the request.
  - `range_type` 'static'
  - `range_format` 'boundaries' | 'options'
  - `range_inclusive` 'above' | 'below'
  - `range_limits` union[] — Defines the cut-off points for generating static range buckets. Expects list of sorted numbers (like `[10, 25, 40]`). Default value is `null`
    - union
      - integer
      - number
  - `match_type` 'any' | 'all' | 'none'
  - `position` integer — Used to slot facet groups to fixed positions. Default value is `null`.
  - `hidden` boolean — Specifies whether the facet is hidden from users. Use this for facet data that you don't want shown to end users, but that isn't sensitive.
  - `protected` boolean — Specifies whether the facet is protected from users. Setting this to `true` will require authentication to view the facet.
  - `countable` boolean — Specifies whether counts for each facet option should be calculated and shown in the response. Setting this to `false` will skip counting these options, improving performance for facets with high cardinality.
  - `options_limit` integer — Maximum number of options of facet type `multiple` to return in search responses. If absent, the default limit is applied.
  - `data` object — Dictionary with any extra facet data. Default value is `{}` (empty dictionary).

## Response `200`

OK

- FacetV2PatchResponse
  - `name` string — The facet name used to refer to the facet in your catalog. Must be unique inside the section and key.
  - `path_in_metadata` string — The path in metadata of each item where this facet is present. Must be unique inside the section and key.
  - `type` 'multiple' | 'range' | 'hierarchical'
  - `display_name` string — The name of the facet to present to end users. Default value is `null`, in which case the `name` will be presented.
  - `sort_order` 'relevance' | 'value' | 'num_matches'
  - `sort_descending` boolean — `true` if this facet group's options should be sorted in descending order, `false` to sort ascending. Default value is `true` if `sort_order` is `relevance` or `num_matches` and `false` for `value`. Setting `sort_order: relevance` will set `sort_descending: true` for `POST`, `PUT`, `PATCH` endpoints if `sort_descending` is not explicitly set in the request.
  - `range_type` 'static'
  - `range_format` 'boundaries' | 'options'
  - `range_inclusive` 'above' | 'below'
  - `range_limits` union[] — Defines the cut-off points for generating static range buckets. Expects list of sorted numbers (like `[10, 25, 40]`). Default value is `null`
    - union
      - integer
      - number
  - `match_type` 'any' | 'all' | 'none'
  - `position` integer — Used to slot facet groups to fixed positions. Must be >= 1. Default value is `null`.
  - `hidden` boolean — Specifies whether the facet is hidden from users. Use this for facet data that you don't want shown to end users, but that isn't sensitive.
  - `protected` boolean — Specifies whether the facet is protected from users. Setting this to `true` will require authentication to view the facet.
  - `countable` boolean — Specifies whether counts for each facet option should be calculated and shown in the response. Setting this to `false` will skip counting these options, improving performance for facets with high cardinality.
  - `options_limit` integer — Maximum number of options of facet type `multiple` to return in search responses. If absent, the default limit is applied.
  - `data` object — Dictionary with any extra facet data. Default value is `{}` (empty dictionary).
  - `created_at` string, date-time, required — Facet creation date and time in ISO 8601 format
  - `updated_at` string, date-time — Last facet update date and time in ISO 8601 format.

## Other responses

- `400` — Validation Error
- `401` — Credentials are not passed or action is forbidden.
- `403` — The supplied token does not have the required permissions.
- `404` — Not Found
- `409` — Conflict
- `429` — Rate limit breached

---

[API](https://skmtc.net/constructor/apis/autocomplete.md) · [All operations](https://skmtc.net/constructor/apis/autocomplete/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/constructor/autocomplete/versions/2d33330633b6/schema)
