---
title: "Switch Agent Version"
method: POST
path: "/agent/switch-agent-version"
---

# Switch Agent Version

`POST /agent/switch-agent-version`

## Request

- Base URL: `https://api.phonely.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.phonely.ai/agent/switch-agent-version`
- Auth: none declared

Migrates an agent to use stable release version and updates Twilio voice URL

Args:
    agent_id (str): The ID of the agent to migrate
    version (str): The version to migrate to (defaults to "stable")

Returns:
    dict: Response with status and message
        - On success: {"status": "success", "message": "..."}
        - On error: {"status": "error", "message": "..."}

## Headers

- `authorization` string, nullable
- `x-internal-api-key` string, nullable

## Request body

- AgentVersionRequest
  - `agentId` string, required
  - `version` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/phonely/apis/phonely-api.md) - [All operations](https://skmtc.dev/phonely/apis/phonely-api/llms.txt) - [OpenAPI document](https://skmtc.dev/phonely/apis/phonely-api/revisions/9bfd5599d479?raw)
