POST
/
datastores
/
{datastore_id}
/
documents
/
{document_id}
/
metadata
curl --request POST \
  --url https://api.contextual.ai/v1/datastores/{datastore_id}/documents/{document_id}/metadata \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "custom_metadata": {}
}'
{
  "custom_metadata": {},
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "status": "pending",
  "created_at": "<string>",
  "updated_at": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

datastore_id
string
required

Datastore ID of the datastore from which to retrieve the document

document_id
string
required

Document ID of the document to retrieve details for

Body

application/json

Metadata request in JSON format. Metadata should be structured as a nested dictionary where:

  • The metadata type (currently, only custom_metadata is supported) is mapped to a dictionary. - The dictionary keys represent metadata attributes. - The values can be of type str, bool, float, or int.

Example MetadataRequest JSON:

{
    "custom_metadata": {
        "customKey1": "value3",
        "_filterKey": "filterValue3"
    }
}
custom_metadata
object

Response

200
application/json
Successful Response

Document description

id
string
required

ID of the document that was ingested

name
string
required

User specified name of the document

status
enum<string>
required

Status of this document's ingestion job

Available options:
pending,
processing,
retrying,
completed,
failed,
cancelled,
failed_to_provision,
generating_data,
training_in_progress,
failed_to_generate_data,
provisioning
created_at
string
required

Timestamp of when the document was created in ISO format.

custom_metadata
object
updated_at
string

Timestamp of when the document was modified in ISO format.