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

# Set current version

> Makes another version current, to roll back or forward. Agents read it straight away.



## OpenAPI

````yaml /api-reference/rest/openapi.yaml put /v1/knowledge-bases/{knowledgeId}/versions/current
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/current:
    parameters:
      - $ref: '#/components/parameters/knowledgeId'
    put:
      tags:
        - Knowledge bases
      summary: Set current version
      description: >-
        Makes another version current, to roll back or forward. Agents read it
        straight away.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
              properties:
                version:
                  type: integer
                  minimum: 1
                  description: The version to make current. It must be `ready`.
                  example: 1
      responses:
        '200':
          description: The knowledge base, now on the chosen version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBase'
        '400':
          description: The body didn't validate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseValidationError'
        '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
        '409':
          description: The version isn't `ready`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
              example:
                message: That version is not ready to be made current
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
    KnowledgeBaseValidationError:
      type: object
      properties:
        message:
          type: string
          example: Invalid payload
        errors:
          type: object
          description: Every problem found, grouped by field.
          properties:
            formErrors:
              type: array
              items:
                type: string
            fieldErrors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
    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.