Collection Documents

Batch Update Documents

Changed on

Batch update multiple documents by explicit IDs or filters.

Supports TWO modes:

  1. Explicit IDs mode: Provide 'updates' array with document_id + update_data for each document

    • Each document can have DIFFERENT update_data
    • Returns detailed per-document results
  2. Filter mode: Provide 'filters' + 'update_data' to update all matching documents

    • All documents receive the SAME update_data
    • Returns total count only

Key Features:

  • Update any document field except vectors (metadata, internal_metadata, source_blobs, etc.)
  • Maximum 1000 documents per batch in explicit mode
  • Per-document success/failure reporting in explicit mode
  • Validates documents exist in the specified collection

Examples: Explicit IDs mode: json { "updates": [ {"document_id": "doc_123", "update_data": {"metadata": {"status": "processed"}}}, {"document_id": "doc_456", "update_data": {"metadata": {"status": "archived"}}} ] }

Filter mode (logical AND/OR/NOT shape — NOT MVS-native must/key):
```json
{
    "filters": {"AND": [{"field": "metadata.status", "operator": "eq", "value": "pending"}]},
    "update_data": {"metadata": {"status": "processed"}}
}
```
post/v1/collections/{collection_identifier}/documents/batch

Request

  • Base URL: https://api.mixpeek.com
  • URL: https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/batch
  • Auth: HTTP bearer and API key in header X-Namespace

Path parameters

collection_identifierstring required

The ID of the collection to update documents in.

Request body

update_dataobject nullable

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.

Example request

{
  "description": "Explicit IDs mode: Update 3 documents with different values",
  "updates": [
    {
      "document_id": "doc_frame_001",
      "update_data": {
        "metadata.quality_score": 0.95,
        "metadata.reviewed": true
      }
    },
    {
      "document_id": "doc_frame_002",
      "update_data": {
        "metadata.flagged": true,
        "metadata.quality_score": 0.87
      }
    },
    {
      "document_id": "doc_frame_003",
      "update_data": {
        "metadata.discarded": true,
        "metadata.quality_score": 0.72
      }
    }
  ]
}

Response

Successful Response

updated_countinteger required

Total number of documents successfully updated

failed_countinteger

Total number of documents that failed to update

messagestring

Summary message of the operation

Example response

{
  "failed_count": 0,
  "message": "Successfully updated 3 document(s)",
  "results": [
    {
      "document_id": "doc_123",
      "success": true
    },
    {
      "document_id": "doc_456",
      "success": true
    },
    {
      "document_id": "doc_789",
      "success": true
    }
  ],
  "updated_count": 3
}

Changes

    • warning

      removed the optional property from the response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the new words enum value to the request property //////

    • info

      added the new words enum value to the request property //////

    • info

      added the new words enum value to the request property //////