Skip to main content
PATCH
/
v1
/
collections
/
{collection_identifier}
/
documents
/
bulk
Bulk Update Documents
curl --request PATCH \
  --url https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/bulk \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'X-Namespace: <x-namespace>' \
  --data '
{
  "update_data": {},
  "filters": {
    "must": [
      {
        "key": "metadata.status",
        "value": "pending"
      }
    ]
  }
}
'
{
  "updated_count": 123,
  "message": "Documents updated successfully"
}

Headers

Authorization
string
required

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

X-Namespace
string
required

REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'

Path Parameters

collection_identifier
string
required

The ID of the collection to update documents in.

Body

application/json

Request model for bulk updating documents by filters.

Updates ALL documents matching the provided filters with the SAME update_data. For updating specific documents by ID or different values per document, use BatchUpdateDocumentsRequest.

Use Cases: - Update all pending documents to processed - Update all documents from a specific date range - Apply uniform changes across filtered document sets

Requirements: - update_data: REQUIRED - fields to update on all matching documents - filters: OPTIONAL - if omitted, updates ALL documents in collection

update_data
Update Data · object
required

REQUIRED. Dictionary of field-value pairs to update on ALL matching documents. Can update any document field except vectors (metadata, source_blobs, etc.). All matched documents receive the SAME updates. Example: {'metadata.status': 'processed', 'metadata.reviewed': true}

filters
LogicalOperator · object

OPTIONAL. Filter conditions to match documents for update. If not provided, updates ALL documents in the collection. Supports complex logical operators (AND, OR, NOT). Example: {'must': [{'key': 'metadata.status', 'value': 'pending'}]}

Example:
{
"must": [
{
"key": "metadata.status",
"value": "pending"
}
]
}

Response

Successful Response

Response model for bulk document update operation.

updated_count
integer
required

Number of documents that were updated.

message
string
default:Documents updated successfully