Upload Document
POST
/api/v1/knowledge/{id}/documentsAuthorization
apiKey X-API-Key<token>
Your Sim API key (personal or workspace). Generate one from the Sim dashboard under Settings > API Keys.
In: header
Path Parameters
id*string
Knowledge base ID.
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST \ "https://www.sim.ai/api/v1/knowledge/KB_ID/documents" \ -H "X-API-Key: YOUR_API_KEY" \ -F "workspaceId=YOUR_WORKSPACE_ID" \ -F "file=@/path/to/document.pdf"{
"success": true,
"data": {
"document": {
"id": "b6e2a8d4-5c7f-4a1b-8d3e-0f9c1b5a7e29",
"knowledgeBaseId": "d2c8f4a6-1b3e-4c5d-9e7f-8a0b2c4d6e1f",
"filename": "Getting Started.pdf",
"fileSize": 204800,
"mimeType": "application/pdf",
"processingStatus": "pending",
"chunkCount": 0,
"tokenCount": 0,
"enabled": true,
"createdAt": "2026-01-15T10:30:00Z"
},
"message": "Document uploaded successfully. Processing will begin shortly."
}
}{
"error": "string",
"details": [
{}
]
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}