Skip to main content
POST
Create a document.

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.

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 creating a document.

collection_id
string | null

ID of the collection the document belongs to. Optional on POST /v1/collections/{collection_id}/documents — the collection is already identified by the URL path, so an omitted body collection_id is filled from the path (a mismatch is still rejected). Required when the request is not path-scoped.

Example:

"collection_123"

root_object_id
string | null

Optional denormalized root object identifier provided during creation.

root_bucket_id
string | null

Optional denormalized bucket identifier provided during creation.

source_type
enum<string> | null

Optional immediate parent type for the document.

Available options:
bucket,
collection,
direct_upsert,
signal
source_collection_id
string | null

Optional parent collection identifier when sourced from a collection.

source_document_id
string | null

Optional parent document identifier when sourced from a collection.

source_object_id
string | null

Optional parent object identifier when sourced directly from a bucket.

lineage_path
string | null

Optional materialized lineage path to set during creation.

lineage_chain
LineageStep · object[]

Processing steps from root object to this document. Recommended for decomposition trees.

content_hash
string | null

Optional SHA256 content hash of the source object. Supplying it on a lineage-preserving import lets a later heal/reprocess recognise the cached derivation potency and skip recompute instead of re-spending GPU. Stored at _internal.content_hash.

document_schema_version
string | null

Optional document schema version (v1 or v2). If not provided, uses system default.

metadata
Metadata · object

Optional metadata dictionary for user-defined fields and custom attributes.

features
FeatureModel · object[]

Features to associate with the document

vectors
Vectors · object | null

Optional pre-computed vectors to store with the document. Keys are the names of the collection's vector indexes. A key is either the last segment of the index feature_uri (multilingual_e5_large_instruct_v1 for mixpeek://text_extractor@v1/multilingual_e5_large_instruct_v1) or the full index name (text_extractor_v1_embedding). Either way the vector is stored under the full index name. Values are float arrays with the index dimensions. A key the collection does not have returns a 422 that lists the available index names and dimensions. Read the names from vector_indexes on GET /v1/collections/{collection_id}.

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.

The document payload structure follows the native vector store format: - System fields are stored in _internal (lineage, metadata, blobs, etc.) - User fields are at root level (brand_name, thumbnail_url, etc.) - Only document_id and collection_id are Mixpeek IDs at root level - No duplication between root and _internal

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.

Examples:

"doc_f8966ff29c18e20c6b45e053"

"doc_abc123"

collection_id
string
required

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

Examples:

"col_articles"

"col_video_frames"

vector_hydration_incomplete
boolean | null

OPTIONAL. Present only when return_vectors/return_vector_names was requested on this read. True means this read did not return a vector the store holds: fetching errored or timed out, its partition was not paged in, or the store keeps it only as quantized codes. An empty or absent vector on THIS response is UNCERTAIN, not a confirmed absence, and should not be treated as proof the vector does not exist. False means hydration ran to completion (present or genuinely absent). On a large/BYO collection with evicted partitions, hydration can time out on most reads before a background page-in warms the index; retrying the same read later, once warm, is the correct response to True here, not re-deriving the vector from source.

searchable_at
string | null

When the document's latest write became searchable on the shard that served this read (ISO 8601, UTC, to the write batch). Null means stored and not searchable yet: the write is acknowledged but this shard has not applied it, or a recovery replay still covers the namespace. A read after the apply returns the time. Computed when the document is read from the shard that serves it, and not stored on the document, so it cannot be used in filters, sorts or facets.

document_blobs
BlobURLRef · object[]

Document blobs with presigned URLs when requested

_internal
InternalPayloadModel · object | null

System-managed internal fields. Contains all Mixpeek-managed metadata including lineage, processing info, timestamps, and blob references. User-defined fields appear at root level alongside document_id and collection_id.

Example: