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

# Get knowledge base version

> Returns one version with its parsed text, plus the previous `ready` version to compare against.



## OpenAPI

````yaml /api-reference/rest/openapi.yaml get /v1/knowledge-bases/{knowledgeId}/versions/{version}
openapi: 3.1.0
info:
  title: Zero Runtime REST API
  version: '1.0'
  description: >-
    Create, configure, version and deploy agents, and wire SIP telephony to
    them.
servers:
  - url: https://api.zeroruntime.ai
security:
  - token: []
tags:
  - name: Agents
  - name: Versions
  - name: Deployment
  - name: Phone numbers
  - name: Routing rules
  - name: Calls
  - name: Batch calls
  - name: Knowledge bases
  - name: Knowledge base folders
paths:
  /v1/knowledge-bases/{knowledgeId}/versions/{version}:
    parameters:
      - $ref: '#/components/parameters/knowledgeId'
      - name: version
        in: path
        required: true
        schema:
          type: integer
          minimum: 1
        example: 1
    get:
      tags:
        - Knowledge bases
      summary: Get knowledge base version
      description: >-
        Returns one version with its parsed text, plus the previous `ready`
        version to compare against.
      responses:
        '200':
          description: The version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  knowledgeId:
                    type: string
                  name:
                    type: string
                  currentVersion:
                    type: integer
                  latestVersion:
                    type: integer
                  version:
                    allOf:
                      - $ref: '#/components/schemas/KnowledgeBaseVersion'
                      - type: object
                        properties:
                          markdown:
                            type:
                              - string
                              - 'null'
                            description: >-
                              The parsed text. `null` while the version isn't
                              `ready`.
                  previousVersion:
                    description: >-
                      The previous `ready` version. `null` for the first
                      version.
                    oneOf:
                      - type: 'null'
                      - allOf:
                          - $ref: '#/components/schemas/KnowledgeBaseVersion'
                          - type: object
                            properties:
                              markdown:
                                type:
                                  - string
                                  - 'null'
        '400':
          description: '`version` isn''t a positive whole number.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
              example:
                message: version must be a positive integer
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: The knowledge base or the version doesn't exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
              example:
                message: Version not found
components:
  parameters:
    knowledgeId:
      name: knowledgeId
      in: path
      required: true
      schema:
        type: string
      example: k7x2m
  schemas:
    KnowledgeBaseVersion:
      type: object
      properties:
        version:
          type: integer
        status:
          $ref: '#/components/schemas/KnowledgeBaseStatus'
        statusReason:
          type:
            - string
            - 'null'
          description: Why processing failed.
        failureCode:
          type:
            - string
            - 'null'
        createdVia:
          type: string
          enum:
            - upload
            - crawl
            - edit
            - qa
          description: >-
            How the version was made: a file `upload`, a website `crawl`
            (including each auto-refresh run), an `edit`, or an answer added in
            the dashboard (`qa`).
        note:
          type:
            - string
            - 'null'
          description: The `note` sent with an edit.
        sizeInBytes:
          type:
            - integer
            - 'null'
        pageCount:
          type:
            - integer
            - 'null'
        sectionCount:
          type:
            - integer
            - 'null'
        charCount:
          type:
            - integer
            - 'null'
        isCurrent:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Message:
      type: object
      properties:
        message:
          type: string
    KnowledgeBaseStatus:
      type: string
      enum:
        - processing
        - ready
        - failed
      description: |
        - `processing`: being parsed and indexed. Not available to agents yet.
        - `ready`: indexed and available to agents.
        - `failed`: processing stopped. `statusReason` says why.
    Error:
      type: object
      properties:
        error:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid `Authorization` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: Your API token, sent raw (no `Bearer` prefix).
      x-default: <auth-token>

````

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