List Documents

List documents in a knowledge base with pagination, filtering, and sorting.

GET/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.

Query Parameters

workspaceId*string

The unique identifier of the workspace.

limit?integer

Maximum number of documents to return (1-100, default 50).

Default50
Range1 <= value <= 100
offset?integer

Number of documents to skip (default 0).

Default0
Range0 <= value
search?string

Search documents by filename.

enabledFilter?string

Filter by enabled status.

Default"all"
Value in"all" | "enabled" | "disabled"
sortBy?string

Field to sort by.

Default"uploadedAt"
Value in"filename" | "fileSize" | "tokenCount" | "chunkCount" | "uploadedAt" | "processingStatus" | "enabled"
sortOrder?string

Sort direction.

Default"desc"
Value in"asc" | "desc"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET \  "https://www.sim.ai/api/v1/knowledge/KB_ID/documents?workspaceId=YOUR_WORKSPACE_ID&limit=50&offset=0" \  -H "X-API-Key: YOUR_API_KEY"
{
  "success": true,
  "data": {
    "documents": [
      {
        "id": "doc_abc123",
        "knowledgeBaseId": "kb_abc123",
        "filename": "Getting Started.pdf",
        "fileSize": 204800,
        "mimeType": "application/pdf",
        "processingStatus": "completed",
        "chunkCount": 12,
        "tokenCount": 3500,
        "enabled": true,
        "createdAt": "2026-01-15T10:30:00Z"
      }
    ],
    "pagination": {
      "total": 1,
      "limit": 50,
      "offset": 0,
      "hasMore": false
    }
  }
}
{
  "error": "string",
  "details": [
    {}
  ]
}
{
  "error": "string"
}
{
  "error": "string"
}
{
  "error": "string"
}
{
  "error": "string"
}