Skip to main content
PATCH
/
v1
/
collections
/
{collection_identifier}
/
documents
/
{document_id}
Patch Document
curl --request PATCH \
  --url https://api.mixpeek.com/v1/collections/{collection_identifier}/documents/{document_id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'X-Namespace: <x-namespace>' \
  --data '{}'
{
  "document_id": "<string>",
  "collection_id": "<string>",
  "root_object_id": "obj_video123",
  "root_bucket_id": "bkt_marketing",
  "source_type": "bucket",
  "source_collection_id": "col_frames",
  "source_document_id": "doc_frame_050",
  "source_object_id": "obj_video_123",
  "lineage_path": "bkt_marketing/col_frames/col_scenes",
  "lineage_chain": [
    {
      "collection_id": "<string>",
      "feature_extractor_id": "<string>",
      "document_id": "doc_frame001",
      "timestamp": "2023-11-07T05:31:56Z"
    }
  ],
  "source_blobs": [
    {}
  ],
  "metadata": {},
  "vector": [
    123
  ],
  "document_blobs": [
    {
      "field": "<string>",
      "url": "<string>",
      "role": "source",
      "type": "other",
      "object_key": "<string>",
      "filename": "segment_0.mp4",
      "size_bytes": 1048576,
      "content_type": "video/mp4",
      "checksum": "sha256:a1b2c3d4e5f6...",
      "created_at": "2023-11-07T05:31:56Z",
      "source_blob_id": "blob_abc123",
      "presigned_url": "<string>"
    }
  ]
}

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.

document_id
string
required

The ID of the document to patch.

Body

application/json

Request model for partially updating a document (PATCH operation).

Response

Successful Response

Response model for a single document.

This is the standard response format when fetching documents via API endpoints. Contains all document data plus optional presigned URLs for S3 blobs.

Key Fields: - document_id: Application ID for queries/references - lineage: Complete processing history and source tracking - User-defined fields: Any fields from source passed via field_passthrough - source_blobs: Which blobs from source object were processed - document_blobs: Artifacts generated by extractor (thumbnails, etc.) - enrichment fields: Flat taxonomy/cluster fields (e.g., taxonomy_*_label, cluster_id)

Query Parameters Affecting Response: - return_url=true: Adds presigned_url to each document_blobs entry - return_vectors=true: Includes embedding arrays in response

Use Cases: - Display document details in UI - Download source files or generated artifacts - Understand document provenance and processing - Access enrichment fields (flat) for filtering/display

document_id
string
required

REQUIRED. Unique identifier for the document. Format: 'doc_' prefix + alphanumeric characters. Use for: API queries, references, filtering.

collection_id
string
required

REQUIRED. ID of the collection this document belongs to. Format: 'col_' prefix + alphanumeric characters. Use for: Collection-scoped queries, filtering.

root_object_id
string | null

Denormalized root object identifier for the document.

Example:

"obj_video123"

root_bucket_id
string | null

Denormalized bucket identifier for the document's root object.

Example:

"bkt_marketing"

source_type
enum<string> | null

Immediate parent type that produced this document (bucket or collection).

Available options:
bucket,
collection
Example:

"bucket"

source_collection_id
string | null

Collection identifier of the immediate parent when sourced from a collection.

Example:

"col_frames"

source_document_id
string | null

Document identifier of the immediate parent when sourced from a collection.

Example:

"doc_frame_050"

source_object_id
string | null

Bucket object identifier of the immediate parent when sourced from a bucket.

Example:

"obj_video_123"

lineage_path
string | null

Materialized lineage path for fast lookups (e.g., 'bkt_123/col_frames/col_scenes').

Example:

"bkt_marketing/col_frames/col_scenes"

lineage_chain
LineageStep · object[]

Processing steps from root object to this document. Contains: collection_id, feature_extractor_id, document_id (if intermediate), timestamp. Use for: Visualizing pipeline, debugging, audit trail.

source_blobs
Source Blobs · object[]

Lightweight references to source object's blobs (blob_id, blob_property, blob_type). For full details, fetch: GET /buckets/{bucket_id}/objects/{object_id}

metadata
Metadata · object

Unified metadata dictionary containing both user-defined and system metadata (ingestion_status, feature_extractor_config_hash, processing_history, etc.)

vector
number[] | null

Vector embedding for the document (only included when return_vectors=true)

document_blobs
BlobURLRef · object[]

Artifacts generated during feature extraction (thumbnails, processed outputs). When return_url=true, each entry includes a presigned_url field.