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

# Get Knowledge Base By Id

> Retrieves a specific knowledge base and its associated documents using the provided Knowledge Base ID. Requires `x-api-key` authentication.



## OpenAPI

````yaml GET /ext/kb/{id}
openapi: 3.0.3
info:
  title: TruGen Developer Platform API
  version: 1.0.0
  description: OpenAPI specification for MCP endpoint
servers:
  - url: https://api.trugen.ai/v1
security: []
paths:
  /ext/kb/{id}:
    get:
      summary: Get Knowledge Base by ID
      description: >-
        Retrieves a specific knowledge base and its associated documents using
        the provided Knowledge Base ID. Requires `x-api-key` authentication.
      parameters:
        - name: id
          in: path
          required: true
          description: Unique identifier of the knowledge base in UUID format.
          schema:
            type: string
            format: uuid
            example: d837afdc-f95f-4e4d-abe4-40894db22a02
      responses:
        '200':
          description: Successful Knowledge Base retrieval
          content:
            application/json:
              schema:
                type: object
                properties:
                  knowledge_base:
                    type: object
                    properties:
                      id:
                        type: string
                        description: >-
                          Unique identifier of the knowledge base in UUID
                          format.
                        format: uuid
                        example: ff152cd9-efb6-4367-a545-b861c9fbd3d0
                      name:
                        type: string
                        description: Human-readable name of the knowledge base.
                        example: Sample Knowledge Base
                      description:
                        type: string
                        description: >-
                          Short description summarizing the purpose or content
                          of the knowledge base.
                        example: HR related policies.
                      no_of_rec:
                        type: integer
                        description: >-
                          Total number of records/documents stored in the
                          knowledge base.
                        example: 20
                      created_at:
                        type: string
                        description: >-
                          Timestamp representing when the knowledge base was
                          initially created (ISO 8601 format).
                        format: date-time
                        example: '2025-10-08T16:34:19.984033Z'
                      updated_at:
                        type: string
                        description: >-
                          Timestamp representing the most recent update to the
                          knowledge base (ISO 8601 format).
                        format: date-time
                        example: '2025-10-08T16:34:19.984033Z'
                  documents:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique identifier for the document in UUID format.
                          format: uuid
                          example: 9a2ad090-aafe-4662-8eb8-a11a404431ea
                        name:
                          type: string
                          description: Original file name of the document.
                          example: hr-policies.pdf
                        type:
                          type: string
                          description: >-
                            File extension indicating the document type (`.pdf`,
                            `.docx` or `.txt`).
                          example: .pdf
                        preview_url:
                          type: string
                          description: >-
                            Publicly accessible URL to preview or download the
                            document.
                          format: uri
                          example: <PUBLIC_URL>
              example:
                knowledge_base:
                  id: ff152cd9-efb6-4367-a545-b861c9fbd3d0
                  name: Test 10
                  description: Test desc
                  no_of_rec: 20
                  created_at: '2025-10-08T16:34:19.984033Z'
                  updated_at: '2025-10-08T16:34:19.984033Z'
                documents:
                  - id: 9a2ad090-aafe-4662-8eb8-a11a404431ea
                    name: Resume.docx
                    preview_url: >-
                      https://trugen.s3.us-east-2.amazonaws.com/uploads/kb/ff152cd9-efb6-4367-a545-b861c9fbd3d0/Resume.docx
                    type: .docx
                  - id: a991725c-12b3-4bee-afc2-0689111848fe
                    name: 58910277-a9cd-4a34-91ad-23654843bce5.txt
                    preview_url: >-
                      https://trugen.s3.us-east-2.amazonaws.com/uploads/kb/ff152cd9-efb6-4367-a545-b861c9fbd3d0/58910277-a9cd-4a34-91ad-23654843bce5.txt
                    type: text
        '400':
          description: Invalid Knowledge Base ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Invalid request body
        '401':
          description: Unauthorized – Missing or invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: 'Unauthorized: not a valid authorization api key'
        '404':
          description: Knowledge Base not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                message: Knowledge Base not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Failed to retrieve knowledge base
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````