v21

latestOpenAPI 3.1.0raw.githubusercontent.com2026-01-1340148239.5 KB
/datastores/{id}/documents

Update Document Metadata

Post details of a given document that will enrich the chunk and be added to the context or just for filtering. If Just for filtering, start with "_" in the key.

put/datastores/{datastore_id}/documents/{document_id}/metadata

Path parameters

datastore_idstring uuid required

Datastore ID of the datastore from which to retrieve the document

Datastore ID of the datastore from which to retrieve the document

document_idstring uuid required

Document ID of the document to retrieve details for

Document ID of the document to retrieve details for

Request body

custom_metadataobject

Custom metadata for the document, provided by the user at ingestion time.Must be a JSON-serializable dictionary with string keys and simple primitive values (str, int, float, bool). The total size must not exceed 2 KB.The strings with date format must stay in date format or be avodied if not in date format.The 'custom_metadata.url' field is automatically included in returned attributions during query time, if provided.The default maximum metadata fields that can be used is 15, contact support if more is needed.

custom_metadata_configobject

A dictionary mapping metadata field names to the configuration to use for each field. If a metadata field is not present in the dictionary, the default configuration will be used. If the dictionary is not provided, metadata will be added in context for rerank and generation but will not be returned back to the user in retrievals in query API. Limits: - Maximum characters per metadata field (for prompt or rerank): 400 - Maximum number of metadata fields (for prompt or retrieval): 10 Contact support@contextual.ai to request quota increases.

Response

Successful Response

custom_metadataobject

Custom metadata for the document, provided by the user at ingestion time.Must be a JSON-serializable dictionary with string keys and simple primitive values (str, int, float, bool). The total size must not exceed 2 KB.The strings with date format must stay in date format or be avodied if not in date format.The 'custom_metadata.url' field is automatically included in returned attributions during query time, if provided.The default maximum metadata fields that can be used is 15, contact support if more is needed.

custom_metadata_configobject

A dictionary mapping metadata field names to the configuration to use for each field. If a metadata field is not present in the dictionary, the default configuration will be used. If the dictionary is not provided, metadata will be added in context for rerank and generation but will not be returned back to the user in retrievals in query API. Limits: - Maximum characters per metadata field (for prompt or rerank): 400 - Maximum number of metadata fields (for prompt or retrieval): 10 Contact support@contextual.ai to request quota increases.

idstring uuid required

ID of the document that was ingested

namestring required

User specified name of the document

status'pending' | 'processing' | 'retrying' | 'completed' | 'failed' | 'cancelled' required
created_atstring required

Timestamp of when the document was created in ISO format.

updated_atstring

Timestamp of when the document was modified in ISO format.

ingestion_configobject

Ingestion configuration for the document when the document was ingested. It may be different from the current datastore configuration.

has_accessboolean

Whether the user has access to this document.