Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Datastore ID of the datastore in which to ingest the document
Body
File to ingest.
Metadata request in stringified JSON format. custom_metadata
is a flat dictionary containing one or more key-value pairs, where each value must be a primitive type (str
, bool
, float
, or int
). The default maximum metadata fields that can be used is 15, contact support@contextual.ai if more is needed. The combined size of the metadata must not exceed 2 KB when encoded as JSON. The strings with date format must stay in date format or be avoided if not in date format. The custom_metadata.url
or link
field is automatically included in returned attributions during query time, if provided.
**Example Request Body (as returned by `json.dumps`):**
```json
"{{
\"custom_metadata\": {{
\"topic\": \"science\",
\"difficulty\": 3
}}
}}"
```
{
"custom_metadata": { "field1": "value1", "field2": "value2" }
}
Configuration of the datastore. If not provided, the datastore's configuration is used. It should be a JSON serialized string of the datastore configuration.
{
"parsing": {
"figure_caption_mode": "custom",
"figure_captioning_prompt": "Generate a detailed caption for each figure."
}
}
Response
Successful Response
Response body from POST /data/documents
ID of the document being ingested