> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# Set the active agent version

PUT https://api.synthflow.ai/v2/assistants/{model_id}/active-version
Content-Type: application/json

Makes a published version of an agent live again. Send `version_id` or `version_number`, not both. We copy that version into a new version, which goes live, and discard any unpublished draft. Versions published before September 1, 2026, did not save their actions, and neither did a V1 with no actions published before November 18, 2026. Making these live keeps the agent's current actions. We return the agent and the new version. We save the agent configuration first, so a `500` response can mean the change went live. Before you retry, [list the agent versions](/api-reference/platform-api/agents/list-agent-versions). The change went live if the active version is newer than the one active before your call and its description is exactly `Rolled back to version N (was M)`, where N is the version you chose and M the version that was active before.

Reference: https://docs.synthflow.ai/api-reference/platform-api/agents/set-active-agent-version

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.synthflow.ai/v2` (Global, default)
- `https://api.us.synthflow.ai/v2` (United States)
- `https://api.eu.synthflow.ai/v2` (European Union)

## Request

### Path parameters

- `model_id` (string, required) — Agent ID. You can find it on the agent’s page in your dashboard.

### Body (application/json)

This endpoint expects a set-active-agent-version_Request.

- `set-active-agent-version_Request`
  - By version ID: By version ID
  - By version number: By version number

## Response

### 200

200

- `status` (string, optional) — Whether the request was successful.
- `response` (AssistantsModelIdActiveVersionPutResponsesContentApplicationJsonSchemaResponse, optional)

## Errors

### 400 Bad Request Error

The body does not hold exactly one valid `version_id` or `version_number`, the version is already active, or several versions share that number.

- `detail` (AssistantsModelIdActiveVersionPutResponsesContentApplicationJsonSchemaDetail, optional)

### 403 Forbidden Error

The agent belongs to another workspace.

- `detail` (AssistantsModelIdActiveVersionPutResponsesContentApplicationJsonSchemaDetail, optional)

### 404 Not Found Error

The agent or the version does not exist.

- `detail` (AssistantsModelIdActiveVersionPutResponsesContentApplicationJsonSchemaDetail, optional)

## Types

### By version ID

- `version_id` (string, required) — The ID of the version, from [List agent versions](/api-reference/platform-api/agents/list-agent-versions).

### By version number

- `version_number` (integer, required) — The number of the version, from [List agent versions](/api-reference/platform-api/agents/list-agent-versions).

### AssistantsModelIdActiveVersionPutResponsesContentApplicationJsonSchemaResponse

- `assistant` (AgentDetails, optional) — The agent with the new version live, as [Get an agent](/api-reference/platform-api/agents/get-assistant) returns it without `include_actions`.
- `version` (AssistantsModelIdActiveVersionPutResponsesContentApplicationJsonSchemaResponseVersion, optional) — The new active version.

### AssistantsModelIdActiveVersionPutResponsesContentApplicationJsonSchemaDetail

- `status` (string, required)
- `description` (string, required)
- `request_id` (string, required)
- `category` (string, required)

### AgentDetails

- `description` (string, optional) — Agent description.
- `phone_number` (string, optional) — The phone number attached to the agent.
- `external_webhook_url` (string, optional) — URL of the webhook that should receive data after the call, such as the transcript.
- `is_recording` (boolean, optional) — Whether the conversation should be recorded.
- `max_duration` (AgentDetailsMaxDuration, optional)
- `voicemail_message` (AgentDetailsVoicemailMessage, optional) — Configuration for the message left when a voicemail is detected. Requires `greeting_message_mode` to be set to `human`.
- `type` (enum, optional) — Agent type.
  - Allowed values: `outbound`, `inbound`, `widget`
