Request Body
Project ID to associate the document with
Name of the file/document
Type of file (e.g., pdf, txt, md, docx)
Source type of the document (e.g., upload, url, integration)
Content of the document to be indexed
Optional file ID if document is linked to a file
Response
Processing status: processing, completed, or failed
Status message or error details
Unique identifier for the created document
curl -X POST https://api.example.com/api/knowledge/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"projectId": "proj_123",
"fileName": "product-guide.pdf",
"fileType": "pdf",
"sourceType": "upload",
"content": "Complete product documentation content..."
}'
{
"status": "completed",
"message": "Document indexed successfully",
"documentId": "doc_abc123xyz"
}