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

# List knowledge base sources

> List the files and websites in the agent's knowledge base.

Each source includes its document count and its most recent sync run.
Sources are shared across all branches of the agent. Deleted sources
are not returned.

This endpoint does not return `status`; get an individual source to
check its processing status.



## OpenAPI

````yaml GET /v1/agents/{agentId}/knowledge-base/sources
openapi: 3.1.0
info:
  title: PolyAI Agents API
  version: 1.0.11
  description: Manage PolyAI agents, telephony, deployments, and real-time configs.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.studio.poly.ai
    description: Studio region
security:
  - polyApiKey: []
paths:
  /v1/agents/{agentId}/knowledge-base/sources:
    parameters:
      - name: agentId
        in: path
        required: true
        schema:
          type: string
    get:
      tags:
        - Source Hub
      summary: List knowledge base sources
      description: |-
        List the files and websites in the agent's knowledge base.

        Each source includes its document count and its most recent sync run.
        Sources are shared across all branches of the agent. Deleted sources
        are not returned.

        This endpoint does not return `status`; get an individual source to
        check its processing status.
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            default: 50
            minimum: 1
            maximum: 200
            type: integer
          description: Maximum number of sources to return (1-200)
        - name: offset
          in: query
          required: false
          schema:
            default: 0
            minimum: 0
            type: integer
          description: Number of sources to skip
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSourcesResponse'
        '400':
          description: Validation error
        '401':
          description: Unauthorized – missing or invalid API key
        '403':
          description: Forbidden – insufficient permissions
components:
  schemas:
    GetSourcesResponse:
      description: |-
        A page of the agent's knowledge base sources, with the total count
        and limit/offset pagination details.
      type: object
      properties:
        sources:
          description: Sources on this page, ordered by id
          type: array
          items:
            $ref: '#/components/schemas/SourceResponse'
        count:
          description: Total number of sources across all pages
          type: integer
        limit:
          description: Maximum number of sources per page
          type: integer
        offset:
          description: Number of sources skipped
          type: integer
      required:
        - sources
        - count
        - limit
        - offset
    SourceResponse:
      description: |-
        A knowledge base source, with its document count and sync state.
        Sources are shared across all branches of the agent.
      type: object
      properties:
        targetEnvSandbox:
          description: Whether the source is used in sandbox
          type:
            - boolean
            - 'null'
        targetEnvPrerelease:
          description: Whether the source is used in pre-release
          type:
            - boolean
            - 'null'
        targetEnvLive:
          description: Whether the source is used in live
          type:
            - boolean
            - 'null'
        variantIds:
          description: >-
            Variants the source applies to. An empty list or null applies it to
            all variants
          type:
            - array
            - 'null'
          items:
            type: string
        id:
          description: Unique source identifier
          type: string
        accountId:
          description: Account this source belongs to
          type: string
        projectId:
          description: Agent (project) this source belongs to
          type:
            - string
            - 'null'
        name:
          description: Display name of the source
          type: string
        createdAt:
          description: When the source was created
          type: string
        updatedAt:
          description: When the source was last updated
          type:
            - string
            - 'null'
        createdBy:
          description: Email of the user who created the source
          type: string
        updatedBy:
          description: Email of the user who last updated the source
          type:
            - string
            - 'null'
        sourceType:
          description: Source type (file, website)
          type: string
        sourceUrl:
          description: URL a website source is crawled from
          type:
            - string
            - 'null'
        syncInterval:
          description: Seconds between scheduled syncs; null when not scheduled
          type:
            - integer
            - 'null'
        webScrapeConfig:
          description: How a website source is crawled
          anyOf:
            - $ref: '#/components/schemas/WebScrapeConfigResponse'
            - type: 'null'
        documentCount:
          description: Number of live documents ingested from the source
          type: integer
        latestSyncRun:
          description: The source's most recent sync run
          anyOf:
            - $ref: '#/components/schemas/SourceSyncRunResponse'
            - type: 'null'
      required:
        - id
        - accountId
        - name
        - createdAt
        - createdBy
        - sourceType
        - documentCount
    WebScrapeConfigResponse:
      description: >-
        Crawl settings for a website source. Unset settings use the crawler
        defaults.
      type: object
      properties:
        pageLimit:
          description: Maximum number of pages the crawl visits
          type:
            - integer
            - 'null'
    SourceSyncRunResponse:
      description: A source's most recent sync run.
      type: object
      properties:
        syncRunId:
          description: Unique sync run identifier
          type: string
        status:
          description: Run status (started, succeeded, failed)
          type: string
        startedAt:
          description: When the run started
          type: string
        finishedAt:
          description: When the run finished; null while it is running
          type:
            - string
            - 'null'
        errorCode:
          description: Reason the run failed, if it failed
          type:
            - string
            - 'null'
      required:
        - syncRunId
        - status
        - startedAt
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````