> ## 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

> Returns the knowledge base with the parsed text your agent retrieves from.

<Note>
While an [edit](/api-reference/knowledge-bases/edit-knowledge-base-content) is indexing, this already returns the edited text and version. Agents read the previous version until indexing completes.
</Note>




## OpenAPI

````yaml /api-reference/rest/openapi.yaml get /v1/knowledge-bases/{knowledgeId}
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}:
    parameters:
      - $ref: '#/components/parameters/knowledgeId'
    get:
      tags:
        - Knowledge bases
      summary: Get knowledge base
      description: >
        Returns the knowledge base with the parsed text your agent retrieves
        from.


        <Note>

        While an
        [edit](/api-reference/knowledge-bases/edit-knowledge-base-content) is
        indexing, this already returns the edited text and version. Agents read
        the previous version until indexing completes.

        </Note>
      responses:
        '200':
          description: The knowledge base.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/KnowledgeBase'
                  - type: object
                    properties:
                      markdown:
                        type:
                          - string
                          - 'null'
                        description: >-
                          The parsed text of the current version. `null` until
                          `status` is `ready`.
                      fileUrl:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Downloads the original file. `null` until `status` is
                          `ready`, and for website knowledge bases.
                      fileUrlExpiresAt:
                        type:
                          - string
                          - 'null'
                        format: date-time
                        description: When `fileUrl` stops working
                        an hour after the request.: null
                      sourceUrl:
                        type:
                          - string
                          - 'null'
                        description: >-
                          The site the pages are on. Website knowledge bases
                          only.
                      pages:
                        type: array
                        items:
                          type: string
                        description: >-
                          The pages that are parsed. Website knowledge bases
                          only.
              example:
                knowledgeId: w8d3k
                name: 'Help center: billing'
                type: url
                status: ready
                statusReason: null
                failureCode: null
                sizeInBytes: 0
                pageCount: 3
                sectionCount: 21
                charCount: 18240
                folderId: null
                currentVersion: 1
                latestVersion: 1
                createdAt: '2026-10-13T09:30:00.000Z'
                updatedAt: '2026-10-13T09:31:12.000Z'
                markdown: |-
                  # Billing

                  You're billed on the first of each month...
                fileUrl: null
                fileUrlExpiresAt: null
                sourceUrl: https://help.example.com
                pages:
                  - https://help.example.com/billing
                  - https://help.example.com/billing/refunds
                  - https://help.example.com/plans
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: The knowledge base isn't yours or is deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
              example:
                message: Knowledge base not found
components:
  parameters:
    knowledgeId:
      name: knowledgeId
      in: path
      required: true
      schema:
        type: string
      example: k7x2m
  schemas:
    KnowledgeBase:
      type: object
      description: Status and size fields describe the current version.
      properties:
        knowledgeId:
          type: string
          description: 5 characters
          lowercase letters and digits. Attach it to an agent with `knowledgeBaseIds`.: null
          example: k7x2m
        name:
          type: string
          example: pricing.pdf
        type:
          type: string
          enum:
            - pdf
            - txt
            - csv
            - json
            - docx
            - md
            - url
        status:
          $ref: '#/components/schemas/KnowledgeBaseStatus'
        statusReason:
          type:
            - string
            - 'null'
          description: Why processing failed.
        failureCode:
          type:
            - string
            - 'null'
          description: For example `upload_failed` or `job_not_scheduled`.
        sizeInBytes:
          type:
            - integer
            - 'null'
          description: '`0` for website knowledge bases.'
        pageCount:
          type:
            - integer
            - 'null'
        sectionCount:
          type:
            - integer
            - 'null'
        charCount:
          type:
            - integer
            - 'null'
        folderId:
          type:
            - string
            - 'null'
          description: '`null` when it''s at the top level.'
        currentVersion:
          type: integer
          description: The version agents read from.
        latestVersion:
          type: integer
          description: The newest version. It may still be processing
          or may have failed.: null
        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.