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

# Activate Agent Version

> Set a specific historical version of an agent as the active configuration.

Restore or activate a specific historical configuration of your Voice Agent.

When you make changes to an agent, a new version is created. If an update causes unexpected behavior, or if you simply want to revert to a previously stable setup, you can use this endpoint to promote an older `versionId` to become the currently active configuration.

<Info>
  **Authentication Required:** You must include your API key in the `x-api-key` header to authenticate this request.
</Info>

### Required Parameters

You need two pieces of information in the URL path to make this request:

* **`agentId`:** The 24-character string ID of the parent agent.
* **`versionId`:** The exact UUID of the version you wish to activate (you can retrieve this using the [List Agent Versions](/api-reference/agents/list-agent-versions) endpoint).

### What Happens on Activation?

When you successfully activate a version (returning a `200 OK` status), the following occurs:

1. The agent's live configuration is immediately replaced with the payload from the specified `versionId`.
2. Any **new** LiveKit sessions initiated for this `agentId` will use this newly activated configuration.
3. The API returns the complete, updated `agent` object so you can verify the settings have been applied in your application.

<Note>
  **Note on active sessions:** Activating a new version will not disrupt or alter any ongoing voice calls. The changes will only apply to the next session created after this request succeeds.
</Note>


## OpenAPI

````yaml post /agents/{agentId}/versions/{versionId}/activate
openapi: 3.0.3
info:
  title: Lyzr Voice LiveKit API
  version: 1.0.0
servers:
  - url: https://voice-livekit.studio.lyzr.ai/v1
security: []
paths:
  /agents/{agentId}/versions/{versionId}/activate:
    post:
      summary: Activate Agent Version
      description: >-
        Set a specific historical version of an agent as the active
        configuration.
      parameters:
        - name: agentId
          in: path
          required: true
          description: The unique identifier of the agent.
          schema:
            type: string
            example: f790923795a23467555c0ad6
        - name: versionId
          in: path
          required: true
          description: The UUID of the specific version to activate.
          schema:
            type: string
            format: uuid
            example: 3052daF7-8cbB-61dE-8820-dAb2019F43fd
      responses:
        '200':
          description: Agent version successfully activated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  agent:
                    type: object
                    properties:
                      id:
                        type: string
                        example: f790923795a23467555c0ad6
                      config:
                        $ref: '#/components/schemas/AgentConfig'
                      createdAt:
                        type: string
                        example: '2023-10-25T12:00:00Z'
                      updatedAt:
                        type: string
                        example: '2023-10-26T12:30:00Z'
                      shared:
                        type: boolean
                        example: true
        '404':
          description: Agent or version not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Agent or version not found.
                  details:
                    type: string
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AgentConfig:
      type: object
      description: Comprehensive configuration settings for the agent.
      properties:
        agent_name:
          type: string
        agent_description:
          type: string
        engine:
          type: object
          properties:
            kind:
              type: string
            stt:
              type: string
            llm:
              type: string
            tts:
              type: string
            voice_id:
              type: string
            language:
              type: string
        engine_pipeline:
          type: object
        engine_realtime:
          type: object
        prompt:
          type: string
        agent_role:
          type: string
        agent_goal:
          type: string
        agent_instructions:
          type: string
        dynamic_variables:
          type: object
          additionalProperties:
            type: string
        dynamic_variable_defaults:
          type: object
          additionalProperties:
            type: string
        conversation_start:
          type: object
          properties:
            who:
              type: string
            greeting:
              type: string
        turn_detection:
          type: string
        noise_cancellation:
          type: object
        api_key:
          type: string
        knowledge_base:
          type: object
        managed_agents:
          type: object
        tools:
          type: array
          items:
            type: string
        lyzr_tools:
          type: array
          items:
            type: object
        agent_id:
          type: string
        user_id:
          type: string
        session_id:
          type: string
        preemptive_generation:
          type: boolean
        pronunciation_correction:
          type: boolean
        pronunciation_rules:
          type: object
        audio_recording_enabled:
          type: boolean
        vad_enabled:
          type: boolean
        avatar:
          type: object
        background_audio:
          type: object
        corrections:
          type: array
          items:
            type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````