---
title: "Add Collection"
method: POST
path: "/collections/add-collection"
tags: ["Collections"]
---

# Add Collection

`POST /collections/add-collection`

Adds a collection.

If the collection already exists, a `409 Conflict` status code will be returned.

## Request body

- AddCollectionRequest
  - `collection_name` string, required — The name of the collection to add. The maximum length of this string is 1024 characters. If special characters are used, then the UTF-8 encoded string cannot exceed 1024 bytes.
  - `num_shards` integer — [ADVANCED] The number of shards to use for this collection. By using K shards, your documents can index with K times more throughput. However, queries will be automatically sent to all K shards and then aggregated. For large collections, this can make queries faster. But for small collections, this will make queries slower. `num_shards` must be one of [1, 8, 16, 32, 64]. The default is 1.

## Response `201`

Successful Response

- DefaultResponse
  - `message` string — This string will always be "Success!". This may change in the future.

## Other responses

- `400` — Bad Request
- `409` — Conflict
- `422` — Validation Error

## Changes

- **2025-11-24** `c95681b13dc5` — 1 info
  - added the new optional request property `num_shards`

[Change history](https://skmtc.dev/zeroentropy-ai/apis/zeroentropy-api/changes/collections/add-collection/post.md)

---

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