- `name` (string, optional) — Agent name.
- `agent` (Agent, optional)
- `model_id` (string, optional) — The ID of the agent.
- `knowledge_base_id` (string, optional, nullable) — ID of the knowledge base attached to the agent, or null.
- `attached_phone_numbers` (list of AttachedPhoneNumber, optional) — Attached phone numbers available for outbound calls from this agent.
- `actions` (list of string, optional) — Action IDs attached to this assistant. Returns an empty array when `include_actions=false`.
- `input_variables` (list of AgentDetailsInputVariablesItems, optional) — Action input variables grouped by action ID. Returns an empty array when `include_actions=false`.
- `end_call_reasons` (list of string, optional, deprecated) — Optional. Some GET responses include `end_call_reasons` at the top level of each assistant object (in addition to `agent.end_call_reasons`). To configure end-call reasons, set **`agent.end_call_reasons`** on create or update requests; a top-level `end_call_reasons` on those requests is ignored.

### AssistantsModelIdActiveVersionPutResponsesContentApplicationJsonSchemaResponseVersion

The new active version.

- `version_id` (string, optional) — The ID of the new version.
- `version_number` (integer, optional) — Sequential version number of the new version.
- `created_at` (datetime, optional) — When the new version was published.
- `created_by` (string, optional) — `api_key:` followed by the name of the API key that made the call, or `system` when the key's name is not found.
- `is_active` (boolean, optional) — Always `true`.
- `description` (string, optional) — Names the version you chose and the version that was active before, as in `Rolled back to version 2 (was 3)`.

### AgentDetailsMaxDuration

- `duration_seconds` (integer, optional) — Maximum length of the call in seconds.
- `is_enabled` (boolean, optional) — Whether there's a limit on call length.

### AgentDetailsVoicemailMessage

Configuration for the message left when a voicemail is detected. Requires `greeting_message_mode` to be set to `human`.

- `enabled` (boolean, optional) — Whether voicemail message leaving is enabled.
- `mode` (enum, optional) — The mode used to generate the voicemail message.
  - Allowed values: `exact_message`, `prompt`
- `exact_message` (string, optional) — The exact message to leave on the voicemail. Used when mode is `exact_message`.
- `prompt` (string, optional) — A prompt used to generate the voicemail message. Used when mode is `prompt`.

### Agent

