> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.qdrant.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.qdrant.tech/_mcp/server.

# Update collection parameters

PATCH http://localhost:6333/collections/{collection_name}
Content-Type: application/json

Updates the parameters of the specified collection.

Reference: https://api.qdrant.tech/api-reference/collections/update-collection

## Authentication

- `api-key` header (required) — API Key authentication via header

## Servers

- `http://localhost:6333` (http, default)
- `https://localhost:6333` (https)

## Request

### Path parameters

- `collection_name` (string, required) — Name of the collection to update

### Query parameters

- `timeout` (integer, optional) — Wait for operation commit timeout in seconds. If timeout is reached - request will return with service error.

### Body (application/json)

This endpoint expects an UpdateCollection.

- `vectors` (UpdateCollectionVectors, optional) — Map of vector data parameters to update for each named vector. To update parameters in a collection having a single unnamed vector, use an empty string as name.
- `optimizers_config` (UpdateCollectionOptimizersConfig, optional) — Custom params for Optimizers. If none - it is left unchanged. This operation is blocking, it will only proceed once all current optimizations are complete
- `params` (UpdateCollectionParams, optional) — Collection base params. If none - it is left unchanged.
- `hnsw_config` (UpdateCollectionHnswConfig, optional) — HNSW parameters to update for the collection index. If none - it is left unchanged.
- `quantization_config` (UpdateCollectionQuantizationConfig, optional) — Quantization parameters to update. If none - it is left unchanged.
- `sparse_vectors` (UpdateCollectionSparseVectors, optional) — Map of sparse vector data parameters to update for each sparse vector.
- `strict_mode_config` (UpdateCollectionStrictModeConfig, optional)
- `metadata` (UpdateCollectionMetadata, optional) — Metadata to update for the collection. If provided, this will merge with existing metadata. To remove metadata, set it to an empty object.

## Response

### 200

successful operation

- `usage` (CollectionsCollectionNamePatchResponsesContentApplicationJsonSchemaUsage, optional)
- `time` (double, optional) — Time spent to process this request
- `status` (string, optional)
- `result` (boolean, optional)

## Types

### UpdateCollectionVectors

Map of vector data parameters to update for each named vector. To update parameters in a collection having a single unnamed vector, use an empty string as name.

### UpdateCollectionOptimizersConfig

Custom params for Optimizers. If none - it is left unchanged. This operation is blocking, it will only proceed once all current optimizations are complete

### UpdateCollectionParams

Collection base params. If none - it is left unchanged.

### UpdateCollectionHnswConfig

HNSW parameters to update for the collection index. If none - it is left unchanged.

### UpdateCollectionQuantizationConfig

Quantization parameters to update. If none - it is left unchanged.

### UpdateCollectionSparseVectors

Map of sparse vector data parameters to update for each sparse vector.

### UpdateCollectionStrictModeConfig

### UpdateCollectionMetadata

Metadata to update for the collection. If provided, this will merge with existing metadata. To remove metadata, set it to an empty object.

### CollectionsCollectionNamePatchResponsesContentApplicationJsonSchemaUsage

### OptimizersConfigDiff

