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

# Get knowledge base

> Get a knowledge base and its documents.



## OpenAPI

````yaml api-reference/knowledge-bases/openapi.json GET /v1/knowledge-bases/{kbId}
openapi: 3.0.3
info:
  title: Persistence Knowledge Bases API
  version: '1.0'
  description: Create and manage knowledge bases.
servers:
  - url: https://api.persistence.dev
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Knowledge bases
paths:
  /v1/knowledge-bases/{kbId}:
    get:
      tags:
        - Knowledge bases
      summary: Get knowledge base
      operationId: getKnowledgeBase
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseEnvelope'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    KnowledgeBaseId:
      name: kbId
      in: path
      required: true
      schema:
        type: string
  schemas:
    KnowledgeBaseEnvelope:
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/KnowledgeBase'
    KnowledgeBase:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - empty
            - processing
            - ready
            - failed
        documentCount:
          type: integer
          format: int64
        documents:
          type: array
          items:
            $ref: '#/components/schemas/Document'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        code:
          type: string
        error:
          type: string
    Document:
      type: object
      properties:
        id:
          type: string
        fileName:
          type: string
        fileType:
          type: string
        fileSizeBytes:
          type: integer
          format: int64
        extractedTextSizeBytes:
          type: integer
          format: int64
          nullable: true
        status:
          type: string
          enum:
            - pending
            - extracting
            - chunking
            - embedding
            - ready
            - failed
        errorMessage:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````