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

# Get Knowledge Base

> Retrieve details of a specific knowledge base



## OpenAPI

````yaml openapi-final get /get-knowledge-base/{knowledge_base_id}
openapi: 3.0.3
info:
  title: Retell SDK
  version: 3.0.0
  x-retell-spec-revision: 2026-11-12-056ac2f
  contact:
    name: Retell Support
    url: https://www.retellai.com/
    email: support@retellai.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.retellai.com
    description: The production server.
security:
  - api_key: []
paths:
  /get-knowledge-base/{knowledge_base_id}:
    get:
      description: Retrieve details of a specific knowledge base
      operationId: getKnowledgeBase
      parameters:
        - in: path
          name: knowledge_base_id
          schema:
            type: string
            example: kb_1234567890
          required: true
          description: The knowledge base id to retrieve.
      responses:
        '200':
          description: Successfully retrieved a knowledge base.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Retell from 'retell-sdk';


            const client = new Retell({
              apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
            });


            const knowledgeBaseResponse = await
            client.knowledgeBase.retrieve('kb_1234567890');


            console.log(knowledgeBaseResponse.knowledge_base_id);
        - lang: Python
          source: |-
            import os
            from retell import Retell

            client = Retell(
                api_key=os.environ.get("RETELL_API_KEY"),  # This is the default and can be omitted
            )
            knowledge_base_response = client.knowledge_base.retrieve(
                "kb_1234567890",
            )
            print(knowledge_base_response.knowledge_base_id)
components:
  schemas:
    KnowledgeBaseResponse:
      type: object
      required:
        - knowledge_base_id
        - knowledge_base_name
        - status
        - remaining_ingestion_quota
        - ingestion_limits
      properties:
        knowledge_base_id:
          type: string
          example: knowledge_base_a456426614174000
          description: Unique id of the knowledge base.
        knowledge_base_name:
          type: string
          example: Sample KB
          description: Name of the knowledge base. Must be less than 40 characters.
        remaining_ingestion_quota:
          type: object
          nullable: true
          required:
            - files
            - texts
            - urls
          properties:
            files:
              type: integer
              minimum: 0
              description: >-
                Remaining additions in the shared uploaded-file and connector
                bucket.
            texts:
              type: integer
              minimum: 0
              description: Remaining pasted-text additions.
            urls:
              type: integer
              minimum: 0
              description: Remaining URL additions.
          description: >
            Ingestion quota available to this knowledge base at response time.

            Includes unused lifetime fill allowance plus remaining rolling

            30-day per-KB capacity. Pending reservations already consume

            capacity. Default per-KB rolling limits are 25 files, 50 texts,

            and 200 URLs; organization-specific increases are reflected in

            these counts.

            Legacy knowledge bases without fill allowance receive rolling

            capacity only. Deleting sources does not restore ingestion quota.

            These counts do not include the separate limits on how many sources

            a KB can hold, and do not guarantee a concurrent request will
            succeed.

            Create and add-source responses include reservations for accepted

            sources; background discovery and processing may change the counts.

            Returns null if current usage cannot be read. Null means
            unavailable,

            not zero remaining capacity. Configured ingestion_limits are still

            returned. Quota enforcement remains required for ingestion requests.
          example:
            files: 25
            texts: 50
            urls: 200
        ingestion_limits:
          $ref: '#/components/schemas/KnowledgeBaseEffectiveIngestionLimits'
        status:
          type: string
          enum:
            - in_progress
            - complete
            - error
            - refreshing_in_progress
          example: in_progress
          description: >
            Current processing state of the knowledge base:


            - `in_progress`: Initial indexing is running. Source metadata may be
              incomplete until indexing finishes.
            - `complete`: Initial indexing or the latest update or refresh
              finished. Individual source failures may still be reported in
              `error_messages`.
            - `error`: Initial indexing failed. Source metadata may be
            incomplete.

            - `refreshing_in_progress`: An existing knowledge base is being
              updated. This includes indexing newly added sources or running a
              manual or automatic refresh that re-indexes URLs, Google Drive
              files, Microsoft OneDrive files, and pages from auto-crawling
              paths. Previously indexed sources remain available during the
              update, and the source list may change when it finishes.
        max_chunk_size:
          type: integer
          example: 2000
          description: >-
            Maximum number of characters per chunk when splitting knowledge base
            content.
        min_chunk_size:
          type: integer
          example: 400
          description: >-
            Minimum number of characters per chunk. Chunks smaller than this are
            merged with adjacent chunks.
        knowledge_base_sources:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/KnowledgeBaseSourceDocument'
              - $ref: '#/components/schemas/KnowledgeBaseSourceText'
              - $ref: '#/components/schemas/KnowledgeBaseSourceUrl'
          description: >-
            Sources of the knowledge base. Will be populated after the
            processing is done (when status is "complete").
        enable_auto_refresh:
          type: boolean
          example: true
          description: >-
            Whether eligible URL and connected-file sources refresh
            automatically on a daily cadence.
        last_refreshed_timestamp:
          type: integer
          example: 1703413636133
          description: >-
            Last refreshed timestamp (milliseconds since epoch). Only applicable
            when enable_auto_refresh is true.
    KnowledgeBaseEffectiveIngestionLimits:
      type: object
      description: >
        Effective rolling 30-day ingestion limits. Each KB has an independent
        budget. Lifetime fill allowance

        and structural source-count caps are separate.
      example:
        files: 25
        texts: 50
        urls: 200
      required:
        - files
        - texts
        - urls
      properties:
        files:
          type: integer
          minimum: 0
          description: Shared limit for uploaded documents and all connected-file sources.
        texts:
          type: integer
          minimum: 0
          description: Limit for pasted-text sources.
        urls:
          type: integer
          minimum: 0
          description: Limit for URL sources.
    KnowledgeBaseSourceDocument:
      type: object
      required:
        - type
        - source_id
        - filename
        - file_url
        - file_size
      properties:
        type:
          type: string
          enum:
            - document
          description: Type of the knowledge base source.
        source_id:
          type: string
          description: Unique id of the knowledge base source.
        filename:
          type: string
          description: Filename of the document.
        file_url:
          type: string
          description: URL of the document stored.
        file_size:
          type: number
          description: File size in bytes.
    KnowledgeBaseSourceText:
      type: object
      required:
        - type
        - source_id
        - title
        - content_url
      properties:
        type:
          type: string
          enum:
            - text
          description: Type of the knowledge base source.
        source_id:
          type: string
          description: Unique id of the knowledge base source.
        title:
          type: string
          description: Title of the text.
        content_url:
          type: string
          description: URL of the text content stored.
    KnowledgeBaseSourceUrl:
      type: object
      required:
        - type
        - source_id
        - url
      properties:
        type:
          type: string
          enum:
            - url
          description: Type of the knowledge base source.
        source_id:
          type: string
          description: Unique id of the knowledge base source.
        url:
          type: string
          description: URL used to be scraped and added to the knowledge base.
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: API key is missing or invalid.
    UnprocessableContent:
      description: Unprocessable Content
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: Cannot find requested asset under given api key.
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: Account rate limited, please throttle your requests.
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: An unexpected server error occurred.
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      bearerFormat: string
      description: >-
        Authentication header containing API key (find it in dashboard). The
        format is "Bearer YOUR_API_KEY"

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.