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

# List Knowledge Sources

> List all knowledge sources in your account

Retrieve all knowledge sources configured for your AI agents.

## Request Body

<ParamField body="limit" type="integer" default={50}>
  Maximum sources to return. Max: 100.
</ParamField>

<ParamField body="offset" type="integer" default={0}>
  Number of records to skip for pagination.
</ParamField>

<ParamField body="sync_status" type="string">
  Filter by sync status: `pending`, `syncing`, `completed`, `failed`.
</ParamField>

## Response

<ResponseField name="sources" type="array">
  Array of knowledge source objects.
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of knowledge sources.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.magpipe.ai/functions/v1/list-knowledge-sources \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.magpipe.ai/functions/v1/list-knowledge-sources',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({}),
    }
  );

  const { sources, total } = await response.json();
  console.log(`You have ${total} knowledge sources`);
  ```

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

  response = requests.post(
      'https://api.magpipe.ai/functions/v1/list-knowledge-sources',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json',
      },
      json={}
  )

  data = response.json()
  print(f"You have {data['total']} knowledge sources")
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "sources": [
      {
        "id": "f7a8b9c0-d1e2-3f4a-5b6c-789012def345",
        "url": "https://example.com/help/faq",
        "title": "Frequently Asked Questions",
        "sync_status": "completed",
        "chunk_count": 24,
        "last_synced_at": "2024-01-15T10:35:00Z",
        "next_sync_at": "2024-01-22T10:35:00Z",
        "created_at": "2024-01-15T10:30:00Z"
      },
      {
        "id": "a8b9c0d1-e2f3-4a5b-6c7d-890123ef4567",
        "url": "https://example.com/products",
        "title": "Our Products",
        "sync_status": "completed",
        "chunk_count": 18,
        "last_synced_at": "2024-01-14T08:00:00Z",
        "next_sync_at": "2024-02-14T08:00:00Z",
        "created_at": "2024-01-14T08:00:00Z"
      }
    ],
    "total": 2
  }
  ```
</ResponseExample>
