> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixpeek.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Update Documents

> Bulk update documents matching filter conditions.

Partially updates all documents in the collection that match the provided filters.
If no filters are provided, updates all documents in the collection.

This endpoint applies the SAME update_data to ALL documents matching the filters.
For per-document updates with different values, use POST /batch endpoint instead.



## OpenAPI

````yaml patch /v1/collections/{collection_identifier}/documents/bulk
openapi: 3.1.0
info:
  title: Mixpeek API
  description: >-
    This is the Mixpeek API, providing access to various endpoints for data
    processing and retrieval.
  termsOfService: https://mixpeek.com/terms
  contact:
    name: Mixpeek Support
    url: https://mixpeek.com/contact
    email: info@mixpeek.com
  version: '0.82'
servers:
  - url: https://api.mixpeek.com
    description: Production
security: []
paths:
  /v1/collections/{collection_identifier}/documents/bulk:
    patch:
      tags:
        - Collection Documents
      summary: Bulk Update Documents
      description: >-
        Bulk update documents matching filter conditions.


        Partially updates all documents in the collection that match the
        provided filters.

        If no filters are provided, updates all documents in the collection.


        This endpoint applies the SAME update_data to ALL documents matching the
        filters.

        For per-document updates with different values, use POST /batch endpoint
        instead.
      operationId: >-
        bulk_update_documents_v1_collections__collection_identifier__documents_bulk_patch
      parameters:
        - name: collection_identifier
          in: path
          required: true
          schema:
            type: string
            description: The ID of the collection to update documents in.
            title: Collection Identifier
          description: The ID of the collection to update documents in.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkUpdateDocumentsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkUpdateDocumentsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BulkUpdateDocumentsRequest:
      properties:
        filters:
          anyOf:
            - $ref: '#/components/schemas/LogicalOperator-Input'
            - type: 'null'
          description: >-
            OPTIONAL. Filter conditions to match documents for update. If not
            provided, updates ALL documents in the collection. Uses the logical
            AND/OR/NOT shape — a list of {field, operator, value} conditions
            (operators: eq, ne, in, nin, gt, gte, lt, lte, contains, exists, …).
            The MVS-native {'must': [{'key': ...}]} shape is NOT accepted here.
            Example: {'AND': [{'field': 'metadata.status', 'operator': 'eq',
            'value': 'pending'}]}
          examples:
            - AND:
                - field: metadata.status
                  operator: eq
                  value: pending
            - AND:
                - field: metadata.created_at
                  operator: gt
                  value: '2024-01-01'
        update_data:
          additionalProperties: true
          type: object
          title: Update Data
          description: >-
            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}
          examples:
            - metadata:
                reviewed: true
                status: processed
            - metadata.processing_complete: true
      type: object
      required:
        - update_data
      title: BulkUpdateDocumentsRequest
      description: >-
        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
      examples:
        - description: Update all pending documents to processed
          filters:
            AND:
              - field: metadata.status
                operator: eq
                value: pending
          update_data:
            metadata:
              status: processed
        - description: Update all documents in collection (no filters)
          update_data:
            metadata:
              version: 2
    BulkUpdateDocumentsResponse:
      properties:
        updated_count:
          type: integer
          title: Updated Count
          description: Number of documents that were updated.
        message:
          type: string
          title: Message
          default: Documents updated successfully
      type: object
      required:
        - updated_count
      title: BulkUpdateDocumentsResponse
      description: Response model for bulk document update operation.
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Always false for error responses
          default: false
        status:
          type: integer
          title: Status
          description: HTTP status code for this error
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: Error details payload
      type: object
      required:
        - status
        - error
      title: ErrorResponse
      description: Error response model.
      examples:
        - error:
            details:
              id: ns_123
              resource: namespace
            message: Namespace not found
            type: NotFoundError
          status: 404
          success: false
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LogicalOperator-Input:
      properties:
        AND:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/LogicalOperator-Input'
                  - $ref: '#/components/schemas/FilterCondition'
              type: array
            - type: 'null'
          title: And
          description: Logical AND operation - all conditions must be true
          example:
            - field: name
              operator: eq
              value: John
            - field: age
              operator: gte
              value: 30
        OR:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/LogicalOperator-Input'
                  - $ref: '#/components/schemas/FilterCondition'
              type: array
            - type: 'null'
          title: Or
          description: Logical OR operation - at least one condition must be true
          example:
            - field: status
              operator: eq
              value: active
            - field: role
              operator: eq
              value: admin
        NOT:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/LogicalOperator-Input'
                  - $ref: '#/components/schemas/FilterCondition'
              type: array
            - type: 'null'
          title: Not
          description: Logical NOT operation - all conditions must be false
          example:
            - field: department
              operator: eq
              value: HR
            - field: location
              operator: eq
              value: remote
        case_sensitive:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Case Sensitive
          description: Whether to perform case-sensitive matching
          default: false
          example: true
      additionalProperties: true
      type: object
      title: LogicalOperator
      description: >-
        Represents a logical operation (AND, OR, NOT) on filter conditions.


        Allows nesting with a defined depth limit.


        Also supports shorthand syntax where field names can be passed directly

        as key-value pairs for equality filtering (e.g., {"metadata.title":
        "value"}).
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Stable error type identifier (machine-readable)
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Fine-grained error code for programmatic handling (e.g.,
            namespace_name_taken, feature_extractor_not_found). Present only
            when consumers may need to branch on a specific error condition.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured details to help debugging (validation errors,
            IDs, etc.)
      type: object
      required:
        - message
        - type
      title: ErrorDetail
      description: Error detail model.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    FilterCondition:
      properties:
        field:
          type: string
          title: Field
          description: Field name to filter on
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: Comparison operator
          default: eq
        value:
          anyOf:
            - $ref: '#/components/schemas/DynamicValue'
            - {}
          title: Value
          description: Value to compare against
      type: object
      required:
        - field
        - value
      title: FilterCondition
      description: |-
        Represents a single filter condition.

        Attributes:
            field: The field to filter on
            operator: The comparison operator
            value: The value to compare against
    FilterOperator:
      type: string
      enum:
        - eq
        - ne
        - gt
        - lt
        - gte
        - lte
        - in
        - nin
        - contains
        - starts_with
        - ends_with
        - regex
        - exists
        - is_null
        - text
        - phrase
      title: FilterOperator
      description: Supported filter operators across database implementations.
    DynamicValue:
      properties:
        type:
          type: string
          const: dynamic
          title: Type
          default: dynamic
        field:
          type: string
          title: Field
          description: >-
            The dot-notation path to the value in the runtime query request,
            e.g., 'inputs.user_id'
          examples:
            - inputs.query_text
            - filters.AND[0].value
      type: object
      required:
        - field
      title: DynamicValue
      description: A value that should be dynamically resolved from the query request.

````