POST
/
v2
/
documents
Create Document
curl --request POST \
  --url https://tavusapi.com/v2/documents \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "document_url": "https://example.com/document.pdf",
  "document_name": "Important Document",
  "callback_url": "https://your-server.com/webhook",
  "properties": {
    "department": "sales",
    "priority": "high"
  },
  "tags": [
    "important",
    "meeting"
  ]
}'
{
  "uuid": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "document_name": "Important Document",
  "document_url": "https://example.com/document.pdf",
  "status": "processing",
  "created_at": "2024-01-01T12:00:00Z",
  "updated_at": "2024-01-01T12:00:00Z",
  "callback_url": "https://your-server.com/webhook",
  "tags": [
    "important",
    "meeting"
  ],
  "properties": {
    "department": "sales",
    "priority": "high"
  }
}
Create a new document to be used via RAG. When you hit this endpoint, Tavus kicks off the processing of the document. We process the document to be used as part of your knowledge base in conversations. The file size limit is 50MB. The processing can take up to a few minutes depending on file size. Currently .pdf, .txt, .docx, .doc, .png, .jpg, .pptx, .csv, and .xlsx are supported, along with providing website URLs, which will be visited and parsed to be turned into a document. You can manage documents by adding tags using the document_tags entry in the request body. Once created, you can add the document to your personas (see Create Persona) and your conversations (see Create Conversation).

Authorizations

x-api-key
string
header
required

Body

application/json

Response

200
application/json

Document created successfully

The response is of type object.