Update voice agent
curl --request PUT \
--url https://agentcallback.com/api/scripts/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"script_type": "<string>",
"system_prompt": "<string>",
"conclusion_prompt": "<string>",
"custom_eval_prompt": "<string>",
"description": "<string>",
"custom_eval_prompt_reconsider": "<string>",
"variables": [
{
"name": "<string>",
"type": "<string>",
"required": true,
"description": "<string>",
"defaultValue": "<string>"
}
],
"possible_call_outcomes": [
"<string>"
],
"tools_config": [
{}
],
"tracked_call_state": [
{
"key": "<string>",
"defaultValue": "<string>"
}
],
"voice": "<string>",
"voice_service": "ultravox",
"llm_model": "<string>",
"call_timeout": 120,
"experimental_settings": {},
"post_call_integration": [
{}
],
"post_call_webhook": {
"enabled": true,
"url": "<string>",
"method": "POST",
"triggerGroups": [
{
"conditions": [
{
"variable": "<string>",
"value": "<string>"
}
]
}
],
"customPayload": "<string>"
}
}
'import requests
url = "https://agentcallback.com/api/scripts/{id}"
payload = {
"name": "<string>",
"script_type": "<string>",
"system_prompt": "<string>",
"conclusion_prompt": "<string>",
"custom_eval_prompt": "<string>",
"description": "<string>",
"custom_eval_prompt_reconsider": "<string>",
"variables": [
{
"name": "<string>",
"type": "<string>",
"required": True,
"description": "<string>",
"defaultValue": "<string>"
}
],
"possible_call_outcomes": ["<string>"],
"tools_config": [{}],
"tracked_call_state": [
{
"key": "<string>",
"defaultValue": "<string>"
}
],
"voice": "<string>",
"voice_service": "ultravox",
"llm_model": "<string>",
"call_timeout": 120,
"experimental_settings": {},
"post_call_integration": [{}],
"post_call_webhook": {
"enabled": True,
"url": "<string>",
"method": "POST",
"triggerGroups": [{ "conditions": [
{
"variable": "<string>",
"value": "<string>"
}
] }],
"customPayload": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
script_type: '<string>',
system_prompt: '<string>',
conclusion_prompt: '<string>',
custom_eval_prompt: '<string>',
description: '<string>',
custom_eval_prompt_reconsider: '<string>',
variables: [
{
name: '<string>',
type: '<string>',
required: true,
description: '<string>',
defaultValue: '<string>'
}
],
possible_call_outcomes: ['<string>'],
tools_config: [{}],
tracked_call_state: [{key: '<string>', defaultValue: '<string>'}],
voice: '<string>',
voice_service: 'ultravox',
llm_model: '<string>',
call_timeout: 120,
experimental_settings: {},
post_call_integration: [{}],
post_call_webhook: {
enabled: true,
url: '<string>',
method: 'POST',
triggerGroups: [{conditions: [{variable: '<string>', value: '<string>'}]}],
customPayload: '<string>'
}
})
};
fetch('https://agentcallback.com/api/scripts/{id}', 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://agentcallback.com/api/scripts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'script_type' => '<string>',
'system_prompt' => '<string>',
'conclusion_prompt' => '<string>',
'custom_eval_prompt' => '<string>',
'description' => '<string>',
'custom_eval_prompt_reconsider' => '<string>',
'variables' => [
[
'name' => '<string>',
'type' => '<string>',
'required' => true,
'description' => '<string>',
'defaultValue' => '<string>'
]
],
'possible_call_outcomes' => [
'<string>'
],
'tools_config' => [
[
]
],
'tracked_call_state' => [
[
'key' => '<string>',
'defaultValue' => '<string>'
]
],
'voice' => '<string>',
'voice_service' => 'ultravox',
'llm_model' => '<string>',
'call_timeout' => 120,
'experimental_settings' => [
],
'post_call_integration' => [
[
]
],
'post_call_webhook' => [
'enabled' => true,
'url' => '<string>',
'method' => 'POST',
'triggerGroups' => [
[
'conditions' => [
[
'variable' => '<string>',
'value' => '<string>'
]
]
]
],
'customPayload' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agentcallback.com/api/scripts/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"script_type\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"conclusion_prompt\": \"<string>\",\n \"custom_eval_prompt\": \"<string>\",\n \"description\": \"<string>\",\n \"custom_eval_prompt_reconsider\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"possible_call_outcomes\": [\n \"<string>\"\n ],\n \"tools_config\": [\n {}\n ],\n \"tracked_call_state\": [\n {\n \"key\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"voice\": \"<string>\",\n \"voice_service\": \"ultravox\",\n \"llm_model\": \"<string>\",\n \"call_timeout\": 120,\n \"experimental_settings\": {},\n \"post_call_integration\": [\n {}\n ],\n \"post_call_webhook\": {\n \"enabled\": true,\n \"url\": \"<string>\",\n \"method\": \"POST\",\n \"triggerGroups\": [\n {\n \"conditions\": [\n {\n \"variable\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"customPayload\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://agentcallback.com/api/scripts/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"script_type\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"conclusion_prompt\": \"<string>\",\n \"custom_eval_prompt\": \"<string>\",\n \"description\": \"<string>\",\n \"custom_eval_prompt_reconsider\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"possible_call_outcomes\": [\n \"<string>\"\n ],\n \"tools_config\": [\n {}\n ],\n \"tracked_call_state\": [\n {\n \"key\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"voice\": \"<string>\",\n \"voice_service\": \"ultravox\",\n \"llm_model\": \"<string>\",\n \"call_timeout\": 120,\n \"experimental_settings\": {},\n \"post_call_integration\": [\n {}\n ],\n \"post_call_webhook\": {\n \"enabled\": true,\n \"url\": \"<string>\",\n \"method\": \"POST\",\n \"triggerGroups\": [\n {\n \"conditions\": [\n {\n \"variable\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"customPayload\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agentcallback.com/api/scripts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"script_type\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"conclusion_prompt\": \"<string>\",\n \"custom_eval_prompt\": \"<string>\",\n \"description\": \"<string>\",\n \"custom_eval_prompt_reconsider\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"possible_call_outcomes\": [\n \"<string>\"\n ],\n \"tools_config\": [\n {}\n ],\n \"tracked_call_state\": [\n {\n \"key\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"voice\": \"<string>\",\n \"voice_service\": \"ultravox\",\n \"llm_model\": \"<string>\",\n \"call_timeout\": 120,\n \"experimental_settings\": {},\n \"post_call_integration\": [\n {}\n ],\n \"post_call_webhook\": {\n \"enabled\": true,\n \"url\": \"<string>\",\n \"method\": \"POST\",\n \"triggerGroups\": [\n {\n \"conditions\": [\n {\n \"variable\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"customPayload\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"script": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"script_type": "<string>",
"system_prompt": "<string>",
"variables": [
{
"name": "<string>",
"type": "<string>",
"required": true,
"description": "<string>",
"defaultValue": "<string>"
}
],
"possible_call_outcomes": [
"<string>"
],
"tracked_call_state": [
{
"key": "<string>",
"defaultValue": "<string>"
}
],
"experimental_settings": {
"background_audio": {
"volume": 0.5
}
},
"post_call_webhook": {
"enabled": true,
"url": "<string>",
"method": "POST",
"triggerGroups": [
{
"conditions": [
{
"variable": "<string>",
"value": "<string>"
}
]
}
],
"customPayload": "<string>"
},
"version_code": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}Update voice agent
PUT
/
api
/
scripts
/
{id}
Update voice agent
curl --request PUT \
--url https://agentcallback.com/api/scripts/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"script_type": "<string>",
"system_prompt": "<string>",
"conclusion_prompt": "<string>",
"custom_eval_prompt": "<string>",
"description": "<string>",
"custom_eval_prompt_reconsider": "<string>",
"variables": [
{
"name": "<string>",
"type": "<string>",
"required": true,
"description": "<string>",
"defaultValue": "<string>"
}
],
"possible_call_outcomes": [
"<string>"
],
"tools_config": [
{}
],
"tracked_call_state": [
{
"key": "<string>",
"defaultValue": "<string>"
}
],
"voice": "<string>",
"voice_service": "ultravox",
"llm_model": "<string>",
"call_timeout": 120,
"experimental_settings": {},
"post_call_integration": [
{}
],
"post_call_webhook": {
"enabled": true,
"url": "<string>",
"method": "POST",
"triggerGroups": [
{
"conditions": [
{
"variable": "<string>",
"value": "<string>"
}
]
}
],
"customPayload": "<string>"
}
}
'import requests
url = "https://agentcallback.com/api/scripts/{id}"
payload = {
"name": "<string>",
"script_type": "<string>",
"system_prompt": "<string>",
"conclusion_prompt": "<string>",
"custom_eval_prompt": "<string>",
"description": "<string>",
"custom_eval_prompt_reconsider": "<string>",
"variables": [
{
"name": "<string>",
"type": "<string>",
"required": True,
"description": "<string>",
"defaultValue": "<string>"
}
],
"possible_call_outcomes": ["<string>"],
"tools_config": [{}],
"tracked_call_state": [
{
"key": "<string>",
"defaultValue": "<string>"
}
],
"voice": "<string>",
"voice_service": "ultravox",
"llm_model": "<string>",
"call_timeout": 120,
"experimental_settings": {},
"post_call_integration": [{}],
"post_call_webhook": {
"enabled": True,
"url": "<string>",
"method": "POST",
"triggerGroups": [{ "conditions": [
{
"variable": "<string>",
"value": "<string>"
}
] }],
"customPayload": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
script_type: '<string>',
system_prompt: '<string>',
conclusion_prompt: '<string>',
custom_eval_prompt: '<string>',
description: '<string>',
custom_eval_prompt_reconsider: '<string>',
variables: [
{
name: '<string>',
type: '<string>',
required: true,
description: '<string>',
defaultValue: '<string>'
}
],
possible_call_outcomes: ['<string>'],
tools_config: [{}],
tracked_call_state: [{key: '<string>', defaultValue: '<string>'}],
voice: '<string>',
voice_service: 'ultravox',
llm_model: '<string>',
call_timeout: 120,
experimental_settings: {},
post_call_integration: [{}],
post_call_webhook: {
enabled: true,
url: '<string>',
method: 'POST',
triggerGroups: [{conditions: [{variable: '<string>', value: '<string>'}]}],
customPayload: '<string>'
}
})
};
fetch('https://agentcallback.com/api/scripts/{id}', 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://agentcallback.com/api/scripts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'script_type' => '<string>',
'system_prompt' => '<string>',
'conclusion_prompt' => '<string>',
'custom_eval_prompt' => '<string>',
'description' => '<string>',
'custom_eval_prompt_reconsider' => '<string>',
'variables' => [
[
'name' => '<string>',
'type' => '<string>',
'required' => true,
'description' => '<string>',
'defaultValue' => '<string>'
]
],
'possible_call_outcomes' => [
'<string>'
],
'tools_config' => [
[
]
],
'tracked_call_state' => [
[
'key' => '<string>',
'defaultValue' => '<string>'
]
],
'voice' => '<string>',
'voice_service' => 'ultravox',
'llm_model' => '<string>',
'call_timeout' => 120,
'experimental_settings' => [
],
'post_call_integration' => [
[
]
],
'post_call_webhook' => [
'enabled' => true,
'url' => '<string>',
'method' => 'POST',
'triggerGroups' => [
[
'conditions' => [
[
'variable' => '<string>',
'value' => '<string>'
]
]
]
],
'customPayload' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agentcallback.com/api/scripts/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"script_type\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"conclusion_prompt\": \"<string>\",\n \"custom_eval_prompt\": \"<string>\",\n \"description\": \"<string>\",\n \"custom_eval_prompt_reconsider\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"possible_call_outcomes\": [\n \"<string>\"\n ],\n \"tools_config\": [\n {}\n ],\n \"tracked_call_state\": [\n {\n \"key\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"voice\": \"<string>\",\n \"voice_service\": \"ultravox\",\n \"llm_model\": \"<string>\",\n \"call_timeout\": 120,\n \"experimental_settings\": {},\n \"post_call_integration\": [\n {}\n ],\n \"post_call_webhook\": {\n \"enabled\": true,\n \"url\": \"<string>\",\n \"method\": \"POST\",\n \"triggerGroups\": [\n {\n \"conditions\": [\n {\n \"variable\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"customPayload\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://agentcallback.com/api/scripts/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"script_type\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"conclusion_prompt\": \"<string>\",\n \"custom_eval_prompt\": \"<string>\",\n \"description\": \"<string>\",\n \"custom_eval_prompt_reconsider\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"possible_call_outcomes\": [\n \"<string>\"\n ],\n \"tools_config\": [\n {}\n ],\n \"tracked_call_state\": [\n {\n \"key\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"voice\": \"<string>\",\n \"voice_service\": \"ultravox\",\n \"llm_model\": \"<string>\",\n \"call_timeout\": 120,\n \"experimental_settings\": {},\n \"post_call_integration\": [\n {}\n ],\n \"post_call_webhook\": {\n \"enabled\": true,\n \"url\": \"<string>\",\n \"method\": \"POST\",\n \"triggerGroups\": [\n {\n \"conditions\": [\n {\n \"variable\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"customPayload\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agentcallback.com/api/scripts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"script_type\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"conclusion_prompt\": \"<string>\",\n \"custom_eval_prompt\": \"<string>\",\n \"description\": \"<string>\",\n \"custom_eval_prompt_reconsider\": \"<string>\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"required\": true,\n \"description\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"possible_call_outcomes\": [\n \"<string>\"\n ],\n \"tools_config\": [\n {}\n ],\n \"tracked_call_state\": [\n {\n \"key\": \"<string>\",\n \"defaultValue\": \"<string>\"\n }\n ],\n \"voice\": \"<string>\",\n \"voice_service\": \"ultravox\",\n \"llm_model\": \"<string>\",\n \"call_timeout\": 120,\n \"experimental_settings\": {},\n \"post_call_integration\": [\n {}\n ],\n \"post_call_webhook\": {\n \"enabled\": true,\n \"url\": \"<string>\",\n \"method\": \"POST\",\n \"triggerGroups\": [\n {\n \"conditions\": [\n {\n \"variable\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"customPayload\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"script": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"script_type": "<string>",
"system_prompt": "<string>",
"variables": [
{
"name": "<string>",
"type": "<string>",
"required": true,
"description": "<string>",
"defaultValue": "<string>"
}
],
"possible_call_outcomes": [
"<string>"
],
"tracked_call_state": [
{
"key": "<string>",
"defaultValue": "<string>"
}
],
"experimental_settings": {
"background_audio": {
"volume": 0.5
}
},
"post_call_webhook": {
"enabled": true,
"url": "<string>",
"method": "POST",
"triggerGroups": [
{
"conditions": [
{
"variable": "<string>",
"value": "<string>"
}
]
}
],
"customPayload": "<string>"
},
"version_code": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}{
"success": false,
"error": "<string>",
"details": "<string>",
"code": "<string>"
}Authorizations
Create and manage API keys in your AgentCallback account under Dashboard > API Keys.
Path Parameters
Resource identifier
Body
application/json
Updated voice agent configuration.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
ultravox Required range:
1 <= x <= 240Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I