For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
CloudGitHub
  • API Reference
      • GETCheck cluster status
      • PUTCreate a shard key
      • POSTDelete a shard key
      • POSTRecover cluster state
      • DELRemove peer from cluster
      • GETRetrieve cluster details
      • POSTUpdate cluster setup
LogoLogo
CloudGitHub
API ReferenceDistributed

Create a shard key

PUT
/collections/:collection_name/shards
PUT
/collections/:collection_name/shards
$curl -X PUT \
> 'http://localhost:6333/collections/collection_name/shards' \
> --header 'api-key: <api-key-value>' \
> --header 'Content-Type: application/json' \
> --data-raw '{
> "shard_key": "{shard_key}"
>}'
200Updated
1{
2 "usage": {
3 "cpu": 1,
4 "payload_io_read": 1,
5 "payload_io_write": 1,
6 "payload_index_io_read": 1,
7 "payload_index_io_write": 1,
8 "vector_io_read": 1,
9 "vector_io_write": 1
10 },
11 "time": 0.002,
12 "status": "ok",
13 "result": true
14}
Creates one or more shard keys for a specified collection.
Was this page helpful?
Previous

Delete a shard key

Next
Built with

Authentication

api-keystring
API Key authentication via header

Path parameters

collection_namestringRequired
Name of the collection to create shards for

Query parameters

timeoutintegerOptional

Wait for operation commit timeout in seconds. If timeout is reached - request will return with service error.

Request

Shard key configuration
shard_keystring or uint64Required
shards_numberuint or nullOptional
How many shards to create for this key If not specified, will use the default value from config
replication_factoruint or nullOptional
How many replicas to create for each shard If not specified, will use the default value from config
placementlist of uint64s or nullOptional
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

Response

successful operation
usageobject or any
timedouble
Time spent to process this request
statusstring
resultboolean