Skip to main content

Bulk Upsert Vectors

Insert or update multiple vectors in a single request. More efficient than individual upserts for large ingestion jobs.

POST /v1/collections/{name}/bulk_upsert

Request

Headers:

x-api-key: your-api-key
Content-Type: application/json

Path Parameters:

ParameterDescription
nameCollection name

Body:

FieldTypeRequiredDescription
itemsobject[]Array of vector objects (see below). Max: 1000 items.
include_timingbooleanDefault: false. When true, the response includes a timing_ms object with embedding_ms, storage_ms, and total_ms breakdowns.

Each item object:

FieldTypeRequiredDescription
external_idstringUnique identifier
vectorfloat[]Array of floats matching collection dimension. Either vector or text must be provided per item. If both are given, vector takes precedence.
textstringPlain text to embed. The backend generates the vector. Either text or vector must be provided. If both are given, vector takes precedence.
metadataobjectArbitrary JSON metadata

Examples

With vectors:

curl -X POST http://localhost:8000/v1/collections/articles/bulk_upsert \
-H "x-api-key: test-key" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"external_id": "doc-1", "vector": [0.1, 0.2, 0.3], "metadata": {"title": "A"}},
{"external_id": "doc-2", "vector": [0.4, 0.5, 0.6], "metadata": {"title": "B"}},
{"external_id": "doc-3", "vector": [0.7, 0.8, 0.9]}
]
}'

With text and timing:

curl -X POST http://localhost:8000/v1/collections/articles/bulk_upsert \
-H "x-api-key: test-key" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"external_id": "doc-1",
"text": "Introduction to vector databases",
"metadata": {"title": "First article"}
},
{
"external_id": "doc-2",
"text": "Advanced similarity search techniques",
"metadata": {"title": "Second article"}
}
],
"include_timing": true
}'

Response

{
"status": "success",
"data": {
"results": [
{"external_id": "doc-1", "status": "inserted"},
{"external_id": "doc-2", "status": "inserted"}
]
}
}

With timing:

{
"status": "success",
"data": {
"results": [
{"external_id": "doc-1", "status": "inserted"},
{"external_id": "doc-2", "status": "inserted"}
],
"timing_ms": {
"embedding_ms": 24.8,
"storage_ms": 5.2,
"total_ms": 30.0
}
}
}

Errors

CodeReason
400Vector dimension mismatch or batch exceeds MAX_BATCH_SIZE
404Collection not found
401Missing or invalid API key
403API key does not have write permission