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

# List sources in a knowledge base

> Lists the sources attached to a knowledge base, including each source's ingestion status and chunk progress. Requires a token with read access.



## OpenAPI

````yaml /openapi-knowledge-base.json get /knowledge-base/datasets/{dataset_id}/sources
openapi: 3.0.3
info:
  title: AnyReach Knowledge Base API
  version: 1.0.0
  description: Manage knowledge bases, their sources, and run retrieval queries.
servers:
  - url: https://api.anyreach.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Knowledge bases
    description: >-
      A knowledge base (a `dataset` in the API) is a collection of embedded
      content an agent can retrieve from.
  - name: Knowledge base sources
    description: Attach and detach sources to a knowledge base.
  - name: Sources
    description: >-
      A source is a file or URL whose content is ingested, chunked, and
      embedded.
paths:
  /knowledge-base/datasets/{dataset_id}/sources:
    get:
      tags:
        - Knowledge base sources
      summary: List sources in a knowledge base
      description: >-
        Lists the sources attached to a knowledge base, including each source's
        ingestion status and chunk progress. Requires a token with read access.
      operationId: listKnowledgeBaseSources
      parameters:
        - name: dataset_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The knowledge base ID.
        - name: source_name
          in: query
          schema:
            type: string
          description: Filter by source name (case-insensitive).
        - name: source_type
          in: query
          schema:
            $ref: '#/components/schemas/SourceType'
          description: Filter by source type.
        - name: file_extension
          in: query
          schema:
            type: string
          description: Comma-separated extensions, e.g. 'pdf' or 'txt,md'.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: Items per page.
        - name: cursor
          in: query
          schema:
            type: string
          description: Pagination cursor.
      responses:
        '200':
          description: A page of attached sources.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedKnowledgeBaseSources'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    SourceType:
      type: string
      enum:
        - FILE
        - URL
      description: Whether the source is an uploaded file or a crawled URL.
    PaginatedKnowledgeBaseSources:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseSource'
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
    KnowledgeBaseSource:
      type: object
      description: A source's attachment to a knowledge base, with its processing status.
      properties:
        id:
          type: string
          description: The attachment ID (use this to detach).
        source_id:
          type: string
          format: uuid
        dataset_id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/KnowledgeBaseSourceStatus'
        chunking_strategy:
          $ref: '#/components/schemas/ChunkingStrategy'
        total_chunks:
          type: integer
          nullable: true
          description: Total chunks to embed.
        processed_chunks:
          type: integer
          nullable: true
          description: Chunks embedded so far.
        sources:
          $ref: '#/components/schemas/Source'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    PaginationMeta:
      type: object
      properties:
        limit:
          type: integer
        next_cursor:
          type: string
          nullable: true
          description: Pass as cursor to fetch the next page. null on the last page.
    Error:
      type: object
      properties:
        detail:
          type: string
          example: Dataset not found
    KnowledgeBaseSourceStatus:
      type: string
      enum:
        - PENDING
        - CONVERTING_TO_MARKDOWN
        - CHUNKING
        - EMBEDDING
        - READY
        - FAILED
      description: >-
        Processing status of a source within a knowledge base. READY means it's
        searchable.
    ChunkingStrategy:
      type: object
      description: How the source's content is split into chunks before embedding.
      properties:
        method:
          type: string
          enum:
            - fixed
            - structure_based
          description: >-
            fixed splits by size; structure_based splits along the document's
            structure.
        chunk_size:
          type: integer
          default: 1000
          description: Target chunk size (used by the fixed method).
      required:
        - method
    Source:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique source ID.
        organization_id:
          type: string
        type:
          $ref: '#/components/schemas/SourceType'
        name:
          type: string
          description: File name (FILE) or URL (URL).
        domain:
          type: string
          nullable: true
          description: Domain, for URL sources.
        file_upload_status:
          $ref: '#/components/schemas/UploadStatus'
        chunking_strategy:
          $ref: '#/components/schemas/ChunkingStrategy'
        file_size:
          type: integer
          nullable: true
          description: Size in bytes, for file sources.
        description:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    UploadStatus:
      type: string
      enum:
        - PENDING
        - IN_PROGRESS
        - COMPLETE
        - FAILED
      description: Upload/ingestion status of the source's content.
  responses:
    Forbidden:
      description: The token's role doesn't grant access to this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal access token. See Authentication.

````