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

> Retrieves paginated pages for a specific knowledge base source file. Use this endpoint to inspect the individual pages extracted from a knowledge base source.

# Get Source Pages

For the complete error reference, see [Error Guide](/rest-api/ai-agents-apis/error-codes).


## OpenAPI

````yaml get /ai-agents/agent-builder/knowledge-base/{sourceType}/{uniqueId}/pages
openapi: 3.0.0
info:
  title: AI Agents APIs
  description: API reference for CometChat AI Agents service
  version: '1.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: ai-agent
    description: ''
paths:
  /ai-agents/agent-builder/knowledge-base/{sourceType}/{uniqueId}/pages:
    get:
      tags:
        - knowledge-base
      summary: Get Source Pages
      description: >-
        Retrieves paginated pages for a specific knowledge base source file. Use
        this endpoint to inspect the individual pages extracted from a knowledge
        base source.
      operationId: RagController_getSourcePages
      parameters:
        - name: sourceType
          required: true
          in: path
          description: Source type (uploads, text, website)
          schema:
            enum:
              - uploads
              - text
              - website
            type: string
        - name: uniqueId
          required: true
          in: path
          description: Unique file ID to fetch pages for
          schema:
            type: string
        - name: limit
          required: false
          in: query
          schema:
            type: number
          description: Maximum number of results to return per page.
        - name: page
          required: false
          in: query
          description: To be used with affix for pagination.
          schema:
            type: number
        - name: affix
          required: false
          in: query
          schema:
            enum:
              - prepend
              - append
            type: string
          description: >-
            To paginate over results, use the value of affix as prepend or
            append.
      responses:
        '200':
          description: Source pages retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      sourceDetails:
                        type: object
                        properties:
                          fileName:
                            type: string
                            example: product-guide.pdf
                          totalPages:
                            type: number
                            example: 1
                          createdAt:
                            type: integer
                            example: '2026-03-12T12:52:28.063000'
                      pageContent:
                        type: array
                        items:
                          type: object
                          properties:
                            content:
                              type: string
                            pageNumber:
                              type: number
                            charCount:
                              type: number
                  meta:
                    type: object
                    properties:
                      current:
                        type: object
                        properties:
                          limit:
                            type: number
                          count:
                            type: number
              example:
                data:
                  sourceDetails:
                    fileName: product-guide.pdf
                    totalPages: 1
                    createdAt: '2026-03-12T12:52:28.063000'
                  pageContent:
                    - content: >-
                        This is the extracted text content from the first page
                        of the uploaded document. It contains the information
                        that was indexed into the knowledge base for retrieval
                        during agent conversations.
                      pageNumber: 1
                      charCount: 185
                meta:
                  current:
                    limit: 1
                    count: 1
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````