---
title: "Create shard key"
method: PUT
path: "/collections/{collection_name}/shards"
tags: ["Distributed"]
---

# Create shard key

`PUT /collections/{collection_name}/shards`

## Path parameters

- `collection_name` string, required

## Query parameters

- `timeout` integer

## Request body

- CreateShardingKey
  - `shard_key` union, required
    - string
    - integer
  - `shards_number` integer, nullable — How many shards to create for this key If not specified, will use the default value from config
  - `replication_factor` integer, nullable — How many replicas to create for each shard If not specified, will use the default value from config
  - `placement` integer[], nullable — Placement of shards for this key List of peer ids, that can be used to place shards for this key If not specified, will be randomly placed among all peers
  - `initial_state` union — Initial state of the shards for this key If not specified, will be `Initializing` first and then `Active` Warning: do not change this unless you know what you are doing
    - 'Active' | 'Dead' | 'Partial' | 'Initializing' | 'Listener' | 'PartialSnapshot' | 'Recovery' | 'Resharding' | 'ReshardingScaleDown' | 'ActiveRead' | 'ManualRecovery' — State of the single shard within a replica set.
    - unknown

## Response `200`

successful operation

- object
  - `usage` union
    - Usage — Usage of the hardware resources, spent to process the request
      - `hardware` union
        - HardwareUsage — Usage of the hardware resources, spent to process the request
          - `cpu` integer, required
          - `payload_io_read` integer, required
          - `payload_io_write` integer, required
          - `payload_index_io_read` integer, required
          - `payload_index_io_write` integer, required
          - `vector_io_read` integer, required
          - `vector_io_write` integer, required
        - unknown
      - `inference` union
        - InferenceUsage
          - `models` object, required
        - unknown
    - unknown
  - `time` number, float — Time spent to process this request
  - `status` string
  - `result` boolean

## Other responses

- `default` — error
- `4XX` — error

## Changes

- **2026-05-20** `945e62a0043c` — 1 warning
  - for the `query` request parameter `timeout`, the min was set to `1.00`
- **2026-02-20** `26c6f383c006` — 1 info
  - added the new `ManualRecovery` enum value to the request property `initial_state/anyOf[#/components/schemas/ReplicaState]/`
- **2025-11-17** `d09f337ca2f3` — 3 info
  - added the new optional request property `initial_state`
  - added `#/components/schemas/Usage` to the `usage` response property `anyOf` list for the response status `200`
  - removed `#/components/schemas/HardwareUsage` from the `usage` response property `anyOf` list for the response status `200`
- **2025-04-15** `5d330acca4cd` — 2 breaking, 6 info
  - removed the required property `usage/anyOf[#/components/schemas/HardwareUsage]/io_read` from the response with the `200` status
  - removed the required property `usage/anyOf[#/components/schemas/HardwareUsage]/io_write` from the response with the `200` status
  - added the required property `usage/anyOf[#/components/schemas/HardwareUsage]/payload_index_io_read` to the response with the `200` status
  - added the required property `usage/anyOf[#/components/schemas/HardwareUsage]/payload_index_io_write` to the response with the `200` status
  - …4 more
- **2025-01-17** `a7900f38a79d` — 4 info
  - api tag `Distributed` added
  - api tag `cluster` removed
  - api tag `collections` removed
  - added the optional property `usage` to the response with the `200` status

[Full history](https://skmtc.dev/qdrant/apis/qdrant-api/changes/collections/:collection_name/shards/put.md)

---

[API](https://skmtc.dev/qdrant/apis/qdrant-api.md) · [All operations](https://skmtc.dev/qdrant/apis/qdrant-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qdrant/qdrant-api/revisions/d08b1f613f29/schema)
