Activate Agent Version
curl --request POST \
--url https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate \
--header 'x-api-key: <api-key>'import requests
url = "https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agent": {
"id": "f790923795a23467555c0ad6",
"config": {
"agent_name": "<string>",
"agent_description": "<string>",
"engine": {
"kind": "<string>",
"stt": "<string>",
"llm": "<string>",
"tts": "<string>",
"voice_id": "<string>",
"language": "<string>"
},
"engine_pipeline": {},
"engine_realtime": {},
"prompt": "<string>",
"agent_role": "<string>",
"agent_goal": "<string>",
"agent_instructions": "<string>",
"dynamic_variables": {},
"dynamic_variable_defaults": {},
"conversation_start": {
"who": "<string>",
"greeting": "<string>"
},
"turn_detection": "<string>",
"noise_cancellation": {},
"api_key": "<string>",
"knowledge_base": {},
"managed_agents": {},
"tools": [
"<string>"
],
"lyzr_tools": [
{}
],
"agent_id": "<string>",
"user_id": "<string>",
"session_id": "<string>",
"preemptive_generation": true,
"pronunciation_correction": true,
"pronunciation_rules": {},
"audio_recording_enabled": true,
"vad_enabled": true,
"avatar": {},
"background_audio": {},
"corrections": [
{}
]
},
"createdAt": "2023-10-25T12:00:00Z",
"updatedAt": "2023-10-26T12:30:00Z",
"shared": true
}
}{
"error": "Agent or version not found.",
"details": "<string>"
}API Reference
Activate Agent Version
Set a specific historical version of an agent as the active configuration.
POST
/
agents
/
{agentId}
/
versions
/
{versionId}
/
activate
Activate Agent Version
curl --request POST \
--url https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate \
--header 'x-api-key: <api-key>'import requests
url = "https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://voice-livekit.studio.lyzr.ai/v1/agents/{agentId}/versions/{versionId}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agent": {
"id": "f790923795a23467555c0ad6",
"config": {
"agent_name": "<string>",
"agent_description": "<string>",
"engine": {
"kind": "<string>",
"stt": "<string>",
"llm": "<string>",
"tts": "<string>",
"voice_id": "<string>",
"language": "<string>"
},
"engine_pipeline": {},
"engine_realtime": {},
"prompt": "<string>",
"agent_role": "<string>",
"agent_goal": "<string>",
"agent_instructions": "<string>",
"dynamic_variables": {},
"dynamic_variable_defaults": {},
"conversation_start": {
"who": "<string>",
"greeting": "<string>"
},
"turn_detection": "<string>",
"noise_cancellation": {},
"api_key": "<string>",
"knowledge_base": {},
"managed_agents": {},
"tools": [
"<string>"
],
"lyzr_tools": [
{}
],
"agent_id": "<string>",
"user_id": "<string>",
"session_id": "<string>",
"preemptive_generation": true,
"pronunciation_correction": true,
"pronunciation_rules": {},
"audio_recording_enabled": true,
"vad_enabled": true,
"avatar": {},
"background_audio": {},
"corrections": [
{}
]
},
"createdAt": "2023-10-25T12:00:00Z",
"updatedAt": "2023-10-26T12:30:00Z",
"shared": true
}
}{
"error": "Agent or version not found.",
"details": "<string>"
}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.
Authentication Required: You must include your API key in the
x-api-key header to authenticate this request.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 endpoint).
What Happens on Activation?
When you successfully activate a version (returning a200 OK status), the following occurs:
- The agent’s live configuration is immediately replaced with the payload from the specified
versionId. - Any new LiveKit sessions initiated for this
agentIdwill use this newly activated configuration. - The API returns the complete, updated
agentobject so you can verify the settings have been applied in your application.
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.
Authorizations
Path Parameters
The unique identifier of the agent.
Example:
"f790923795a23467555c0ad6"
The UUID of the specific version to activate.
Example:
"3052daF7-8cbB-61dE-8820-dAb2019F43fd"
Response
Agent version successfully activated.
Show child attributes
Show child attributes