curl --request PATCH \
--url https://api.retellai.com/v2/update-live-call/{call_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields_to_override": {
"override_dynamic_variables": {
"additional_discount": "15%"
}
},
"call_control": {
"additional_context": "Customer just opened a support ticket about billing.",
"trigger_response": true
}
}
'import requests
url = "https://api.retellai.com/v2/update-live-call/{call_id}"
payload = {
"fields_to_override": { "override_dynamic_variables": { "additional_discount": "15%" } },
"call_control": {
"additional_context": "Customer just opened a support ticket about billing.",
"trigger_response": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields_to_override: {override_dynamic_variables: {additional_discount: '15%'}},
call_control: {
additional_context: 'Customer just opened a support ticket about billing.',
trigger_response: true
}
})
};
fetch('https://api.retellai.com/v2/update-live-call/{call_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.retellai.com/v2/update-live-call/{call_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([
'fields_to_override' => [
'override_dynamic_variables' => [
'additional_discount' => '15%'
]
],
'call_control' => [
'additional_context' => 'Customer just opened a support ticket about billing.',
'trigger_response' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.retellai.com/v2/update-live-call/{call_id}"
payload := strings.NewReader("{\n \"fields_to_override\": {\n \"override_dynamic_variables\": {\n \"additional_discount\": \"15%\"\n }\n },\n \"call_control\": {\n \"additional_context\": \"Customer just opened a support ticket about billing.\",\n \"trigger_response\": true\n }\n}")
req, _ := http.NewRequest("PATCH", 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(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.retellai.com/v2/update-live-call/{call_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields_to_override\": {\n \"override_dynamic_variables\": {\n \"additional_discount\": \"15%\"\n }\n },\n \"call_control\": {\n \"additional_context\": \"Customer just opened a support ticket about billing.\",\n \"trigger_response\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/v2/update-live-call/{call_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields_to_override\": {\n \"override_dynamic_variables\": {\n \"additional_discount\": \"15%\"\n }\n },\n \"call_control\": {\n \"additional_context\": \"Customer just opened a support ticket about billing.\",\n \"trigger_response\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "The requested resource was not found."
}{
"status": "error",
"message": "Cannot find requested asset under given api key."
}{
"status": "error",
"message": "An unexpected server error occurred."
}Update Live Call
Update an ongoing call at runtime. Supports overriding dynamic variables, metadata, and the data storage setting on the running call, and controlling the live agent (inject context, trigger a response). These overrides take effect immediately on the live call; metadata and data storage setting changes are also persisted to the call record. To update a call that is no longer ongoing, use /v2/update-call/.
curl --request PATCH \
--url https://api.retellai.com/v2/update-live-call/{call_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields_to_override": {
"override_dynamic_variables": {
"additional_discount": "15%"
}
},
"call_control": {
"additional_context": "Customer just opened a support ticket about billing.",
"trigger_response": true
}
}
'import requests
url = "https://api.retellai.com/v2/update-live-call/{call_id}"
payload = {
"fields_to_override": { "override_dynamic_variables": { "additional_discount": "15%" } },
"call_control": {
"additional_context": "Customer just opened a support ticket about billing.",
"trigger_response": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields_to_override: {override_dynamic_variables: {additional_discount: '15%'}},
call_control: {
additional_context: 'Customer just opened a support ticket about billing.',
trigger_response: true
}
})
};
fetch('https://api.retellai.com/v2/update-live-call/{call_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.retellai.com/v2/update-live-call/{call_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([
'fields_to_override' => [
'override_dynamic_variables' => [
'additional_discount' => '15%'
]
],
'call_control' => [
'additional_context' => 'Customer just opened a support ticket about billing.',
'trigger_response' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.retellai.com/v2/update-live-call/{call_id}"
payload := strings.NewReader("{\n \"fields_to_override\": {\n \"override_dynamic_variables\": {\n \"additional_discount\": \"15%\"\n }\n },\n \"call_control\": {\n \"additional_context\": \"Customer just opened a support ticket about billing.\",\n \"trigger_response\": true\n }\n}")
req, _ := http.NewRequest("PATCH", 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(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.retellai.com/v2/update-live-call/{call_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields_to_override\": {\n \"override_dynamic_variables\": {\n \"additional_discount\": \"15%\"\n }\n },\n \"call_control\": {\n \"additional_context\": \"Customer just opened a support ticket about billing.\",\n \"trigger_response\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/v2/update-live-call/{call_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields_to_override\": {\n \"override_dynamic_variables\": {\n \"additional_discount\": \"15%\"\n }\n },\n \"call_control\": {\n \"additional_context\": \"Customer just opened a support ticket about billing.\",\n \"trigger_response\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "The requested resource was not found."
}{
"status": "error",
"message": "Cannot find requested asset under given api key."
}{
"status": "error",
"message": "An unexpected server error occurred."
}Authorizations
Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"
Path Parameters
The call id of the ongoing call to be updated.
"call_a4441234567890777c4a4a123e6"
Body
Call fields to override on the running call. Each field is applied to the live call immediately; omitted fields are left unchanged.
Show child attributes
Show child attributes
Live agent control. At least one of additional_context or trigger_response should be supplied; an empty object is a no-op.
Show child attributes
Show child attributes
Response
Live call updated successfully
true
Was this page helpful?

