> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getbutter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Documents

List all knowledge base documents for your organization with pagination and filtering.

### Headers

<ParamField header="X-API-Key" type="string" required>
  Your API key for authentication.
</ParamField>

<ParamField header="X-Organization-Id" type="string" required>
  The organization ID.
</ParamField>

### Query Parameters

<ParamField query="cursor" type="string">
  Pagination cursor for the next page.
</ParamField>

<ParamField query="page_size" type="integer" default="30">
  Number of documents per page (1-100).
</ParamField>

<ParamField query="search" type="string">
  Search by document name.
</ParamField>

<ParamField query="types" type="array">
  Filter by document types (`file`, `text`). Can specify multiple.
</ParamField>

<ParamField query="sort_by" type="string" default="created_at">
  Field to sort by: `name`, `created_at`, `updated_at`, or `size`.
</ParamField>

<ParamField query="sort_direction" type="string" default="desc">
  Sort direction: `asc` or `desc`.
</ParamField>

### Permissions

* `kb:read` (all roles)

### Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful.
</ResponseField>

<ResponseField name="data" type="array">
  List of document summary objects.
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata.

  <Expandable title="properties">
    <ResponseField name="next_cursor" type="string">
      Cursor for the next page (null if no more pages).
    </ResponseField>

    <ResponseField name="has_more" type="boolean">
      Whether more results exist after this page.
    </ResponseField>

    <ResponseField name="page_size" type="integer">
      Number of items in this page.
    </ResponseField>

    <ResponseField name="total_count" type="integer">
      Total number of items (if available).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": [
      {
        "documentation_id": "doc_a1b2c3d4e5f6",
        "name": "Product Manual.pdf",
        "type": "file",
        "size": 2450000,
        "filename": "Product Manual.pdf",
        "processing_status": "completed",
        "page_count": 42,
        "vector_count": 156,
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-16T14:45:00Z"
      },
      {
        "documentation_id": "doc_b2c3d4e5f6a7",
        "name": "FAQ Text",
        "type": "text",
        "word_count": 1250,
        "processing_status": "completed",
        "vector_count": 32,
        "created_at": "2024-01-10T09:00:00Z",
        "updated_at": "2024-01-10T09:00:00Z"
      }
    ],
    "pagination": {
      "next_cursor": "eyJkb2N1bWVudGF0aW9uX2lkIjogImRvY194eXoifQ==",
      "has_more": true,
      "page_size": 30
    }
  }
  ```
</ResponseExample>