- `deleted_threshold` (double, optional, nullable) — The minimal fraction of deleted vectors in a segment, required to perform segment optimization
- `vacuum_min_vector_number` (integer, optional, nullable) — The minimal number of vectors in a segment, required to perform segment optimization
- `default_segment_number` (integer, optional, 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, optional, 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
- `indexing_threshold` (integer, optional, 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>](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` (uint64, optional, nullable) — Minimum interval between forced flushes.
- `max_optimization_threads` (OptimizersConfigDiffMaxOptimizationThreads, optional) — 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.
- `prevent_unoptimized` (boolean, optional, nullable) — If this option is set, service will try to prevent creation of large unoptimized segments. When enabled, updates may be blocked at request level if there are unoptimized segments larger than indexing threshold. Updates will be resumed when optimization is completed and segments are optimized below the threshold. Using this option may lead to increased delay between submitting an update and its application. Default is disabled.
- `memmap_threshold` (integer, optional, nullable, deprecated) — 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 Deprecated since Qdrant 1.15.0

### CollectionParamsDiff

- `replication_factor` (uint, optional, nullable) — Number of replicas for each shard
- `write_consistency_factor` (uint, optional, nullable) — Minimal number successful responses from replicas to consider operation successful
- `read_fan_out_factor` (uint, optional, nullable) — Fan-out every read request to these many additional remote nodes (and return first available response)
- `read_fan_out_delay_ms` (uint64, optional, nullable) — Delay in milliseconds before sending read requests to remote nodes
- `on_disk_payload` (boolean, optional, 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.

### HnswConfigDiff

- `m` (integer, optional, nullable) — Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.
- `ef_construct` (integer, optional, 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, optional, nullable) — Minimal size threshold (in KiloBytes) below which full-scan is preferred over HNSW search. This measures the total size of vectors being queried against. When the maximum estimated amount of points that a condition satisfies is smaller than `full_scan_threshold_kb`, the query planner will use full-scan search instead of HNSW index traversal for better performance. Note: 1Kb = 1 vector of size 256
- `max_indexing_threads` (integer, optional, 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, optional, nullable) — Store HNSW index on disk. If set to false, the index will be stored in RAM. Default: false
- `payload_m` (integer, optional, nullable) — Custom M param for additional payload-aware HNSW links. If not set, default M will be used.
- `inline_storage` (boolean, optional, nullable) — Store copies of original and quantized vectors within the HNSW index file. Default: false. Enabling this option will trade the search speed for disk usage by reducing amount of random seeks during the search. Requires quantized vectors to be enabled. Multi-vectors are not supported.

### StrictModeConfig

- `enabled` (boolean, optional, nullable) — Whether strict mode is enabled for a collection or not.
- `max_query_limit` (integer, optional, nullable) — Max allowed `limit` parameter for all APIs that don't have their own max limit.
- `max_timeout` (integer, optional, nullable) — Max allowed `timeout` parameter.
- `unindexed_filtering_retrieve` (boolean, optional, nullable) — Allow usage of unindexed fields in retrieval based (e.g. search) filters.
- `unindexed_filtering_update` (boolean, optional, nullable) — Allow usage of unindexed fields in filtered updates (e.g. delete by payload).
- `search_max_hnsw_ef` (integer, optional, nullable) — Max HNSW ef value allowed in search parameters.
- `search_allow_exact` (boolean, optional, nullable) — Whether exact search is allowed.
- `search_max_oversampling` (double, optional, nullable) — Max oversampling value allowed in search.
- `upsert_max_batchsize` (integer, optional, nullable) — Max batchsize when upserting
- `max_collection_vector_size_bytes` (integer, optional, nullable) — Max size of a collections vector storage in bytes, ignoring replicas.
- `read_rate_limit` (integer, optional, nullable) — Max number of read operations per minute per replica
- `write_rate_limit` (integer, optional, nullable) — Max number of write operations per minute per replica
- `max_collection_payload_size_bytes` (integer, optional, nullable) — Max size of a collections payload storage in bytes
- `max_points_count` (integer, optional, nullable) — Max number of points estimated in a collection
- `filter_max_conditions` (integer, optional, nullable) — Max conditions a filter can have.
- `condition_max_size` (integer, optional, nullable) — Max size of a condition, eg. items in `MatchAny`.
- `multivector_config` (StrictModeConfigMultivectorConfig, optional) — Multivector strict mode configuration
- `sparse_config` (StrictModeConfigSparseConfig, optional) — Sparse vector strict mode configuration
- `max_payload_index_count` (integer, optional, nullable) — Max number of payload indexes in a collection

### Usage

Usage of the hardware resources, spent to process the request

- `hardware` (UsageHardware, optional)
- `inference` (UsageInference, optional)

### OptimizersConfigDiffMaxOptimizationThreads

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.

### StrictModeConfigMultivectorConfig

Multivector strict mode configuration

### StrictModeConfigSparseConfig

Sparse vector strict mode configuration

### UsageHardware

### UsageInference

### 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)

### InferenceUsage

- `models` (map from string to ModelUsage, required)

### ModelUsage

- `tokens` (uint64, required)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "usage": {
    "hardware": {
      "cpu": 1,
      "payload_io_read": 1,
      "payload_io_write": 1,
      "payload_index_io_read": 1,
      "payload_index_io_write": 1,
      "vector_io_read": 1,
      "vector_io_write": 1
    },
    "inference": {
      "models": {}
    }
  },
  "time": 0.002,
  "status": "ok",
  "result": true
}
```

**SDK Code**

```python
from qdrant_client import QdrantClient

client = QdrantClient(url="http://localhost:6333")

client.update_collection(
    collection_name="{collection_name}",
    optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),
)

```

```java
import static io.qdrant.client.ShardKeyFactory.shardKey;

import io.qdrant.client.QdrantClient;
import io.qdrant.client.QdrantGrpcClient;

import io.qdrant.client.grpc.Collections.OptimizersConfigDiff;
import io.qdrant.client.grpc.Collections.UpdateCollection;

QdrantClient client = new QdrantClient(
                QdrantGrpcClient.newBuilder("localhost", 6334, false).build());

client.updateCollectionAsync(
    UpdateCollection.newBuilder()
        .setCollectionName("{collection_name}")
        .setOptimizersConfig(
            OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())
        .build());

```

```go
package client

import (
	"context"

	"github.com/qdrant/go-client/qdrant"
)

func updateCollection() {
	client, err := qdrant.NewClient(&qdrant.Config{
		Host: "localhost",
		Port: 6334,
	})
	if err != nil {
		panic(err)
	}

	threshold := uint64(10000)
	err = client.UpdateCollection(context.Background(), &qdrant.UpdateCollection{
		CollectionName: "{collection_name}",
		OptimizersConfig: &qdrant.OptimizersConfigDiff{
			IndexingThreshold: &threshold,
		},
	})
	if err != nil {
		panic(err)
	}
}

```

```typescript
import { QdrantClient } from "@qdrant/js-client-rest";

const client = new QdrantClient({ host: "localhost", port: 6333 });

client.updateCollection("{collection_name}", {
  optimizers_config: {
    indexing_threshold: 10000,
  },
});

```

```rust
use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder};
use qdrant_client::Qdrant;

let client = Qdrant::from_url("http://localhost:6334").build()?;

client
    .update_collection(
        UpdateCollectionBuilder::new("{collection_name}").optimizers_config(
            OptimizersConfigDiffBuilder::default().indexing_threshold(10_000),
        ),
    )
    .await?;

```

```csharp
using Qdrant.Client;
using Qdrant.Client.Grpc;

var client = new QdrantClient("localhost", 6334);

await client.UpdateCollectionAsync(
  collectionName: "{collection_name}",
  optimizersConfig: new OptimizersConfigDiff { IndexingThreshold = 10000 }
);

```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:6333/collections/collection_name")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Patch.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'http://localhost:6333/collections/collection_name', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```swift
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:6333/collections/collection_name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```