- `timezone` (enum, optional, default: Europe/Berlin) — The agent's timezone.
  - Allowed values: `Africa/Accra`, `Africa/Addis_Ababa`, `Africa/Algiers`, `Africa/Asmara`, `Africa/Bamako`, `Africa/Bangui`, `Africa/Banjul`, `Africa/Bissau`, `Africa/Blantyre`, `Africa/Brazzaville`, `Africa/Bujumbura`, `Africa/Cairo`, `Africa/Casablanca`, `Africa/Ceuta`, `Africa/Conakry`, `Africa/Dakar`, `Africa/Dar_es_Salaam`, `Africa/Djibouti`, `Africa/Douala`, `Africa/El_Aaiun`, `Africa/Freetown`, `Africa/Gaborone`, `Africa/Harare`, `Africa/Johannesburg`, `Africa/Juba`, `Africa/Kampala`, `Africa/Khartoum`, `Africa/Kigali`, `Africa/Kinshasa`, `Africa/Lagos`, `Africa/Libreville`, `Africa/Lome`, `Africa/Luanda`, `Africa/Lubumbashi`, `Africa/Lusaka`, `Africa/Malabo`, `Africa/Maputo`, `Africa/Maseru`, `Africa/Mbabane`, `Africa/Mogadishu`, `Africa/Monrovia`, `Africa/Nairobi`, `Africa/Ndjamena`, `Africa/Niamey`, `Africa/Nouakchott`, `Africa/Ouagadougou`, `Africa/Porto-Novo`, `Africa/Sao_Tome`, `Africa/Tripoli`, `Africa/Tunis`, `Africa/Windhoek`, `America/Adak`, `America/Anchorage`, `America/Anguilla`, `America/Antigua`, `America/Araguaina`, `America/Argentina/Buenos_Aires`, `America/Argentina/Catamarca`, `America/Argentina/Cordoba`, `America/Argentina/Jujuy`, `America/Argentina/La_Rioja`, `America/Argentina/Mendoza`, `America/Argentina/Rio_Gallegos`, `America/Argentina/Salta`, `America/Argentina/San_Juan`, `America/Argentina/San_Luis`, `America/Argentina/Tucuman`, `America/Argentina/Ushuaia`, `America/Aruba`, `America/Asuncion`, `America/Atikokan`, `America/Bahia`, `America/Bahia_Banderas`, `America/Barbados`, `America/Belem`, `America/Belize`, `America/Blanc-Sablon`, `America/Boa_Vista`, `America/Bogota`, `America/Boise`, `America/Cambridge_Bay`, `America/Campo_Grande`, `America/Cancun`, `America/Caracas`, `America/Cayenne`, `America/Cayman`, `America/Chicago`, `America/Chihuahua`, `America/Ciudad_Juarez`, `America/Costa_Rica`, `America/Creston`, `America/Cuiaba`, `America/Curacao`, `America/Danmarkshavn`, `America/Dawson`, `America/Dawson_Creek`, `America/Denver`, `America/Detroit`, `America/Dominica`, `America/Edmonton`, `America/Eirunepe`, `America/El_Salvador`, `America/Fort_Nelson`, `America/Fortaleza`, `America/Glace_Bay`, `America/Goose_Bay`, `America/Grand_Turk`, `America/Grenada`, `America/Guadeloupe`, `America/Guatemala`, `America/Guayaquil`, `America/Guyana`, `America/Halifax`, `America/Havana`, `America/Hermosillo`, `America/Indiana/Indianapolis`, `America/Indiana/Knox`, `America/Indiana/Marengo`, `America/Indiana/Petersburg`, `America/Indiana/Tell_City`, `America/Indiana/Vevay`, `America/Indiana/Vincennes`, `America/Indiana/Winamac`, `America/Inuvik`, `America/Iqaluit`, `America/Jamaica`, `America/Juneau`, `America/Kentucky/Louisville`, `America/Kentucky/Monticello`, `America/Kralendijk`, `America/La_Paz`, `America/Lima`, `America/Los_Angeles`, `America/Lower_Princes`, `America/Maceio`, `America/Managua`, `America/Manaus`, `America/Marigot`, `America/Martinique`, `America/Matamoros`, `America/Mazatlan`, `America/Menominee`, `America/Merida`, `America/Metlakatla`, `America/Mexico_City`, `America/Miquelon`, `America/Moncton`, `America/Monterrey`, `America/Montevideo`, `America/Montserrat`, `America/Nassau`, `America/New_York`, `America/Nome`, `America/Noronha`, `America/North_Dakota/Beulah`, `America/North_Dakota/Center`, `America/North_Dakota/New_Salem`, `America/Nuuk`, `America/Ojinaga`, `America/Panama`, `America/Paramaribo`, `America/Phoenix`, `America/Port_of_Spain`, `America/Port-au-Prince`, `America/Porto_Velho`, `America/Puerto_Rico`, `America/Punta_Arenas`, `America/Rankin_Inlet`, `America/Recife`, `America/Regina`, `America/Resolute`, `America/Rio_Branco`, `America/Santarem`, `America/Santiago`, `America/Santo_Domingo`, `America/Sao_Paulo`, `America/Scoresbysund`, `America/Sitka`, `America/St_Barthelemy`, `America/St_Johns`, `America/St_Kitts`, `America/St_Lucia`, `America/St_Thomas`, `America/St_Vincent`, `America/Swift_Current`, `America/Tegucigalpa`, `America/Thule`, `America/Tijuana`, `America/Toronto`, `America/Tortola`, `America/Vancouver`, `America/Whitehorse`, `America/Winnipeg`, `America/Yakutat`, `Antarctica/Casey`, `Antarctica/Davis`, `Antarctica/DumontDUrville`, `Antarctica/Macquarie`, `Antarctica/Mawson`, `Antarctica/McMurdo`, `Antarctica/Palmer`, `Antarctica/Rothera`, `Antarctica/Syowa`, `Antarctica/Troll`, `Antarctica/Vostok`, `Arctic/Longyearbyen`, `Asia/Aden`, `Asia/Almaty`, `Asia/Amman`, `Asia/Anadyr`, `Asia/Aqtau`, `Asia/Aqtobe`, `Asia/Ashgabat`, `Asia/Atyrau`, `Asia/Baghdad`, `Asia/Bahrain`, `Asia/Baku`, `Asia/Bangkok`, `Asia/Barnaul`, `Asia/Beirut`, `Asia/Bishkek`, `Asia/Brunei`, `Asia/Chita`, `Asia/Choibalsan`, `Asia/Colombo`, `Asia/Damascus`, `Asia/Dhaka`, `Asia/Dili`, `Asia/Dubai`, `Asia/Dushanbe`, `Asia/Famagusta`, `Asia/Gaza`, `Asia/Hebron`, `Asia/Ho_Chi_Minh`, `Asia/Hong_Kong`, `Asia/Hovd`, `Asia/Irkutsk`, `Asia/Jakarta`, `Asia/Jayapura`, `Asia/Jerusalem`, `Asia/Kabul`, `Asia/Kamchatka`, `Asia/Karachi`, `Asia/Kathmandu`, `Asia/Khandyga`, `Asia/Kolkata`, `Asia/Krasnoyarsk`, `Asia/Kuala_Lumpur`, `Asia/Kuching`, `Asia/Kuwait`, `Asia/Macau`, `Asia/Magadan`, `Asia/Makassar`, `Asia/Manila`, `Asia/Muscat`, `Asia/Nicosia`, `Asia/Novokuznetsk`, `Asia/Novosibirsk`, `Asia/Omsk`, `Asia/Oral`, `Asia/Phnom_Penh`, `Asia/Pontianak`, `Asia/Pyongyang`, `Asia/Qatar`, `Asia/Qostanay`, `Asia/Qyzylorda`, `Asia/Riyadh`, `Asia/Sakhalin`, `Asia/Samarkand`, `Asia/Seoul`, `Asia/Shanghai`, `Asia/Singapore`, `Asia/Srednekolymsk`, `Asia/Taipei`, `Asia/Tashkent`, `Asia/Tbilisi`, `Asia/Tehran`, `Asia/Thimphu`, `Asia/Tokyo`, `Asia/Tomsk`, `Asia/Ulaanbaatar`, `Asia/Urumqi`, `Asia/Ust-Nera`, `Asia/Vientiane`, `Asia/Vladivostok`, `Asia/Yakutsk`, `Asia/Yangon`, `Asia/Yekaterinburg`, `Asia/Yerevan`, `Atlantic/Azores`, `Atlantic/Bermuda`, `Atlantic/Canary`, `Atlantic/Cape_Verde`, `Atlantic/Faroe`, `Atlantic/Madeira`, `Atlantic/Reykjavik`, `Atlantic/South_Georgia`, `Atlantic/St_Helena`, `Atlantic/Stanley`, `Australia/Adelaide`, `Australia/Brisbane`, `Australia/Broken_Hill`, `Australia/Darwin`, `Australia/Eucla`, `Australia/Hobart`, `Australia/Lindeman`, `Australia/Lord_Howe`, `Australia/Melbourne`, `Australia/Perth`, `Australia/Sydney`, `Europe/Amsterdam`, `Europe/Andorra`, `Europe/Astrakhan`, `Europe/Athens`, `Europe/Belgrade`, `Europe/Berlin`, `Europe/Bratislava`, `Europe/Brussels`, `Europe/Bucharest`, `Europe/Budapest`, `Europe/Busingen`, `Europe/Chisinau`, `Europe/Copenhagen`, `Europe/Dublin`, `Europe/Gibraltar`, `Europe/Guernsey`, `Europe/Helsinki`, `Europe/Isle_of_Man`, `Europe/Istanbul`, `Europe/Jersey`, `Europe/Kaliningrad`, `Europe/Kirov`, `Europe/Kyiv`, `Europe/Lisbon`, `Europe/Ljubljana`, `Europe/London`, `Europe/Luxembourg`, `Europe/Madrid`, `Europe/Malta`, `Europe/Mariehamn`, `Europe/Minsk`, `Europe/Monaco`, `Europe/Moscow`, `Europe/Oslo`, `Europe/Paris`, `Europe/Podgorica`, `Europe/Prague`, `Europe/Riga`, `Europe/Rome`, `Europe/Samara`, `Europe/San_Marino`, `Europe/Sarajevo`, `Europe/Saratov`, `Europe/Simferopol`, `Europe/Skopje`, `Europe/Sofia`, `Europe/Stockholm`, `Europe/Tallinn`, `Europe/Tirane`, `Europe/Ulyanovsk`, `Europe/Vaduz`, `Europe/Vatican`, `Europe/Vienna`, `Europe/Vilnius`, `Europe/Volgograd`, `Europe/Warsaw`, `Europe/Zagreb`, `Europe/Zurich`, `Indian/Antananarivo`, `Indian/Chagos`, `Indian/Christmas`, `Indian/Cocos`, `Indian/Comoro`, `Indian/Kerguelen`, `Indian/Mahe`, `Indian/Maldives`, `Indian/Mauritius`, `Indian/Mayotte`, `Indian/Reunion`, `Pacific/Apia`, `Pacific/Auckland`, `Pacific/Bougainville`, `Pacific/Chatham`, `Pacific/Chuuk`, `Pacific/Easter`, `Pacific/Efate`, `Pacific/Fakaofo`, `Pacific/Fiji`, `Pacific/Funafuti`, `Pacific/Galapagos`, `Pacific/Gambier`, `Pacific/Guadalcanal`, `Pacific/Guam`, `Pacific/Honolulu`, `Pacific/Kanton`, `Pacific/Kiritimati`, `Pacific/Kosrae`, `Pacific/Kwajalein`, `Pacific/Majuro`, `Pacific/Marquesas`, `Pacific/Midway`, `Pacific/Nauru`, `Pacific/Niue`, `Pacific/Norfolk`, `Pacific/Noumea`, `Pacific/Pago_Pago`, `Pacific/Palau`, `Pacific/Pitcairn`, `Pacific/Pohnpei`, `Pacific/Port_Moresby`, `Pacific/Rarotonga`, `Pacific/Saipan`, `Pacific/Tahiti`, `Pacific/Tarawa`, `Pacific/Tongatapu`, `Pacific/Wake`, `Pacific/Wallis`, `US/Alaska`, `US/Central`, `US/Eastern`, `US/Hawaii`, `US/Mountain`, `US/Pacific`
