chart-tree-mapIngest API - Document Ingestion

The Documents API allows you to ingest documents into a custom collection. It provides two endpoints: one for single document ingestion and one for batch ingestion (multiple documents).


Authentication

Authentication

All requests to the Doti API require a Bearer token. Include it in the Authorization header:

Authorization: Bearer {YOUR_ACCESS_TOKEN}

❗ Tokens must be generated by the Doti team. They are not yet user-creatable via the Portal.


API Endpoints

Ingest a Single Document into a Custom Collection

Use this endpoint to add or update a single document in a specified custom collection. Best for quick ingestion with immediate feedback.

Endpoint:

POST https://api.doti.ai/api/v2/collections/:collectionId/documents

URL Parameters

Parameter
Type
Description

collectionId

string

The external identifier of the collection.

Request Body

The body must contain a single document. Max payload size is 10MB.

Field
Type
Required
Description

pageContent

string

Yes

The content of the document.

metadata

object

Yes

Metadata object for the document.

Metadata fields:

Field
Type
Required
Description

id

string

Yes

A unique identifier for the document.

url

string

Yes

The document’s source URL.

urlDescription

string

Yes

A short description of the URL.

lastModified

string

Yes

Last modified timestamp (ISO 8601).

additionalData

object

Yes

Additional metadata (e.g., author).

score

number

No

Optional relevance score.

Example Request

Example Responses

201 Created

400 Bad Request

409 Conflict

500 Internal Server Error


Ingest Multiple Documents into a Custom Collection (Batch)

Use this endpoint to add or update multiple documents in a collection at once. Best for efficiency when handling bulk ingestion.

Endpoint:

URL Parameters

Parameter
Type
Description

collectionId

string

The external identifier of the collection.

Request Body

The body must contain an array of documents. Max 100 documents per request, max payload 10MB.

Field
Type
Required
Description

documents

object[]

Yes

Array of document objects.

Each document has the same structure as the single ingestion request.

Example Request

Example Responses

202 Accepted

207 Multi-Status

400 Bad Request


Rate Limiting

The Documents API uses a points-based rate limiting system:

  • Single Document Endpoint: 1 point per request

  • Batch Endpoint: 10 points per request

Example (with 100 points/minute limit):

  • 100 single-document requests, OR

  • 10 batch requests, OR

  • A mix (e.g., 50 single + 5 batch).


When to Use Which Endpoint

  • Single Document (/documents) → Best for individual documents, simple error handling, immediate feedback.

  • Batch (/documents/batch) → Best for multiple documents, efficient API usage, but allows partial success scenarios.

Both endpoints ensure documents are validated, stored, and associated with the specified custom collection.

Last updated

Was this helpful?