Skip to main content
Batch operations allow you to perform multiple operations in a single request, significantly improving throughput and reducing network overhead.

Batch Insert/Upsert

Insert or update multiple points in a single request.

API Endpoint

PUT /collections/{collection_name}/points
curl -X PUT http://localhost:6333/collections/my_collection/points \
  -H 'Content-Type: application/json' \
  -d '{
    "points": [
      {"id": 1, "vector": [0.1, 0.2, 0.3], "payload": {"city": "Berlin"}},
      {"id": 2, "vector": [0.2, 0.3, 0.4], "payload": {"city": "London"}},
      {"id": 3, "vector": [0.3, 0.4, 0.5], "payload": {"city": "Paris"}},
      {"id": 4, "vector": [0.4, 0.5, 0.6], "payload": {"city": "Madrid"}},
      {"id": 5, "vector": [0.5, 0.6, 0.7], "payload": {"city": "Rome"}}
    ]
  }'
The batch format is more efficient for large uploads as it avoids repeating field names.

Batch Update Operations

Perform multiple update operations (upsert, delete, update payload, etc.) in a single request.

API Endpoint

POST /collections/{collection_name}/points/batch
curl -X POST http://localhost:6333/collections/my_collection/points/batch \
  -H 'Content-Type: application/json' \
  -d '{
    "operations": [
      {
        "upsert": {
          "points": [
            {"id": 1, "vector": [0.1, 0.2, 0.3], "payload": {"city": "Berlin"}},
            {"id": 2, "vector": [0.2, 0.3, 0.4], "payload": {"city": "London"}}
          ]
        }
      },
      {
        "update_vectors": {
          "points": [
            {"id": 3, "vector": [0.3, 0.4, 0.5]}
          ]
        }
      },
      {
        "set_payload": {
          "payload": {"status": "active"},
          "points": [1, 2, 3]
        }
      },
      {
        "delete": {
          "points": [10, 11, 12]
        }
      }
    ]
  }'

Supported Operations

operations[].upsert
object
Insert or update points.
operations[].delete
object
Delete points by IDs or filter.
operations[].set_payload
object
Set or merge payload for specified points.
operations[].overwrite_payload
object
Replace entire payload for specified points.
operations[].delete_payload
object
Delete specific payload fields.
operations[].clear_payload
object
Remove all payload from specified points.
operations[].update_vectors
object
Update vectors for existing points.
operations[].delete_vectors
object
Delete specific named vectors.

Batch Delete

Delete multiple points at once.

API Endpoint

POST /collections/{collection_name}/points/delete

Delete by IDs

curl -X POST http://localhost:6333/collections/my_collection/points/delete \
  -H 'Content-Type: application/json' \
  -d '{
    "points": [1, 2, 3, 5, 8, 13, 21]
  }'

Delete by Filter

Delete all points matching a filter condition.
curl -X POST http://localhost:6333/collections/my_collection/points/delete \
  -H 'Content-Type: application/json' \
  -d '{
    "filter": {
      "must": [
        {
          "key": "status",
          "match": {"value": "inactive"}
        }
      ]
    }
  }'
Deleting by filter can affect many points. Use with caution in production environments.

Scroll API - Iterate Through Points

The scroll API allows you to iterate through all points in a collection, which is useful for exporting data or processing large datasets.

API Endpoint

POST /collections/{collection_name}/points/scroll
curl -X POST http://localhost:6333/collections/my_collection/points/scroll \
  -H 'Content-Type: application/json' \
  -d '{
    "limit": 100,
    "with_payload": true,
    "with_vector": false
  }'

Scroll Parameters

offset
integer | string
Start scrolling from this offset. Use the next_page_offset from the previous response.
limit
integer
default:"10"
Maximum number of points to return per request.
with_payload
boolean | array
default:"true"
Include payload in results. Can be true, false, or array of specific fields.
with_vector
boolean | array
default:"false"
Include vectors in results.
filter
object
Filter conditions to apply during scrolling.

Paginate Through All Points

from qdrant_client import QdrantClient

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

all_points = []
offset = None

while True:
    result, offset = client.scroll(
        collection_name="my_collection",
        limit=100,
        offset=offset,
        with_payload=True,
        with_vectors=False
    )
    
    all_points.extend(result)
    
    if offset is None:
        break  # No more points

print(f"Total points retrieved: {len(all_points)}")

Scroll with Filters

curl -X POST http://localhost:6333/collections/my_collection/points/scroll \
  -H 'Content-Type: application/json' \
  -d '{
    "limit": 50,
    "filter": {
      "must": [
        {
          "key": "country",
          "match": {"value": "Germany"}
        }
      ]
    },
    "with_payload": ["city", "population"],
    "with_vector": false
  }'

Response Format

Batch Upsert Response

{
  "result": {
    "operation_id": 123,
    "status": "completed"
  },
  "status": "ok",
  "time": 0.045
}

Batch Update Response

{
  "result": [
    {
      "operation_id": 124,
      "status": "completed"
    },
    {
      "operation_id": 125,
      "status": "completed"
    },
    {
      "operation_id": 126,
      "status": "completed"
    }
  ],
  "status": "ok",
  "time": 0.067
}

Scroll Response

{
  "result": {
    "points": [
      {
        "id": 1,
        "payload": {"city": "Berlin"},
        "vector": null
      },
      {
        "id": 2,
        "payload": {"city": "London"},
        "vector": null
      }
    ],
    "next_page_offset": 100
  },
  "status": "ok",
  "time": 0.003
}
result.points
array
Array of retrieved points.
result.next_page_offset
integer | null
Offset for the next page. null means no more points.

Query Parameters

wait
boolean
default:"true"
Wait for the operation to complete before returning.
ordering
string
Ordering guarantees: weak, medium, or strong.
timeout
integer
Operation timeout in seconds.

Best Practices

  1. Batch Size: Use batch sizes of 100-1000 points for optimal performance
  2. Wait Parameter: Set wait=false for bulk operations to improve throughput
  3. Scroll Limit: Keep scroll limit reasonable (100-1000) to balance memory and network
  4. Error Handling: Implement retry logic for failed batch operations
  5. Memory Management: Process scroll results in chunks to avoid memory issues
  6. Parallel Processing: For very large datasets, consider parallel scroll operations with filters
Batch operations are atomic - either all operations succeed or all fail.