- `working_hours` (CallTimeWindow, optional, nullable) — Business hours in the agent's `timezone`. Outside them, inbound calls follow `out_hours_action` and outbound calls are not placed. `null` removes the limit. On update, sending it replaces the stored schedule, and leaving it out keeps it.
- `out_hours_action` (string, optional, nullable) — ID of the action that handles inbound calls outside `working_hours`. It must be a call transfer or a custom action in the agent's workspace, and it does not need to be attached to the agent. `null` declines the call. An unknown ID or another type of action returns a `400` error.
- `voice_prompt` (string, optional) — Slightly alters the agent's intonation, talking speed or sentiment for a subtle yet noticeable effect.
- `voice_stability` (double, optional) — Range is 0 to 1. Lower settings may make the voice sound more expressive but less predictable, while higher settings make it sound steadier but less emotional.
- `voice_similarity_boost` (double, optional) — Range 0 to 1. Determines how closely the AI matches the original voice. Higher settings potentially including unwanted noise from the original recording.
- `voice_optimise_streaming_latency` (integer, optional) — Range 0 to 4. Optimises streaming latency
- `voice_style` (double, optional) — Range 0 to 1. Enhances the distinct characteristics of the original voice, but may slow down processing and make the voice less stable.
- `voice_use_speaker_boost` (boolean, optional) — Amplifies the voice’s likeness to the original speaker, which can slightly slow down the response time.
- `allowed_idle_time_seconds` (integer, optional) — The agent will disconnect after this period.
- `initial_pause_seconds` (integer, optional) — Duration before the agent starts speaking.
- `transcriber_keywords` (list of string, optional) — Add business terms to improve accuracy and recognition.
- `ring_pause_seconds` (integer, optional) — Ring time before the agent answers the call.
- `transcriber_provider` (enum, optional) — Speech-to-text provider used for transcription.
  - Allowed values: `deepgram`, `deepgram-nova-3`, `synthflow-stt`
