---
title: "Create collection"
method: PUT
path: "/collections/{collection_name}"
tags: ["Collections"]
---

# Create collection

`PUT /collections/{collection_name}`

Create new collection with given parameters

## Path parameters

- `collection_name` string, required

## Query parameters

- `timeout` integer

## Request body

- CreateCollection — Operation for creating new collection and (optionally) specify index params
  - `vectors` union — Vector params separator for single and multiple vector modes Single mode: { "size": 128, "distance": "Cosine" } or multiple mode: { "default": { "size": 128, "distance": "Cosine" } }
    - VectorParams — Params of single vector data storage
      - `size` integer, required — Size of a vectors used
      - `distance` 'Cosine' | 'Euclid' | 'Dot' | 'Manhattan', required — Type of internal tags, build from payload Distance function types used to compare vectors
      - `hnsw_config` union — Custom params for HNSW index. If none - values from collection configuration are used.
        - HnswConfigDiff
          - `m` integer, nullable — Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.
          - `ef_construct` integer, nullable — Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index.
          - `full_scan_threshold` integer, nullable — Minimal size (in kilobytes) of vectors for additional payload-based indexing. If payload chunk is smaller than `full_scan_threshold_kb` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. Note: 1Kb = 1 vector of size 256
          - `max_indexing_threads` integer, nullable — Number of parallel threads used for background index building. If 0 - automatically select from 8 to 16. Best to keep between 8 and 16 to prevent likelihood of building broken/inefficient HNSW graphs. On small CPUs, less threads are used.
          - `on_disk` boolean, nullable — Store HNSW index on disk. If set to false, the index will be stored in RAM. Default: false
          - `payload_m` integer, nullable — Custom M param for additional payload-aware HNSW links. If not set, default M will be used.
        - unknown
      - `quantization_config` union — Custom params for quantization. If none - values from collection configuration are used.
        - union
          - ScalarQuantization
            - `scalar` ScalarQuantizationConfig, required
              - …
          - ProductQuantization
            - `product` ProductQuantizationConfig, required
              - …
          - BinaryQuantization
            - `binary` BinaryQuantizationConfig, required
              - …
        - unknown
      - `on_disk` boolean, nullable — If true, vectors are served from disk, improving RAM usage at the cost of latency Default: false
      - `datatype` union — Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy. - For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are stored as unsigned 8-bit integers, 1 byte. It expects vector elements to be in range `[0, 255]`.
        - 'float32' | 'uint8' | 'float16'
        - unknown
      - `multivector_config` union
        - MultiVectorConfig
          - `comparator` 'max_sim', required
        - unknown
    - object
  - `shard_number` integer, nullable — For auto sharding: Number of shards in collection. - Default is 1 for standalone, otherwise equal to the number of nodes - Minimum is 1 For custom sharding: Number of shards in collection per shard group. - Default is 1, meaning that each shard key will be mapped to a single shard - Minimum is 1
  - `sharding_method` union — Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key
    - 'auto' | 'custom'
    - unknown
  - `replication_factor` integer, nullable — Number of shards replicas. Default is 1 Minimum is 1
  - `write_consistency_factor` integer, nullable — Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.
  - `on_disk_payload` boolean, nullable — If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM. Default: true
  - `hnsw_config` union — Custom params for HNSW index. If none - values from service configuration file are used.
    - HnswConfigDiff
      - `m` integer, nullable — Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.
      - `ef_construct` integer, nullable — Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index.
      - `full_scan_threshold` integer, nullable — Minimal size (in kilobytes) of vectors for additional payload-based indexing. If payload chunk is smaller than `full_scan_threshold_kb` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. Note: 1Kb = 1 vector of size 256
      - `max_indexing_threads` integer, nullable — Number of parallel threads used for background index building. If 0 - automatically select from 8 to 16. Best to keep between 8 and 16 to prevent likelihood of building broken/inefficient HNSW graphs. On small CPUs, less threads are used.
      - `on_disk` boolean, nullable — Store HNSW index on disk. If set to false, the index will be stored in RAM. Default: false
      - `payload_m` integer, nullable — Custom M param for additional payload-aware HNSW links. If not set, default M will be used.
    - unknown
  - `wal_config` union — Custom params for WAL. If none - values from service configuration file are used.
    - WalConfigDiff
      - `wal_capacity_mb` integer, nullable — Size of a single WAL segment in MB
      - `wal_segments_ahead` integer, nullable — Number of WAL segments to create ahead of actually used ones
    - unknown
  - `optimizers_config` union — Custom params for Optimizers. If none - values from service configuration file are used.
    - OptimizersConfigDiff
      - `deleted_threshold` number, double, nullable — The minimal fraction of deleted vectors in a segment, required to perform segment optimization
      - `vacuum_min_vector_number` integer, nullable — The minimal number of vectors in a segment, required to perform segment optimization
      - `default_segment_number` integer, nullable — Target amount of segments optimizer will try to keep. Real amount of segments may vary depending on multiple parameters: - Amount of stored points - Current write RPS It is recommended to select default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads If `default_segment_number = 0`, will be automatically selected by the number of available CPUs
      - `max_segment_size` integer, nullable — Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments. If indexation speed have more priority for your - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256
      - `memmap_threshold` integer, nullable — Maximum size (in kilobytes) of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmapped file. Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value. To disable memmap storage, set this to `0`. Note: 1Kb = 1 vector of size 256
      - `indexing_threshold` integer, nullable — Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing Default value is 20,000, based on <https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md>. To disable vector indexing, set to `0`. Note: 1kB = 1 vector of size 256.
      - `flush_interval_sec` integer, nullable — Minimum interval between forced flushes.
      - `max_optimization_threads` union — Max number of threads (jobs) for running optimizations per shard. Note: each optimization job will also use `max_indexing_threads` threads by itself for index building. If "auto" - have no limit and choose dynamically to saturate CPU. If 0 - no optimization threads, optimizations will be disabled.
        - union
          - 'auto'
          - integer
        - unknown
    - unknown
  - `init_from` union — Specify other collection to copy data from.
    - InitFrom — Operation for creating new collection and (optionally) specify index params
      - `collection` string, required
    - unknown
  - `quantization_config` union — Quantization parameters. If none - quantization is disabled.
    - union
      - ScalarQuantization
        - `scalar` ScalarQuantizationConfig, required
          - `type` 'int8', required
          - `quantile` number, float, nullable — Quantile for quantization. Expected value range in [0.5, 1.0]. If not set - use the whole range of values
          - `always_ram` boolean, nullable — If true - quantized vectors always will be stored in RAM, ignoring the config of main storage
      - ProductQuantization
        - `product` ProductQuantizationConfig, required
          - `compression` 'x4' | 'x8' | 'x16' | 'x32' | 'x64', required
          - `always_ram` boolean, nullable
      - BinaryQuantization
        - `binary` BinaryQuantizationConfig, required
          - `always_ram` boolean, nullable
    - unknown
  - `sparse_vectors` object, nullable — Sparse vector data config.
  - `strict_mode_config` union — Strict-mode config.
    - StrictModeConfig
      - `enabled` boolean, nullable — Whether strict mode is enabled for a collection or not.
      - `max_query_limit` integer, nullable — Max allowed `limit` parameter for all APIs that don't have their own max limit.
      - `max_timeout` integer, nullable — Max allowed `timeout` parameter.
      - `unindexed_filtering_retrieve` boolean, nullable — Allow usage of unindexed fields in retrieval based (e.g. search) filters.
      - `unindexed_filtering_update` boolean, nullable — Allow usage of unindexed fields in filtered updates (e.g. delete by payload).
      - `search_max_hnsw_ef` integer, nullable — Max HNSW value allowed in search parameters.
      - `search_allow_exact` boolean, nullable — Whether exact search is allowed or not.
      - `search_max_oversampling` number, double, nullable — Max oversampling value allowed in search.
      - `upsert_max_batchsize` integer, nullable — Max batchsize when upserting
      - `max_collection_vector_size_bytes` integer, nullable — Max size of a collections vector storage in bytes, ignoring replicas.
      - `read_rate_limit` integer, nullable — Max number of read operations per minute per replica
      - `write_rate_limit` integer, nullable — Max number of write operations per minute per replica
      - `max_collection_payload_size_bytes` integer, nullable — Max size of a collections payload storage in bytes
      - `max_points_count` integer, nullable — Max number of points estimated in a collection
      - `filter_max_conditions` integer, nullable — Max conditions a filter can have.
      - `condition_max_size` integer, nullable — Max size of a condition, eg. items in `MatchAny`.
      - `multivector_config` union — Multivector configuration
        - StrictModeMultivectorConfig
        - unknown
      - `sparse_config` union — Sparse vector configuration
        - StrictModeSparseConfig
        - unknown
    - unknown

## Response `200`

successful operation

- object
  - `usage` 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
  - `time` number, float — Time spent to process this request
  - `status` string
  - `result` boolean

## Other responses

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

## Changes

- **2025-04-15** `5d330acca4cd` — 2 breaking, 9 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 new optional request property `strict_mode_config/anyOf[#/components/schemas/StrictModeConfig]/max_points_count`
  - added the new optional request property `strict_mode_config/anyOf[#/components/schemas/StrictModeConfig]/multivector_config`
  - …7 more
- **2025-01-17** `a7900f38a79d` — 3 breaking, 5 info
  - the request property `optimizers_config/anyOf[#/components/schemas/OptimizersConfigDiff]/max_optimization_threads` became not nullable
  - the `optimizers_config/anyOf[#/components/schemas/OptimizersConfigDiff]/max_segment_size` request property's min was increased to `1.00`
  - the `optimizers_config/anyOf[#/components/schemas/OptimizersConfigDiff]/max_optimization_threads` request property type/format changed from `integer`/`uint` to ``/``
  - api tag `Collections` added
  - …4 more
- …earlier changes not shown

[Full history](https://skmtc.dev/qdrant/apis/qdrant-api/changes/collections/:collection_name/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/5d330acca4cd/schema)
