Upload Document

Upload a document to a knowledge base. The document will be processed asynchronously (chunked and embedded). Maximum file size is 100MB.

POST/api/v1/knowledge/{id}/documents
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": "doc_abc123",
      "knowledgeBaseId": "kb_abc123",
      "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"
}