---
title: "Replace collection"
method: PUT
path: "/v1/collections/{collection_id}"
tags: ["Collections"]
---

# Replace collection

`PUT /v1/collections/{collection_id}`

## Request

- Base URL: `https://ac.cnstrc.com`
- URL: `https://ac.cnstrc.com/v1/collections/{collection_id}`
- Auth: one of:
  - HTTP basic
  - HTTP bearer

**🔐 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: `collections(w)`.

Replace collection.

## Path parameters

- `collection_id` 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

- CollectionPutBody
  - `id` string, required: ID of the collection, must be unique.
  - `display_name` string, required: Name of the collection to be displayed to end users.
  - `filter_expression` union
    - object
    - string, json
  - `data` object: Object containing additional data, that should be attached to this collection. The maximum size of data object is limited to 200kb.
  - `discoverable` boolean: When true, the collection is discoverable in autocomplete and search.
  - `matches` CollectionMatch[]: A list of terms associated with this collection for matching purposes.
    - `pattern` string, required: A term to associate with this collection for matching purposes.
    - `match_type` 'EXACT' | 'UNORDERED' | 'PHRASE'
  - `start_time` string, date-time: ISO-8601 string in UTC defining start time when the collection becomes active. Any specified timezone will be omitted.
  - `end_time` string, date-time: ISO-8601 string in UTC defining start time when the collection becomes inactive. Any specified timezone will be omitted.
  - `overridden_collection_id` string: The ID of the base collection that this collection overrides. An overriding collection temporarily replaces the content of a base collection during a scheduled time window. Only base collections (collections with `overridden_collection_id` set to `null`) can be overridden.

## Response `200`

OK

- CollectionPutResponse
  - `id` string, required: ID of the collection.
  - `display_name` string, required: Name of the collection to be displayed to end users.
  - `filter_expression` union
    - object
    - string, json
  - `data` object: Object containing additional data, that should be attached to this collection. The maximum size of data object is limited to 200kb.
  - `discoverable` boolean: When true, the collection is discoverable in autocomplete and search.
  - `matches` CollectionMatchResponse[]: A list of terms associated with this collection for matching purposes.
    - `pattern` string, required: A term to associate with this collection for matching purposes.
    - `match_type` 'EXACT' | 'UNORDERED' | 'PHRASE'
  - `start_time` string, date-time: ISO-8601 string in UTC defining start time when the collection becomes active. Any specified timezone will be omitted.
  - `end_time` string, date-time: ISO-8601 string in UTC defining start time when the collection becomes inactive. Any specified timezone will be omitted.
  - `overridden_collection_id` string: The ID of the base collection that this collection overrides. An overriding collection temporarily replaces the content of a base collection during a scheduled time window. Only base collections (collections with `overridden_collection_id` set to `null`) can be overridden.
  - `created_at` string, date-time, required: Collection creation date in ISO 8601 format. Present only for manually added collections.
  - `updated_at` string, date-time: Last collection update date in ISO 8601 format. Present only for manually added collections.

## 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.dev/constructor/apis/configuration.md) - [All operations](https://skmtc.dev/constructor/apis/configuration/llms.txt) - [OpenAPI document](https://skmtc.dev/constructor/apis/configuration/revisions/205ffdb5f494?raw)
