---
title: "Create a new collection"
method: POST
path: "/collections"
tags: ["Collection"]
---

# Create a new collection

`POST /collections`

Creates a new collection if it does not already exist. The maximum number of collections per user is restricted based on the plan. Before you can insert and search points, you must create a collection.

## Request body

- CreateCollectionRequest
  - `id` string — The unique identifier of the collection
  - `indexSchema` IndexSchema — The schema for the collection, each property can be indexed with a different type of index.

## Response `200`

Operation was successful

- object
  - `message` string, required — A message indicating the result of the operation

## Other responses

- `403` — Something unexpected happened
- `409` — Something unexpected happened

## Changes

- **2024-04-12** (v2) `ee4f570ccf0d` — 2 info
  - added the new `haversine` enum value to the request property `indexSchema/additionalProperties/vectorFlat/distanceMetric`
  - added the new `haversine` enum value to the request property `indexSchema/additionalProperties/vectorVamana/distanceMetric`
- **2024-04-10** (v2) `046167f9ac01` — 3 warning, 1 info
  - changed the pattern of the request property `id` from `^[a-z0-9]{3,16}$` to `^[a-z0-9]{3,24}$`
  - removed the request property `distanceMetric`
  - removed the request property `vectorSize`
  - added the new optional request property `indexSchema`
- **2024-03-05** (v2) `dd1cf2f988c1` — 2 warning, 2 info
  - changed the pattern of the request property `id` from `^[a-z0-9]{3,24}$` to `^[a-z0-9]{3,16}$`
  - removed the request property `indexSchema`
  - added the new optional request property `distanceMetric`
  - added the new optional request property `vectorSize`

[Change history](https://skmtc.dev/semafind/apis/semadb-api/changes/collections/post.md)

---

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