Skip to main content
POST
Batch Update Documents

Authorizations

Authorization
string
header
required

Mixpeek API key, sent as Authorization: Bearer mxp_sk_.... Create one in Studio under Settings → API Keys, or with an admin key via POST /v1/organizations/users/{user_email}/api-keys. A missing, malformed, unknown, revoked, inactive or expired key returns 401; a key without the permission, scope or plan an operation needs returns 403.

X-Namespace
string
header
required

Namespace id (ns_...), not the namespace name. This scopes the request rather than authenticating it, and it is required on every operation marked x-mixpeek-namespace-scoped.

Path Parameters

collection_identifier
string
required

The ID of the collection to update documents in.

Body

application/json

Keys this body does not declare are ignored, and the response's warnings name them, until 2026-11-02; from 2026-11-02 they are refused with 422 extra_forbidden naming the accepted keys.

Request model for batch updating multiple documents by explicit IDs or filters.

Supports TWO modes:

  1. Explicit IDs mode: Provide 'updates' array with document_id + update_data for each
  2. Filter mode: Provide 'filters' + 'update_data' to update all matching documents

Key difference from BulkUpdateDocumentsRequest:

  • Batch (this): Can apply DIFFERENT updates to SPECIFIC documents by ID
  • Bulk: Applies SAME update to ALL documents matching filters

Use Cases: - Update 5 specific documents with different metadata values - Update documents by IDs with per-document update control - Combine with filters for targeted batch updates

Requirements: - EITHER 'updates' (explicit mode) OR 'filters' + 'update_data' (filter mode) - NOT BOTH modes simultaneously

updates
BatchDocumentUpdate · object[] | null

OPTIONAL. List of document updates with explicit document IDs. Each entry specifies document_id and update_data. Use this mode when you know exact document IDs and want per-document control. Mutually exclusive with filters + update_data mode. Maximum 1000 documents per batch request.

Required array length: 1 - 1000 elements
Example:
filters
LogicalOperator · object | null

OPTIONAL. Filter conditions to match documents for update. Must be used with 'update_data' field. Mutually exclusive with 'updates' array. If provided, applies same update_data to all matching documents.

update_data
Update Data · object | null

OPTIONAL. Update data to apply when using filters mode. Must be used with 'filters' field. All matched documents receive the same updates. Can update any document field except vectors. A dotted key sets one nested field and keeps its siblings: {'metadata.status': 'processed'} changes only metadata.status. A key without a dot replaces that whole top-level field, so {'metadata': {'status': 'processed'}} replaces the entire metadata object and drops its other keys.

Response

Successful Response

Response model for batch document update operation.

Provides detailed per-document results showing success/failure for each update.

updated_count
integer
required

Total number of documents successfully updated

failed_count
integer
default:0

Total number of documents that failed to update

results
BatchDocumentUpdateResult · object[]

Detailed per-document results. Each entry shows document_id, success status, and error message (if failed). Empty list when using filter mode (only counts returned).

message
string
default:Batch update completed

Summary message of the operation