POST
/
api
/
v1
/
assistants
/
{assistant_id}
/
documents
/
upload
"<any>"
This endpoint allows you to upload a document to an assistant’s knowledge base for Retrieval-Augmented Generation (RAG). The document will be processed, chunked, and stored as embeddings in a vector database. The request must be sent as multipart/form-data.

Path Parameters

  • assistant_id (string, required): The unique identifier of the assistant to whom the document will be added.

Form Data

  • file (file, required): The document to upload. Supported file types include .txt, .pdf, .md, and .docx.

Response

A successful request will immediately return a document object with a processing status. The document will be processed in the background. You can check the status later using the Get Document Status endpoint.
Response
{
  "id": "doc_1234567890",
  "user_id": "user_12345",
  "organization_id": "org_67890",
  "assistant_id": "asst_a1b2c3d4e5f67890",
  "name": "product_faq.pdf",
  "status": "processing",
  "created_at": "2023-10-28T16:00:00Z",
  "updated_at": "2023-10-28T16:00:00Z"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

assistant_id
integer
required

Body

multipart/form-data

Response

200
application/json

Successful Response

The response is of type any.