Skip to main content

Create a document

POST 

/v1/projects/:project_id/knowledge/collections/:collection_id/documents

Add a document to the collection, from inline text (content) or from an uploaded file (file, base64, plus content_type and filename) — exactly one of the two.

application/pdf, text/plain and text/markdown are extracted natively. Any other media type needs a converter (POST /v1/projects/{project_id}/knowledge/converters) registered for it in the project; without one the request is rejected with unsupported_content_type and no document is created.

Ingestion (extract → chunk → embed) runs in the background: the document comes back pending and becomes indexed or failed, which is announced by the knowledge.document_ingested / knowledge.ingest_failed webhook events.

Request

Responses

Document created.