---
title: "List Documents"
method: GET
path: "/api/v1/knowledge/{id}/documents"
tags: ["Knowledge Bases"]
---

# List Documents

`GET /api/v1/knowledge/{id}/documents`

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

## Path parameters

- `id` string, required

## Query parameters

- `workspaceId` string, required
- `limit` integer
- `offset` integer
- `search` string
- `enabledFilter` 'all' | 'enabled' | 'disabled'
- `sortBy` 'filename' | 'fileSize' | 'tokenCount' | 'chunkCount' | 'uploadedAt' | 'processingStatus' | 'enabled'
- `sortOrder` 'asc' | 'desc'

## Response `200`

List of documents.

- object
  - `success` boolean — Whether the request was successful.
  - `data` object — Response payload containing the documents and pagination info.
    - `documents` KnowledgeDocument[] — Array of document objects in the knowledge base.
      - `id` string — Unique document identifier.
      - `knowledgeBaseId` string — Knowledge base this document belongs to.
      - `filename` string — Original filename.
      - `fileSize` integer — File size in bytes.
      - `mimeType` string — MIME type of the file.
      - `processingStatus` 'pending' | 'processing' | 'completed' | 'failed' — Current processing status.
      - `chunkCount` integer — Number of chunks created from this document.
      - `tokenCount` integer — Total token count.
      - `characterCount` integer — Total character count.
      - `enabled` boolean — Whether the document is enabled for search.
      - `createdAt` string, date-time — ISO 8601 timestamp when the document was uploaded.
    - `pagination` object — Pagination metadata for the document list.
      - `total` integer — Total number of documents matching the query.
      - `limit` integer — Maximum number of documents returned per page.
      - `offset` integer — Number of documents skipped from the beginning.
      - `hasMore` boolean — Whether there are more documents beyond the current page.

## Other responses

- `400` — Invalid request parameters. Check the details array for specific validation errors.
- `401` — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.
- `403` — Access denied. You do not have permission to access this resource. For audit log endpoints, this requires an Enterprise subscription and organization admin/owner role.
- `404` — The requested resource was not found. Verify the ID is correct and belongs to your workspace.
- `429` — Rate limit exceeded. Wait for the duration specified in the Retry-After header before retrying. The X-RateLimit-* headers accompany every response from an authenticated v1 request — success and error alike — and are omitted only when the request fails authentication, since no rate-limit bucket is consulted in that case.

---

[API](https://skmtc.dev/simstudioai/apis/sim-api.md) · [All operations](https://skmtc.dev/simstudioai/apis/sim-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/simstudioai/sim-api/revisions/66a471c5b1df/schema)
