Update Scheduled Call Batch
Updates a scheduled call batch
curl --request PATCH \
--url https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"windowStart": "2023-11-07T05:31:56Z",
"windowEnd": "2023-11-07T05:31:56Z",
"throttle": "<string>",
"webhookUrl": "<string>",
"webhookSecret": "<string>",
"paused": true,
"calls": [
{
"medium": {
"webRtc": {
"dataMessages": {
"pong": true,
"state": true,
"transcript": true,
"clientToolInvocation": true,
"dataConnectionToolInvocation": true,
"playbackClearBuffer": true,
"callStarted": true,
"debug": true,
"callEvent": true,
"toolUsed": true,
"userStartedSpeaking": true,
"userStoppedSpeaking": true,
"invokingTool": true
}
},
"twilio": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": true,
"userTextMessage": {
"text": "<string>"
}
}
},
"serverWebSocket": {
"inputSampleRate": 123,
"outputSampleRate": 123,
"clientBufferSizeMs": 123,
"dataMessages": {
"pong": true,
"state": true,
"transcript": true,
"clientToolInvocation": true,
"dataConnectionToolInvocation": true,
"playbackClearBuffer": true,
"callStarted": true,
"debug": true,
"callEvent": true,
"toolUsed": true,
"userStartedSpeaking": true,
"userStoppedSpeaking": true,
"invokingTool": true
},
"mediaIdleTimeout": "<string>"
},
"telnyx": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": true,
"userTextMessage": {
"text": "<string>"
}
}
},
"plivo": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": true,
"userTextMessage": {
"text": "<string>"
}
}
},
"exotel": {
"dtmfHandling": {
"ignore": true,
"userTextMessage": {
"text": "<string>"
}
}
},
"sip": {
"incoming": {},
"outgoing": {
"to": "<string>",
"from": "<string>",
"username": "<string>",
"password": "<string>"
}
}
},
"metadata": "<unknown>",
"templateContext": "<unknown>",
"experimentalSettings": null
}
]
}
'import requests
url = "https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}"
payload = {
"windowStart": "2023-11-07T05:31:56Z",
"windowEnd": "2023-11-07T05:31:56Z",
"throttle": "<string>",
"webhookUrl": "<string>",
"webhookSecret": "<string>",
"paused": True,
"calls": [
{
"medium": {
"webRtc": { "dataMessages": {
"pong": True,
"state": True,
"transcript": True,
"clientToolInvocation": True,
"dataConnectionToolInvocation": True,
"playbackClearBuffer": True,
"callStarted": True,
"debug": True,
"callEvent": True,
"toolUsed": True,
"userStartedSpeaking": True,
"userStoppedSpeaking": True,
"invokingTool": True
} },
"twilio": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": True,
"userTextMessage": { "text": "<string>" }
}
},
"serverWebSocket": {
"inputSampleRate": 123,
"outputSampleRate": 123,
"clientBufferSizeMs": 123,
"dataMessages": {
"pong": True,
"state": True,
"transcript": True,
"clientToolInvocation": True,
"dataConnectionToolInvocation": True,
"playbackClearBuffer": True,
"callStarted": True,
"debug": True,
"callEvent": True,
"toolUsed": True,
"userStartedSpeaking": True,
"userStoppedSpeaking": True,
"invokingTool": True
},
"mediaIdleTimeout": "<string>"
},
"telnyx": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": True,
"userTextMessage": { "text": "<string>" }
}
},
"plivo": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": True,
"userTextMessage": { "text": "<string>" }
}
},
"exotel": { "dtmfHandling": {
"ignore": True,
"userTextMessage": { "text": "<string>" }
} },
"sip": {
"incoming": {},
"outgoing": {
"to": "<string>",
"from": "<string>",
"username": "<string>",
"password": "<string>"
}
}
},
"metadata": "<unknown>",
"templateContext": "<unknown>",
"experimentalSettings": None
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
windowStart: '2023-11-07T05:31:56Z',
windowEnd: '2023-11-07T05:31:56Z',
throttle: '<string>',
webhookUrl: '<string>',
webhookSecret: '<string>',
paused: true,
calls: [
{
medium: {
webRtc: {
dataMessages: {
pong: true,
state: true,
transcript: true,
clientToolInvocation: true,
dataConnectionToolInvocation: true,
playbackClearBuffer: true,
callStarted: true,
debug: true,
callEvent: true,
toolUsed: true,
userStartedSpeaking: true,
userStoppedSpeaking: true,
invokingTool: true
}
},
twilio: {
outgoing: {to: '<string>', from: '<string>', additionalParams: {}},
dtmfHandling: {ignore: true, userTextMessage: {text: '<string>'}}
},
serverWebSocket: {
inputSampleRate: 123,
outputSampleRate: 123,
clientBufferSizeMs: 123,
dataMessages: {
pong: true,
state: true,
transcript: true,
clientToolInvocation: true,
dataConnectionToolInvocation: true,
playbackClearBuffer: true,
callStarted: true,
debug: true,
callEvent: true,
toolUsed: true,
userStartedSpeaking: true,
userStoppedSpeaking: true,
invokingTool: true
},
mediaIdleTimeout: '<string>'
},
telnyx: {
outgoing: {to: '<string>', from: '<string>', additionalParams: {}},
dtmfHandling: {ignore: true, userTextMessage: {text: '<string>'}}
},
plivo: {
outgoing: {to: '<string>', from: '<string>', additionalParams: {}},
dtmfHandling: {ignore: true, userTextMessage: {text: '<string>'}}
},
exotel: {dtmfHandling: {ignore: true, userTextMessage: {text: '<string>'}}},
sip: {
incoming: {},
outgoing: {to: '<string>', from: '<string>', username: '<string>', password: '<string>'}
}
},
metadata: '<unknown>',
templateContext: '<unknown>',
experimentalSettings: null
}
]
})
};
fetch('https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_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://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'windowStart' => '2023-11-07T05:31:56Z',
'windowEnd' => '2023-11-07T05:31:56Z',
'throttle' => '<string>',
'webhookUrl' => '<string>',
'webhookSecret' => '<string>',
'paused' => true,
'calls' => [
[
'medium' => [
'webRtc' => [
'dataMessages' => [
'pong' => true,
'state' => true,
'transcript' => true,
'clientToolInvocation' => true,
'dataConnectionToolInvocation' => true,
'playbackClearBuffer' => true,
'callStarted' => true,
'debug' => true,
'callEvent' => true,
'toolUsed' => true,
'userStartedSpeaking' => true,
'userStoppedSpeaking' => true,
'invokingTool' => true
]
],
'twilio' => [
'outgoing' => [
'to' => '<string>',
'from' => '<string>',
'additionalParams' => [
]
],
'dtmfHandling' => [
'ignore' => true,
'userTextMessage' => [
'text' => '<string>'
]
]
],
'serverWebSocket' => [
'inputSampleRate' => 123,
'outputSampleRate' => 123,
'clientBufferSizeMs' => 123,
'dataMessages' => [
'pong' => true,
'state' => true,
'transcript' => true,
'clientToolInvocation' => true,
'dataConnectionToolInvocation' => true,
'playbackClearBuffer' => true,
'callStarted' => true,
'debug' => true,
'callEvent' => true,
'toolUsed' => true,
'userStartedSpeaking' => true,
'userStoppedSpeaking' => true,
'invokingTool' => true
],
'mediaIdleTimeout' => '<string>'
],
'telnyx' => [
'outgoing' => [
'to' => '<string>',
'from' => '<string>',
'additionalParams' => [
]
],
'dtmfHandling' => [
'ignore' => true,
'userTextMessage' => [
'text' => '<string>'
]
]
],
'plivo' => [
'outgoing' => [
'to' => '<string>',
'from' => '<string>',
'additionalParams' => [
]
],
'dtmfHandling' => [
'ignore' => true,
'userTextMessage' => [
'text' => '<string>'
]
]
],
'exotel' => [
'dtmfHandling' => [
'ignore' => true,
'userTextMessage' => [
'text' => '<string>'
]
]
],
'sip' => [
'incoming' => [
],
'outgoing' => [
'to' => '<string>',
'from' => '<string>',
'username' => '<string>',
'password' => '<string>'
]
]
],
'metadata' => '<unknown>',
'templateContext' => '<unknown>',
'experimentalSettings' => null
]
]
]),
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://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}"
payload := strings.NewReader("{\n \"windowStart\": \"2023-11-07T05:31:56Z\",\n \"windowEnd\": \"2023-11-07T05:31:56Z\",\n \"throttle\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"webhookSecret\": \"<string>\",\n \"paused\": true,\n \"calls\": [\n {\n \"medium\": {\n \"webRtc\": {\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n }\n },\n \"twilio\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"serverWebSocket\": {\n \"inputSampleRate\": 123,\n \"outputSampleRate\": 123,\n \"clientBufferSizeMs\": 123,\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n },\n \"mediaIdleTimeout\": \"<string>\"\n },\n \"telnyx\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"plivo\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"exotel\": {\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"sip\": {\n \"incoming\": {},\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n }\n },\n \"metadata\": \"<unknown>\",\n \"templateContext\": \"<unknown>\",\n \"experimentalSettings\": null\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"windowStart\": \"2023-11-07T05:31:56Z\",\n \"windowEnd\": \"2023-11-07T05:31:56Z\",\n \"throttle\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"webhookSecret\": \"<string>\",\n \"paused\": true,\n \"calls\": [\n {\n \"medium\": {\n \"webRtc\": {\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n }\n },\n \"twilio\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"serverWebSocket\": {\n \"inputSampleRate\": 123,\n \"outputSampleRate\": 123,\n \"clientBufferSizeMs\": 123,\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n },\n \"mediaIdleTimeout\": \"<string>\"\n },\n \"telnyx\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"plivo\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"exotel\": {\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"sip\": {\n \"incoming\": {},\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n }\n },\n \"metadata\": \"<unknown>\",\n \"templateContext\": \"<unknown>\",\n \"experimentalSettings\": null\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"windowStart\": \"2023-11-07T05:31:56Z\",\n \"windowEnd\": \"2023-11-07T05:31:56Z\",\n \"throttle\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"webhookSecret\": \"<string>\",\n \"paused\": true,\n \"calls\": [\n {\n \"medium\": {\n \"webRtc\": {\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n }\n },\n \"twilio\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"serverWebSocket\": {\n \"inputSampleRate\": 123,\n \"outputSampleRate\": 123,\n \"clientBufferSizeMs\": 123,\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n },\n \"mediaIdleTimeout\": \"<string>\"\n },\n \"telnyx\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"plivo\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"exotel\": {\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"sip\": {\n \"incoming\": {},\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n }\n },\n \"metadata\": \"<unknown>\",\n \"templateContext\": \"<unknown>\",\n \"experimentalSettings\": null\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"totalCount": 123,
"completedCount": 123,
"endedAt": "2023-11-07T05:31:56Z",
"windowStart": "2023-11-07T05:31:56Z",
"windowEnd": "2023-11-07T05:31:56Z",
"throttle": "<string>",
"webhookUrl": "<string>",
"webhookSecret": "<string>",
"paused": true
}Authorizations
API key
Body
The start of the time window during which calls can be made.
The end of the time window during which calls can be made.
The name or ID of a call throttle. If specified, calls in this batch will be subject to the rate limits defined by the throttle.
The URL to which a request will be made (synchronously) when a call in the batch is created, excluding those with an outgoing medium. Required if any call has a non-outgoing medium and not allowed otherwise.
200The signing secret for requests made to the webhookUrl. This is used to verify that the request came from Ultravox. If unset, an appropriate secret will be chosen for you (but you'll still need to make your endpoint aware of it to verify requests).
1201Show child attributes
Show child attributes
Response
The total number of calls in this batch.
The number of calls in this batch that have been completed (created or error).
The start of the time window during which calls can be made.
The end of the time window during which calls can be made.
The name or ID of a call throttle. If specified, calls in this batch will be subject to the rate limits defined by the throttle.
The URL to which a request will be made (synchronously) when a call in the batch is created, excluding those with an outgoing medium. Required if any call has a non-outgoing medium and not allowed otherwise.
200The signing secret for requests made to the webhookUrl. This is used to verify that the request came from Ultravox. If unset, an appropriate secret will be chosen for you (but you'll still need to make your endpoint aware of it to verify requests).
120curl --request PATCH \
--url https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"windowStart": "2023-11-07T05:31:56Z",
"windowEnd": "2023-11-07T05:31:56Z",
"throttle": "<string>",
"webhookUrl": "<string>",
"webhookSecret": "<string>",
"paused": true,
"calls": [
{
"medium": {
"webRtc": {
"dataMessages": {
"pong": true,
"state": true,
"transcript": true,
"clientToolInvocation": true,
"dataConnectionToolInvocation": true,
"playbackClearBuffer": true,
"callStarted": true,
"debug": true,
"callEvent": true,
"toolUsed": true,
"userStartedSpeaking": true,
"userStoppedSpeaking": true,
"invokingTool": true
}
},
"twilio": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": true,
"userTextMessage": {
"text": "<string>"
}
}
},
"serverWebSocket": {
"inputSampleRate": 123,
"outputSampleRate": 123,
"clientBufferSizeMs": 123,
"dataMessages": {
"pong": true,
"state": true,
"transcript": true,
"clientToolInvocation": true,
"dataConnectionToolInvocation": true,
"playbackClearBuffer": true,
"callStarted": true,
"debug": true,
"callEvent": true,
"toolUsed": true,
"userStartedSpeaking": true,
"userStoppedSpeaking": true,
"invokingTool": true
},
"mediaIdleTimeout": "<string>"
},
"telnyx": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": true,
"userTextMessage": {
"text": "<string>"
}
}
},
"plivo": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": true,
"userTextMessage": {
"text": "<string>"
}
}
},
"exotel": {
"dtmfHandling": {
"ignore": true,
"userTextMessage": {
"text": "<string>"
}
}
},
"sip": {
"incoming": {},
"outgoing": {
"to": "<string>",
"from": "<string>",
"username": "<string>",
"password": "<string>"
}
}
},
"metadata": "<unknown>",
"templateContext": "<unknown>",
"experimentalSettings": null
}
]
}
'import requests
url = "https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}"
payload = {
"windowStart": "2023-11-07T05:31:56Z",
"windowEnd": "2023-11-07T05:31:56Z",
"throttle": "<string>",
"webhookUrl": "<string>",
"webhookSecret": "<string>",
"paused": True,
"calls": [
{
"medium": {
"webRtc": { "dataMessages": {
"pong": True,
"state": True,
"transcript": True,
"clientToolInvocation": True,
"dataConnectionToolInvocation": True,
"playbackClearBuffer": True,
"callStarted": True,
"debug": True,
"callEvent": True,
"toolUsed": True,
"userStartedSpeaking": True,
"userStoppedSpeaking": True,
"invokingTool": True
} },
"twilio": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": True,
"userTextMessage": { "text": "<string>" }
}
},
"serverWebSocket": {
"inputSampleRate": 123,
"outputSampleRate": 123,
"clientBufferSizeMs": 123,
"dataMessages": {
"pong": True,
"state": True,
"transcript": True,
"clientToolInvocation": True,
"dataConnectionToolInvocation": True,
"playbackClearBuffer": True,
"callStarted": True,
"debug": True,
"callEvent": True,
"toolUsed": True,
"userStartedSpeaking": True,
"userStoppedSpeaking": True,
"invokingTool": True
},
"mediaIdleTimeout": "<string>"
},
"telnyx": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": True,
"userTextMessage": { "text": "<string>" }
}
},
"plivo": {
"outgoing": {
"to": "<string>",
"from": "<string>",
"additionalParams": {}
},
"dtmfHandling": {
"ignore": True,
"userTextMessage": { "text": "<string>" }
}
},
"exotel": { "dtmfHandling": {
"ignore": True,
"userTextMessage": { "text": "<string>" }
} },
"sip": {
"incoming": {},
"outgoing": {
"to": "<string>",
"from": "<string>",
"username": "<string>",
"password": "<string>"
}
}
},
"metadata": "<unknown>",
"templateContext": "<unknown>",
"experimentalSettings": None
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
windowStart: '2023-11-07T05:31:56Z',
windowEnd: '2023-11-07T05:31:56Z',
throttle: '<string>',
webhookUrl: '<string>',
webhookSecret: '<string>',
paused: true,
calls: [
{
medium: {
webRtc: {
dataMessages: {
pong: true,
state: true,
transcript: true,
clientToolInvocation: true,
dataConnectionToolInvocation: true,
playbackClearBuffer: true,
callStarted: true,
debug: true,
callEvent: true,
toolUsed: true,
userStartedSpeaking: true,
userStoppedSpeaking: true,
invokingTool: true
}
},
twilio: {
outgoing: {to: '<string>', from: '<string>', additionalParams: {}},
dtmfHandling: {ignore: true, userTextMessage: {text: '<string>'}}
},
serverWebSocket: {
inputSampleRate: 123,
outputSampleRate: 123,
clientBufferSizeMs: 123,
dataMessages: {
pong: true,
state: true,
transcript: true,
clientToolInvocation: true,
dataConnectionToolInvocation: true,
playbackClearBuffer: true,
callStarted: true,
debug: true,
callEvent: true,
toolUsed: true,
userStartedSpeaking: true,
userStoppedSpeaking: true,
invokingTool: true
},
mediaIdleTimeout: '<string>'
},
telnyx: {
outgoing: {to: '<string>', from: '<string>', additionalParams: {}},
dtmfHandling: {ignore: true, userTextMessage: {text: '<string>'}}
},
plivo: {
outgoing: {to: '<string>', from: '<string>', additionalParams: {}},
dtmfHandling: {ignore: true, userTextMessage: {text: '<string>'}}
},
exotel: {dtmfHandling: {ignore: true, userTextMessage: {text: '<string>'}}},
sip: {
incoming: {},
outgoing: {to: '<string>', from: '<string>', username: '<string>', password: '<string>'}
}
},
metadata: '<unknown>',
templateContext: '<unknown>',
experimentalSettings: null
}
]
})
};
fetch('https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_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://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'windowStart' => '2023-11-07T05:31:56Z',
'windowEnd' => '2023-11-07T05:31:56Z',
'throttle' => '<string>',
'webhookUrl' => '<string>',
'webhookSecret' => '<string>',
'paused' => true,
'calls' => [
[
'medium' => [
'webRtc' => [
'dataMessages' => [
'pong' => true,
'state' => true,
'transcript' => true,
'clientToolInvocation' => true,
'dataConnectionToolInvocation' => true,
'playbackClearBuffer' => true,
'callStarted' => true,
'debug' => true,
'callEvent' => true,
'toolUsed' => true,
'userStartedSpeaking' => true,
'userStoppedSpeaking' => true,
'invokingTool' => true
]
],
'twilio' => [
'outgoing' => [
'to' => '<string>',
'from' => '<string>',
'additionalParams' => [
]
],
'dtmfHandling' => [
'ignore' => true,
'userTextMessage' => [
'text' => '<string>'
]
]
],
'serverWebSocket' => [
'inputSampleRate' => 123,
'outputSampleRate' => 123,
'clientBufferSizeMs' => 123,
'dataMessages' => [
'pong' => true,
'state' => true,
'transcript' => true,
'clientToolInvocation' => true,
'dataConnectionToolInvocation' => true,
'playbackClearBuffer' => true,
'callStarted' => true,
'debug' => true,
'callEvent' => true,
'toolUsed' => true,
'userStartedSpeaking' => true,
'userStoppedSpeaking' => true,
'invokingTool' => true
],
'mediaIdleTimeout' => '<string>'
],
'telnyx' => [
'outgoing' => [
'to' => '<string>',
'from' => '<string>',
'additionalParams' => [
]
],
'dtmfHandling' => [
'ignore' => true,
'userTextMessage' => [
'text' => '<string>'
]
]
],
'plivo' => [
'outgoing' => [
'to' => '<string>',
'from' => '<string>',
'additionalParams' => [
]
],
'dtmfHandling' => [
'ignore' => true,
'userTextMessage' => [
'text' => '<string>'
]
]
],
'exotel' => [
'dtmfHandling' => [
'ignore' => true,
'userTextMessage' => [
'text' => '<string>'
]
]
],
'sip' => [
'incoming' => [
],
'outgoing' => [
'to' => '<string>',
'from' => '<string>',
'username' => '<string>',
'password' => '<string>'
]
]
],
'metadata' => '<unknown>',
'templateContext' => '<unknown>',
'experimentalSettings' => null
]
]
]),
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://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}"
payload := strings.NewReader("{\n \"windowStart\": \"2023-11-07T05:31:56Z\",\n \"windowEnd\": \"2023-11-07T05:31:56Z\",\n \"throttle\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"webhookSecret\": \"<string>\",\n \"paused\": true,\n \"calls\": [\n {\n \"medium\": {\n \"webRtc\": {\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n }\n },\n \"twilio\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"serverWebSocket\": {\n \"inputSampleRate\": 123,\n \"outputSampleRate\": 123,\n \"clientBufferSizeMs\": 123,\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n },\n \"mediaIdleTimeout\": \"<string>\"\n },\n \"telnyx\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"plivo\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"exotel\": {\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"sip\": {\n \"incoming\": {},\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n }\n },\n \"metadata\": \"<unknown>\",\n \"templateContext\": \"<unknown>\",\n \"experimentalSettings\": null\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"windowStart\": \"2023-11-07T05:31:56Z\",\n \"windowEnd\": \"2023-11-07T05:31:56Z\",\n \"throttle\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"webhookSecret\": \"<string>\",\n \"paused\": true,\n \"calls\": [\n {\n \"medium\": {\n \"webRtc\": {\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n }\n },\n \"twilio\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"serverWebSocket\": {\n \"inputSampleRate\": 123,\n \"outputSampleRate\": 123,\n \"clientBufferSizeMs\": 123,\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n },\n \"mediaIdleTimeout\": \"<string>\"\n },\n \"telnyx\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"plivo\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"exotel\": {\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"sip\": {\n \"incoming\": {},\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n }\n },\n \"metadata\": \"<unknown>\",\n \"templateContext\": \"<unknown>\",\n \"experimentalSettings\": null\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ultravox.ai/api/agents/{agent_id}/scheduled_batches/{batch_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"windowStart\": \"2023-11-07T05:31:56Z\",\n \"windowEnd\": \"2023-11-07T05:31:56Z\",\n \"throttle\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"webhookSecret\": \"<string>\",\n \"paused\": true,\n \"calls\": [\n {\n \"medium\": {\n \"webRtc\": {\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n }\n },\n \"twilio\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"serverWebSocket\": {\n \"inputSampleRate\": 123,\n \"outputSampleRate\": 123,\n \"clientBufferSizeMs\": 123,\n \"dataMessages\": {\n \"pong\": true,\n \"state\": true,\n \"transcript\": true,\n \"clientToolInvocation\": true,\n \"dataConnectionToolInvocation\": true,\n \"playbackClearBuffer\": true,\n \"callStarted\": true,\n \"debug\": true,\n \"callEvent\": true,\n \"toolUsed\": true,\n \"userStartedSpeaking\": true,\n \"userStoppedSpeaking\": true,\n \"invokingTool\": true\n },\n \"mediaIdleTimeout\": \"<string>\"\n },\n \"telnyx\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"plivo\": {\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"additionalParams\": {}\n },\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"exotel\": {\n \"dtmfHandling\": {\n \"ignore\": true,\n \"userTextMessage\": {\n \"text\": \"<string>\"\n }\n }\n },\n \"sip\": {\n \"incoming\": {},\n \"outgoing\": {\n \"to\": \"<string>\",\n \"from\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n }\n }\n },\n \"metadata\": \"<unknown>\",\n \"templateContext\": \"<unknown>\",\n \"experimentalSettings\": null\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"totalCount": 123,
"completedCount": 123,
"endedAt": "2023-11-07T05:31:56Z",
"windowStart": "2023-11-07T05:31:56Z",
"windowEnd": "2023-11-07T05:31:56Z",
"throttle": "<string>",
"webhookUrl": "<string>",
"webhookSecret": "<string>",
"paused": true
}