main
knowledge-base

Trigger document processing

Changed on

Trigger asynchronous processing of an uploaded document.

This endpoint should be called after successfully uploading a file to the presigned URL. It will:

  1. Create a document record in the database with the specified UUID
  2. Enqueue a background task to process the document (chunking and embedding)

The document status will be updated from 'pending' -> 'processing' -> 'completed' or 'failed'.

Embedding: Uses OpenAI text-embedding-3-small (1536-dimensional embeddings, requires API key configured in Model Configurations).

Access Control:

  • Users can only process documents in their organization.
post/api/v1/knowledge-base/process-document

Request

  • Base URL
    https://app.dograh.com
  • URL
    https://app.dograh.com/api/v1/knowledge-base/process-document
  • Auth
    none declared

Headers

authorizationstring nullable
X-API-Keystring nullable

Request body

document_uuidstring required

Document UUID to process

s3_keystring required

S3 key of the uploaded file

retrieval_modestring

Retrieval mode: 'chunked' for vector search or 'full_document' for full text retrieval

Response

Successful Response

idinteger required
document_uuidstring required
filenamestring required
file_size_bytesinteger required
file_hashstring required
mime_typestring required
processing_statusstring required
processing_errorstring nullable
total_chunksinteger required
retrieval_modestring
custom_metadataobject required
docling_metadataobject required
source_urlstring nullable
created_atstring date-time required
updated_atstring date-time required
organization_idinteger required
created_byinteger required
is_activeboolean required
has_live_contentboolean

Whether agents can currently retrieve this document's content. Stays true while an edited document is re-indexed or after its re-index fails, because the previous version keeps serving until a new one succeeds.

Changes