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

# Restore a commit

> Makes an earlier commit the latest again, as a new commit: history is never rewritten. It brings back everything that commit held, including actions and knowledge bases set in the dashboard. On the live version callers hear it at once. Refused with `draft_pending` while a draft exists, unless `discard_draft` is true.



## OpenAPI

````yaml /api-reference/openapi.json post /agents/{id}/versions/{vid}/restore
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Public REST API for Brilo. Authenticate by sending your API key as a Bearer
    token in the `Authorization` header.
  title: Brilo API
  version: '2025-03-02'
servers:
  - description: Production
    url: https://api.brilo.ai/v1
security: []
tags: []
paths:
  /agents/{id}/versions/{vid}/restore:
    post:
      tags:
        - Agents (public)
      summary: Restore a commit
      description: >-
        Makes an earlier commit the latest again, as a new commit: history is
        never rewritten. It brings back everything that commit held, including
        actions and knowledge bases set in the dashboard. On the live version
        callers hear it at once. Refused with `draft_pending` while a draft
        exists, unless `discard_draft` is true.
      operationId: restoreAgentVersion
      parameters:
        - description: Agent id (UUID).
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Version id (UUID).
          in: path
          name: vid
          required: true
          schema:
            type: string
        - description: >-
            Optional. A retry with the same key and body returns the first
            response instead of doing the work twice.
          in: header
          name: Idempotency-Key
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                commit_id:
                  description: >-
                    A commit from this version, as list_agent_version_history
                    returns it.
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  type: string
                discard_draft:
                  description: >-
                    Throw away the draft first. Without it a draft returns
                    draft_pending.
                  type: boolean
              required:
                - commit_id
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  agent_id:
                    type: string
                  changed_fields:
                    items:
                      type: string
                    type: array
                  created_at:
                    type: string
                  description:
                    nullable: true
                    type: string
                  draft:
                    additionalProperties: false
                    nullable: true
                    properties:
                      config:
                        additionalProperties: false
                        properties:
                          call_handling:
                            additionalProperties: false
                            properties:
                              greeting_interruptible:
                                type: boolean
                              idle_reminder:
                                additionalProperties: false
                                properties:
                                  after_seconds:
                                    maximum: 9007199254740991
                                    minimum: -9007199254740991
                                    nullable: true
                                    type: integer
                                  enabled:
                                    type: boolean
                                  message:
                                    nullable: true
                                    type: string
                                required:
                                  - enabled
                                  - after_seconds
                                  - message
                                type: object
                              max_duration_seconds:
                                maximum: 9007199254740991
                                minimum: -9007199254740991
                                type: integer
                              silence_timeout_seconds:
                                maximum: 9007199254740991
                                minimum: -9007199254740991
                                nullable: true
                                type: integer
                            required:
                              - max_duration_seconds
                              - silence_timeout_seconds
                              - idle_reminder
                              - greeting_interruptible
                            type: object
                          greeting:
                            nullable: true
                            type: string
                          instructions:
                            nullable: true
                            type: string
                          languages:
                            items:
                              type: string
                            type: array
                          model:
                            additionalProperties: false
                            properties:
                              id:
                                nullable: true
                                type: string
                            required:
                              - id
                            type: object
                          recording:
                            additionalProperties: false
                            properties:
                              consent:
                                additionalProperties: false
                                properties:
                                  prompt:
                                    nullable: true
                                    type: string
                                  type:
                                    type: string
                                required:
                                  - type
                                  - prompt
                                type: object
                              enabled:
                                type: boolean
                              transcript_enabled:
                                type: boolean
                            required:
                              - enabled
                              - consent
                              - transcript_enabled
                            type: object
                          timezone:
                            nullable: true
                            type: string
                          transcriber:
                            additionalProperties: false
                            properties:
                              id:
                                nullable: true
                                type: string
                            required:
                              - id
                            type: object
                          voice:
                            additionalProperties: false
                            properties:
                              id:
                                nullable: true
                                type: string
                              speaking_rate:
                                type: number
                            required:
                              - id
                              - speaking_rate
                            type: object
                          voicemail:
                            additionalProperties: false
                            properties:
                              behavior:
                                nullable: true
                                type: string
                              message:
                                nullable: true
                                type: string
                            required:
                              - behavior
                              - message
                            type: object
                        required:
                          - greeting
                          - instructions
                          - voice
                          - model
                          - transcriber
                          - languages
                          - timezone
                          - call_handling
                          - voicemail
                          - recording
                        type: object
                      id:
                        type: string
                      updated_at:
                        type: string
                    required:
                      - id
                      - config
                      - updated_at
                    type: object
                  draft_pending:
                    type: boolean
                  head_commit:
                    additionalProperties: false
                    nullable: true
                    properties:
                      committed_at:
                        nullable: true
                        type: string
                      config:
                        additionalProperties: false
                        properties:
                          call_handling:
                            additionalProperties: false
                            properties:
                              greeting_interruptible:
                                type: boolean
                              idle_reminder:
                                additionalProperties: false
                                properties:
                                  after_seconds:
                                    maximum: 9007199254740991
                                    minimum: -9007199254740991
                                    nullable: true
                                    type: integer
                                  enabled:
                                    type: boolean
                                  message:
                                    nullable: true
                                    type: string
                                required:
                                  - enabled
                                  - after_seconds
                                  - message
                                type: object
                              max_duration_seconds:
                                maximum: 9007199254740991
                                minimum: -9007199254740991
                                type: integer
                              silence_timeout_seconds:
                                maximum: 9007199254740991
                                minimum: -9007199254740991
                                nullable: true
                                type: integer
                            required:
                              - max_duration_seconds
                              - silence_timeout_seconds
                              - idle_reminder
                              - greeting_interruptible
                            type: object
                          greeting:
                            nullable: true
                            type: string
                          instructions:
                            nullable: true
                            type: string
                          languages:
                            items:
                              type: string
                            type: array
                          model:
                            additionalProperties: false
                            properties:
                              id:
                                nullable: true
                                type: string
                            required:
                              - id
                            type: object
                          recording:
                            additionalProperties: false
                            properties:
                              consent:
                                additionalProperties: false
                                properties:
                                  prompt:
                                    nullable: true
                                    type: string
                                  type:
                                    type: string
                                required:
                                  - type
                                  - prompt
                                type: object
                              enabled:
                                type: boolean
                              transcript_enabled:
                                type: boolean
                            required:
                              - enabled
                              - consent
                              - transcript_enabled
                            type: object
                          timezone:
                            nullable: true
                            type: string
                          transcriber:
                            additionalProperties: false
                            properties:
                              id:
                                nullable: true
                                type: string
                            required:
                              - id
                            type: object
                          voice:
                            additionalProperties: false
                            properties:
                              id:
                                nullable: true
                                type: string
                              speaking_rate:
                                type: number
                            required:
                              - id
                              - speaking_rate
                            type: object
                          voicemail:
                            additionalProperties: false
                            properties:
                              behavior:
                                nullable: true
                                type: string
                              message:
                                nullable: true
                                type: string
                            required:
                              - behavior
                              - message
                            type: object
                        required:
                          - greeting
                          - instructions
                          - voice
                          - model
                          - transcriber
                          - languages
                          - timezone
                          - call_handling
                          - voicemail
                          - recording
                        type: object
                      id:
                        type: string
                      made_live_at:
                        nullable: true
                        type: string
                      status:
                        enum:
                          - live
                          - published
                          - history
                        type: string
                    required:
                      - id
                      - status
                      - committed_at
                      - made_live_at
                      - config
                    type: object
                  id:
                    type: string
                  is_live:
                    type: boolean
                  name:
                    type: string
                  next_action:
                    additionalProperties: false
                    properties:
                      body:
                        additionalProperties: {}
                        type: object
                      method:
                        type: string
                      path:
                        type: string
                      tool:
                        type: string
                    required:
                      - tool
                      - method
                      - path
                    type: object
                  revision:
                    nullable: true
                    type: string
                  status:
                    type: string
                  try_it:
                    additionalProperties: false
                    description: >-
                      Ways to hear the live agent now. Left out when nothing is
                      callable.
                    properties:
                      phone_numbers:
                        items:
                          type: string
                        type: array
                      ring_me:
                        additionalProperties: false
                        properties:
                          ask_owner_first:
                            type: string
                          body:
                            additionalProperties: false
                            properties:
                              agent_id:
                                type: string
                              to:
                                type: string
                            required:
                              - agent_id
                              - to
                            type: object
                          method:
                            enum:
                              - POST
                            type: string
                          path:
                            enum:
                              - /v1/call
                            type: string
                          tool:
                            description: >-
                              No MCP tool places a call; use the REST route in
                              method and path.
                            enum:
                              - null
                            nullable: true
                            type: string
                          warnings:
                            items:
                              additionalProperties: false
                              properties:
                                code:
                                  type: string
                                message:
                                  type: string
                              required:
                                - code
                                - message
                              type: object
                            type: array
                        required:
                          - tool
                          - method
                          - path
                          - body
                          - ask_owner_first
                        type: object
                      web_link:
                        type: string
                      web_link_serves:
                        enum:
                          - live
                        type: string
                    required:
                      - phone_numbers
                      - ring_me
                    type: object
                  warnings:
                    items:
                      additionalProperties: false
                      properties:
                        code:
                          type: string
                        message:
                          type: string
                      required:
                        - code
                        - message
                      type: object
                    type: array
                required:
                  - id
                  - agent_id
                  - name
                  - description
                  - is_live
                  - status
                  - head_commit
                  - draft_pending
                  - revision
                  - created_at
                type: object
          description: ''
        '404':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties: {}
                    type: object
                  error_code:
                    type: string
                  errors:
                    items:
                      additionalProperties: false
                      properties:
                        error_code:
                          type: string
                        field:
                          type: string
                        message:
                          type: string
                      required:
                        - field
                        - error_code
                        - message
                      type: object
                    type: array
                  hint:
                    type: string
                  message:
                    type: string
                  next_action:
                    additionalProperties: false
                    properties:
                      body:
                        additionalProperties: {}
                        type: object
                      method:
                        type: string
                      path:
                        type: string
                      tool:
                        type: string
                    required:
                      - tool
                      - method
                      - path
                    type: object
                  status:
                    maximum: 9007199254740991
                    minimum: -9007199254740991
                    type: integer
                required:
                  - status
                  - error_code
                  - message
                type: object
          description: agent_not_found, version_not_found, commit_not_found
        '409':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties: {}
                    type: object
                  error_code:
                    type: string
                  errors:
                    items:
                      additionalProperties: false
                      properties:
                        error_code:
                          type: string
                        field:
                          type: string
                        message:
                          type: string
                      required:
                        - field
                        - error_code
                        - message
                      type: object
                    type: array
                  hint:
                    type: string
                  message:
                    type: string
                  next_action:
                    additionalProperties: false
                    properties:
                      body:
                        additionalProperties: {}
                        type: object
                      method:
                        type: string
                      path:
                        type: string
                      tool:
                        type: string
                    required:
                      - tool
                      - method
                      - path
                    type: object
                  status:
                    maximum: 9007199254740991
                    minimum: -9007199254740991
                    type: integer
                required:
                  - status
                  - error_code
                  - message
                type: object
          description: draft_pending, ab_test_active, idempotency_key_in_flight
        '422':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties: {}
                    type: object
                  error_code:
                    type: string
                  errors:
                    items:
                      additionalProperties: false
                      properties:
                        error_code:
                          type: string
                        field:
                          type: string
                        message:
                          type: string
                      required:
                        - field
                        - error_code
                        - message
                      type: object
                    type: array
                  hint:
                    type: string
                  message:
                    type: string
                  next_action:
                    additionalProperties: false
                    properties:
                      body:
                        additionalProperties: {}
                        type: object
                      method:
                        type: string
                      path:
                        type: string
                      tool:
                        type: string
                    required:
                      - tool
                      - method
                      - path
                    type: object
                  status:
                    maximum: 9007199254740991
                    minimum: -9007199254740991
                    type: integer
                required:
                  - status
                  - error_code
                  - message
                type: object
          description: >-
            idempotency_key_mismatch: this Idempotency-Key was used with a
            different body
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: Enter your API key (Bearer token)
      scheme: bearer
      type: http

````

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