> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/open-webui/open-webui/llms.txt
> Use this file to discover all available pages before exploring further.

# List Knowledge Bases

> Retrieve paginated list of knowledge bases with access control

Retrieve a paginated list of knowledge bases accessible to the authenticated user. Results include metadata about each knowledge base and the user's write access permissions.

## Request

### Query Parameters

<ParamField query="page" type="integer" default="1">
  Page number for pagination (minimum: 1)
</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

## Response

<ResponseField name="items" type="array">
  Array of knowledge base objects with access information

  <ResponseField name="id" type="string">
    Unique identifier for the knowledge base
  </ResponseField>

  <ResponseField name="name" type="string">
    Display name of the knowledge base
  </ResponseField>

  <ResponseField name="description" type="string">
    Description of the knowledge base content
  </ResponseField>

  <ResponseField name="user_id" type="string">
    ID of the user who created the knowledge base
  </ResponseField>

  <ResponseField name="data" type="object">
    Additional metadata about the knowledge base
  </ResponseField>

  <ResponseField name="write_access" type="boolean">
    Whether the current user has write permissions
  </ResponseField>

  <ResponseField name="created_at" type="integer">
    Unix timestamp when the knowledge base was created
  </ResponseField>

  <ResponseField name="updated_at" type="integer">
    Unix timestamp when the knowledge base was last updated
  </ResponseField>
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of knowledge bases accessible to the user
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://your-domain.com/api/v1/knowledge/?page=1" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```python Python theme={null}
  import requests

  url = "https://your-domain.com/api/v1/knowledge/"
  headers = {"Authorization": "Bearer YOUR_TOKEN"}
  params = {"page": 1}

  response = requests.get(url, headers=headers, params=params)
  data = response.json()
  print(f"Found {data['total']} knowledge bases")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://your-domain.com/api/v1/knowledge/?page=1',
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN'
      }
    }
  );
  const data = await response.json();
  console.log(`Found ${data.total} knowledge bases`);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "items": [
      {
        "id": "kb_123abc",
        "name": "Product Documentation",
        "description": "Knowledge base for product documentation and guides",
        "user_id": "user_456def",
        "data": {},
        "write_access": true,
        "created_at": 1678901234,
        "updated_at": 1678901234
      },
      {
        "id": "kb_789xyz",
        "name": "Technical Support",
        "description": "Support articles and troubleshooting guides",
        "user_id": "user_456def",
        "data": {},
        "write_access": false,
        "created_at": 1678905678,
        "updated_at": 1678905678
      }
    ],
    "total": 2
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "detail": "Unauthorized"
  }
  ```
</ResponseExample>

## Search Knowledge Bases

You can also search knowledge bases using the search endpoint:

```bash theme={null}
GET /api/v1/knowledge/search?query=<search_term>&page=1
```

### Search Query Parameters

<ParamField query="query" type="string">
  Search term to filter knowledge bases
</ParamField>

<ParamField query="view_option" type="string">
  Filter by view option (e.g., "shared", "owned")
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number for pagination
</ParamField>

## Notes

* Results are paginated with 30 items per page (PAGE\_ITEM\_COUNT)
* Only knowledge bases accessible to the user are returned (based on permissions and group membership)
* Admin users with BYPASS\_ADMIN\_ACCESS\_CONTROL can see all knowledge bases
* The `write_access` field indicates whether the user can modify the knowledge base