- `transcriber_speech_recognition` (enum, optional) — Speech recognition mode for transcription speed vs quality.
  - Allowed values: `faster`, `high_accuracy`
- `background_noise` (AgentBackgroundNoise, optional) — Add background noise to make the call more natural.
- `noise_cancellation` (enum, optional) — Removes background noise on the caller's side. `advanced` (Voice Isolation) filters more aggressively than `standard`. Defaults to `advanced`.
  - Allowed values: `standard`, `advanced`
- `realistic_filler_words` (boolean, optional) — If enabled, the agent will be using realistic filler words (for example, "um").
- `dtmf` (AgentDtmf, optional, nullable) — Capture keypad (DTMF) input during the call. Off by default. Completed sequences are stored in `DTMF_INPUT` and can run an action from a matching key or digit length. On update, send the full object; omitted keys reset to their defaults.
- `is_transcript_disabled` (boolean, optional) — If set to true, conversations will not be transcribed.
- `redact_pii` (boolean, optional) — Whether to redact personally identifiable information (PII) from transcripts, post-call webhooks, and internal logs. Redacted data includes credit card numbers, CVVs, expiration dates, social security numbers, names, email addresses, phone numbers, and physical addresses.
- `synthesizer_filter_words` (list of string, optional) — Words or characters that the agent should not say.
- `end_call_reasons_v2` (list of AgentEndCallReasonsV2Items, optional) — Custom conditions that trigger automatic call termination with per-reason closing message control. When both end_call_reasons and end_call_reasons_v2 are present, v2 takes precedence.
- `voice_synthesizer` (enum, optional) — The engine used to synthesize voice.
  - Allowed values: `eleven_multilingual_v2`, `eleven_turbo_v2`, `eleven_turbo_v2_5`, `eleven_flash_v2`, `eleven_flash_v2_5`, `eleven_v3`, `eleven_v4`, `eleven_v4_turbo`
