Skip to main content
POST
/
v1
/
collections
/
{collection_identifier}
/
documents
Create a document.
curl --request POST \
  --url https://api.mixpeek.com/v1/collections/{collection_identifier}/documents \
  --header 'Content-Type: application/json' \
  --data '
{
  "collection_id": "collection_123",
  "root_object_id": "<string>",
  "root_bucket_id": "<string>",
  "source_type": "bucket",
  "source_collection_id": "<string>",
  "source_document_id": "<string>",
  "source_object_id": "<string>",
  "lineage_path": "<string>",
  "lineage_chain": [
    {
      "collection_id": "<string>",
      "feature_extractor_id": "<string>",
      "document_id": "doc_frame001",
      "timestamp": "2023-11-07T05:31:56Z"
    }
  ],
  "document_schema_version": "<string>",
  "metadata": {},
  "features": [
    {
      "feature_extractor_id": "<string>",
      "payload": {},
      "vectors": {}
    }
  ]
}
'
{}

Headers

Authorization
string

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

Examples:

"Bearer YOUR_API_KEY"

"Bearer YOUR_STRIPE_API_KEY"

X-Namespace
string

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'

Examples:

"ns_abc123def456"

"production"

"my-namespace"

Path Parameters

collection_identifier
string
required

The ID of the collection.

Body

application/json

Request model for creating a document.

collection_id
string
required

ID of the collection the document belongs to.

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
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.

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

Response

Successful Response

The response is of type object.