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

# Create a new collection

`POST /collections`

When a collection is created, we give it a name and describe the fields that will be indexed from the documents added to the collection.

## Request body

- CollectionSchema
  - `name` string, required — Name of the collection
  - `fields` Field[], required — A list of fields for querying, filtering and faceting
    - `name` string, required
    - `type` string, required
    - `optional` boolean
    - `facet` boolean
    - `index` boolean
    - `locale` string
    - `sort` boolean
    - `infix` boolean
    - `reference` string — Name of a field in another collection that should be linked to this collection so that it can be joined during query.
    - `async_reference` boolean — Allow documents to be indexed successfully even when the referenced document doesn't exist yet.
    - `num_dim` integer
    - `drop` boolean
    - `store` boolean — When set to false, the field value will not be stored on disk. Default: true.
    - `vec_dist` string — The distance metric to be used for vector search. Default: `cosine`. You can also use `ip` for inner product.
    - `range_index` boolean — Enables an index optimized for range filtering on numerical fields (e.g. rating:>3.5). Default: false.
    - `stem` boolean — Values are stemmed before indexing in-memory. Default: false.
    - `stem_dictionary` string — Name of the stemming dictionary to use for this field
    - `token_separators` string[] — List of symbols or special characters to be used for splitting the text into individual words in addition to space and new-line characters.
    - `symbols_to_index` string[] — List of symbols or special characters to be indexed.
    - `embed` object
      - `from` string[], required
      - `model_config` object, required
        - `model_name` string, required
        - `api_key` string
        - `url` string
        - `access_token` string
        - `refresh_token` string
        - `client_id` string
        - `client_secret` string
        - `project_id` string
        - `indexing_prefix` string
        - `query_prefix` string
  - `default_sorting_field` string — The name of an int32 / float field that determines the order in which the search results are ranked when a sort_by clause is not provided during searching. This field must indicate some kind of popularity.
  - `token_separators` string[] — List of symbols or special characters to be used for splitting the text into individual words in addition to space and new-line characters.
  - `synonym_sets` string[] — List of synonym set names to associate with this collection
  - `enable_nested_fields` boolean — Enables experimental support at a collection level for nested object or object array fields. This field is only available if the Typesense server is version `0.24.0.rcn34` or later.
  - `symbols_to_index` string[] — List of symbols or special characters to be indexed.
  - `voice_query_model` VoiceQueryModelCollectionConfig — Configuration for the voice query model
    - `model_name` string
  - `metadata` object — Optional details about the collection, e.g., when it was created, who created it etc.

## Response `201`

Collection successfully created

- CollectionResponse
  - `name` string, required — Name of the collection
  - `fields` Field[], required — A list of fields for querying, filtering and faceting
    - `name` string, required
    - `type` string, required
    - `optional` boolean
    - `facet` boolean
    - `index` boolean
    - `locale` string
    - `sort` boolean
    - `infix` boolean
    - `reference` string — Name of a field in another collection that should be linked to this collection so that it can be joined during query.
    - `async_reference` boolean — Allow documents to be indexed successfully even when the referenced document doesn't exist yet.
    - `num_dim` integer
    - `drop` boolean
    - `store` boolean — When set to false, the field value will not be stored on disk. Default: true.
    - `vec_dist` string — The distance metric to be used for vector search. Default: `cosine`. You can also use `ip` for inner product.
    - `range_index` boolean — Enables an index optimized for range filtering on numerical fields (e.g. rating:>3.5). Default: false.
    - `stem` boolean — Values are stemmed before indexing in-memory. Default: false.
    - `stem_dictionary` string — Name of the stemming dictionary to use for this field
    - `token_separators` string[] — List of symbols or special characters to be used for splitting the text into individual words in addition to space and new-line characters.
    - `symbols_to_index` string[] — List of symbols or special characters to be indexed.
    - `embed` object
      - `from` string[], required
      - `model_config` object, required
        - `model_name` string, required
        - `api_key` string
        - `url` string
        - `access_token` string
        - `refresh_token` string
        - `client_id` string
        - `client_secret` string
        - `project_id` string
        - `indexing_prefix` string
        - `query_prefix` string
  - `default_sorting_field` string — The name of an int32 / float field that determines the order in which the search results are ranked when a sort_by clause is not provided during searching. This field must indicate some kind of popularity.
  - `token_separators` string[] — List of symbols or special characters to be used for splitting the text into individual words in addition to space and new-line characters.
  - `synonym_sets` string[] — List of synonym set names to associate with this collection
  - `enable_nested_fields` boolean — Enables experimental support at a collection level for nested object or object array fields. This field is only available if the Typesense server is version `0.24.0.rcn34` or later.
  - `symbols_to_index` string[] — List of symbols or special characters to be indexed.
  - `voice_query_model` VoiceQueryModelCollectionConfig — Configuration for the voice query model
    - `model_name` string
  - `metadata` object — Optional details about the collection, e.g., when it was created, who created it etc.
  - `num_documents` integer, required — Number of documents in the collection
  - `created_at` integer, required — Timestamp of when the collection was created (Unix epoch in seconds)

## Other responses

- `400` — Bad request, see error message for details
- `409` — Collection already exists

---

[API](https://skmtc.net/typesense/apis/typesense-api.md) · [All operations](https://skmtc.net/typesense/apis/typesense-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/typesense/typesense-api/versions/1d9b3b61638e/schema)