- `global_audio_tags` (string, optional) — Free-form audio tags that apply to every utterance for the duration of a call. Tags are wrapped in square brackets and set a persistent voice character such as an accent or base mood. Only supported when voice_synthesizer is eleven_v3, eleven_v4, or eleven_v4_turbo.
- `suppression_level` (double, optional) — Strength of Voice Isolation, from 0 to 1. Only takes effect when `noise_cancellation` is `advanced`. Defaults to `1` on create. See [how values map to Strength in the app](/call-configuration#strength).
- `interruption_fade_out` (integer, optional) — Each frame is 20 ms. When you interrupt the bot, the volume slowly goes down to 0 over that many frames. For example, 5 translates to a 100 ms fadeout.
- `voice_speed` (double, optional) — Adjust how fast or slow your agent will talk on the call.
- `voice_volume` (double, optional) — Adjust how loud or quite your agent will talk on the call.
- `min_words_to_interrupt` (enum, optional) — You can set how many words the human must speak before the AI will stop speaking and listening.
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`
- `prompt` (string, optional) — Add variables in curly brackets. For example, \{your-variable}.
- `greeting_message` (string, optional) — The greeting message the agent will open the conversation with. You can add variables in curly brackets (for example, \{your-variable}).
- `greeting_message_mode` (enum, optional) — Controls how the agent delivers the initial greeting. `human`: the agent waits for the human to speak first. `agent_static`: the agent speaks `greeting_message` once the call is established. `agent_dynamic`: the agent generates a greeting from the prompt and speaks it once the call is established. Note: `voicemail_message` requires this to be set to `human`. Changing away from `human` while `voicemail_message` is enabled will fail.
  - Allowed values: `human`, `agent_static`, `agent_dynamic`
- `greeting_message_human_talk_timeout` (integer, optional) — The maximum number of seconds the agent waits for the human to speak first when `greeting_message_mode` is set to `human`. If the human does not speak within this time, the agent will start the conversation automatically.
- `llm` (enum, optional) — The LLM powering this agent.
  - Allowed values: `gpt-4.1`, `gpt-4.1-nano`, `gpt-4.1-mini`, `gpt-5-mini`, `gpt-5-nano`, `gpt-5.1`, `gpt-5.2`, `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-6-luna`, `synthflow`, `synthflow-premium`
- `language` (enum, optional) — This agent's language. For the list of available languages, see Supported languages
  - Allowed values: `multi`, `en-US`, `bg`, `cs`, `de-DE`, `el`, `fi`, `fr-FR`, `es-ES`, `hu`, `it`, `fr`, `pt-BR`, `nl-NL`, `hi`, `zh-CN`, `no`, `sv-SE`, `da`, `da-DK`, `id`, `ja`, `ko`, `ms`, `ro`, `ru`, `sk`, `tr`, `uk`, `vi`, `th`, `pl`
- `voice_id` (string, optional) — Voice ID for this agent. To retrieve voice IDs, use the Get voices endpoint.
- `patience_level` (enum, optional) — Patience level of the agent.
  - Allowed values: `low`, `medium`, `high`
- `send_user_idle_reminders` (boolean, optional, default: false) — Enables or disables idle reminders.
- `reminder_after_idle_time_seconds` (integer, optional) — Time in seconds before sending an idle reminder.
- `reminder_after_idle_message` (string, optional) — The idle reminder message.
- `fallback_voice_id` (string, optional) — Voice ID for this agent. To retrieve voice IDs, use the Get voices endpoint.
- `fallback_provider` (enum, optional) — The provider for the fallback voice (elevenlabs, deepgram, or synthflow).
  - Allowed values: `elevenlabs`, `deepgram`, `synthflow`
- `fallback_model` (string, optional) — The model to be used by the fallback provider.
- `end_call_reasons` (list of string, optional, deprecated) — Deprecated: use end_call_reasons_v2 instead. Custom conditions that trigger automatic call termination (simple string array format). Works with both simple prompt and Flow Designer agents.

### AttachedPhoneNumber

- `number` (string, required) — Phone number attached to the agent.
- `sid` (string, required, nullable) — Twilio phone number SID.
- `slug` (string, required) — Internal phone number slug.

### AgentDetailsInputVariablesItems

- `action_id` (string, required) — Action ID the variables belong to.
- `values` (list of AgentDetailsInputVariablesItemsValuesItems, required) — Input variable definitions for this action.
- `trigger_condition` (string, optional, nullable) — Per-assistant 'When to use this Action' condition for this action, or null when not set.
- `attachment_type` (enum, optional) — When this action is available in the conversation.
  - Allowed values: `before`, `during`, `after`
- `input_variables_mapping` (list of AgentDetailsInputVariablesItemsInputVariablesMappingItems, optional) — Source of each input variable for this agent. `source_key` is not returned.

### CallTimeWindow

Calling window evaluated in the agent's timezone. Recipients that come up while the window is shut wait for it to open. This does not replace the agent's working hours, which are checked separately when the call is placed, so a window that falls outside them fails every call. When neither is configured, recipients are dialed at any time.

- `enable` (boolean, optional) — Whether the window is enforced. Defaults to true when `weekly_hours` is provided.
- `weekly_hours` (map from string to list of CallTimeWindowWeeklyHoursItems, optional) — Keys are lowercase weekday names (`monday` to `sunday`). Each day holds a list of windows in `HH:MM` 24-hour format with `start` earlier than `end`. A missing or empty day means no calls on that day.

### AgentBackgroundNoise

Add background noise to make the call more natural.

- `enabled` (boolean, optional) — If enabled, the agent will add background noise.
- `type` (enum, optional) — What kind of background noise should be present.
  - Allowed values: `cafe`, `office`
- `volume` (integer, optional) — How loud the background noise should be.

### AgentDtmf

Capture keypad (DTMF) input during the call. Off by default. Completed sequences are stored in `DTMF_INPUT` and can run an action from a matching key or digit length. On update, send the full object; omitted keys reset to their defaults.

- `enabled` (boolean, optional, default: false) — Turns keypad capture on. Defaults to false.
- `idle_timeout_seconds` (double, optional, default: 2) — Seconds of silence after the last digit before the sequence is complete. Must be greater than 0. Default 2, maximum 30.
- `terminator` (string, optional, default: #) — Digit that ends capture. Default `#`. Must not also be an action key.
- `actions` (list of AgentDtmfActionsItems, optional) — Actions to run when the captured digits match. Set `digits` or `length`, not both. `id` is an existing action ID.

### AgentEndCallReasonsV2Items

- `reason` (string, required) — The condition that triggers call termination.
- `closing_message_mode` (enum, optional) — Controls how the farewell message is generated. static: message is spoken verbatim. prompt: message is an instruction to the LLM. none: LLM generates its own farewell.
  - Allowed values: `static`, `prompt`, `none`
- `closing_message` (string, optional) — The closing message content. Interpretation depends on closing_message_mode.

### AgentDetailsInputVariablesItemsValuesItems

- `name` (string, required)
- `type` (string, required)
- `description` (string, optional, nullable)
- `example` (string, optional, nullable)
- `required` (boolean, optional, nullable)

### AgentDetailsInputVariablesItemsInputVariablesMappingItems

- `variable_name` (string, optional)
- `source` (enum, optional)
  - Allowed values: `hardcoded`, `llm`, `system_vars`, `prompt_variables`, `fsm_variables`, `action_results`
- `hardcoded_value` (string, optional, nullable)
- `llm_config` (AgentDetailsInputVariablesItemsInputVariablesMappingItemsLlmConfig, optional, nullable)

### CallTimeWindowWeeklyHoursItems

- `start` (string, optional)
- `end` (string, optional)

### AgentDtmfActionsItems

- `id` (string, required) — Action ID to run.
- `digits` (string, optional) — Exact keypad sequence that runs the action.
- `length` (integer, optional) — Run the action when this many digits have been entered.

### AgentDetailsInputVariablesItemsInputVariablesMappingItemsLlmConfig

- `description` (string, optional, nullable) — Description of the variable.
- `example` (string, optional, nullable) — Example of the variable.
- `required` (boolean, optional, nullable) — Whether the variable is required.

## Examples

**Request**

```json
{
  "version_number": 2
}
```

**Response**

```json
{
  "status": "ok",
  "response": {
    "assistant": {
      "type": "inbound",
      "name": "Retention Test Agent",
      "model_id": "12acc0ac-df2a-47af-afe3-e1aa4380a307",
      "actions": [],
      "input_variables": []
    },
    "version": {
      "version_id": "7c1f2a90-3b6d-4e8a-9f12-5d0c4b8e6a31",
      "version_number": 4,
      "created_at": "2024-01-15T09:30:00Z",
      "created_by": "api_key:production",
      "is_active": true,
      "description": "Rolled back to version 2 (was 3)"
    }
  }
}
```

**SDK Code**

```python set-active-agent-version_example
import requests

url = "https://api.synthflow.ai/v2/assistants/model_id/active-version"

payload = { "version_number": 2 }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```go set-active-agent-version_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.synthflow.ai/v2/assistants/model_id/active-version"

	payload := strings.NewReader("{\n  \"version_number\": 2\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby set-active-agent-version_example
require 'uri'
require 'net/http'

url = URI("https://api.synthflow.ai/v2/assistants/model_id/active-version")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"version_number\": 2\n}"

response = http.request(request)
puts response.read_body
```

```java set-active-agent-version_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.synthflow.ai/v2/assistants/model_id/active-version")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"version_number\": 2\n}")
  .asString();
```

```csharp set-active-agent-version_example
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/assistants/model_id/active-version");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"version_number\": 2\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift set-active-agent-version_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["version_number": 2] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/assistants/model_id/active-version")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```