Discard the draft of an AI phone agent
curl --request POST \
--url http://localhost:8080/phone/{phone_agent_id}/draft/discard \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/phone/{phone_agent_id}/draft/discard"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/phone/{phone_agent_id}/draft/discard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/phone/{phone_agent_id}/draft/discard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://localhost:8080/phone/{phone_agent_id}/draft/discard"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/phone/{phone_agent_id}/draft/discard")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/phone/{phone_agent_id}/draft/discard")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"published": true,
"revision": 0,
"has_unpublished_changes": true,
"live_version": 0,
"config": {
"name": "<string>",
"type": "inbound",
"instructions": [
"<string>"
],
"first_message": "<string>",
"language": [
"<string>"
],
"accent": "<string>",
"handoff_phone_number": "<string>",
"speed": 499.995,
"interruptible": true,
"flow": null,
"data_collection_fields": [
"<string>"
],
"data_collection_webhook_url": "<string>",
"use_org_knowledgebase": true,
"voice_mode": "modular",
"voice_id": "<string>",
"tts_provider": "elevenlabs",
"tts_speed_pct": 50,
"background_noise_preset": "office",
"background_volume_pct": 100,
"typing_sound_enabled": true,
"recording_enabled": true,
"voicemail_enabled": true,
"stt_keyterms": [
"<string>"
],
"stt_model": "deepgram/flux-general",
"failover_transfer_destination_id": "<string>",
"outbound_trunk_id": "<string>",
"outbound_caller_number": "<string>",
"outbound_number_pool_id": "<string>",
"outbound_pool_max_attempts": 2,
"outbound_pool_retry_delay_minutes": 720,
"action_ids": [
"<string>"
],
"workflow_ids": [
"<string>"
],
"transfer_destination_ids": [
"<string>"
],
"instruction_ids": [
"<string>"
],
"instruction_directory_ids": [
"<string>"
],
"knowledge_item_ids": [
"<string>"
],
"knowledge_folder_keys": [
"<string>"
],
"inbound_number_ids": [
"<string>"
]
},
"field_changes": {}
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}AI Phone Agents
Discard the draft of an AI phone agent
Drop every unpublished change and reset an AI phone agent’s draft to the settings it uses on calls now.
POST
/
phone
/
{phone_agent_id}
/
draft
/
discard
Discard the draft of an AI phone agent
curl --request POST \
--url http://localhost:8080/phone/{phone_agent_id}/draft/discard \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/phone/{phone_agent_id}/draft/discard"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/phone/{phone_agent_id}/draft/discard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/phone/{phone_agent_id}/draft/discard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://localhost:8080/phone/{phone_agent_id}/draft/discard"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/phone/{phone_agent_id}/draft/discard")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/phone/{phone_agent_id}/draft/discard")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"published": true,
"revision": 0,
"has_unpublished_changes": true,
"live_version": 0,
"config": {
"name": "<string>",
"type": "inbound",
"instructions": [
"<string>"
],
"first_message": "<string>",
"language": [
"<string>"
],
"accent": "<string>",
"handoff_phone_number": "<string>",
"speed": 499.995,
"interruptible": true,
"flow": null,
"data_collection_fields": [
"<string>"
],
"data_collection_webhook_url": "<string>",
"use_org_knowledgebase": true,
"voice_mode": "modular",
"voice_id": "<string>",
"tts_provider": "elevenlabs",
"tts_speed_pct": 50,
"background_noise_preset": "office",
"background_volume_pct": 100,
"typing_sound_enabled": true,
"recording_enabled": true,
"voicemail_enabled": true,
"stt_keyterms": [
"<string>"
],
"stt_model": "deepgram/flux-general",
"failover_transfer_destination_id": "<string>",
"outbound_trunk_id": "<string>",
"outbound_caller_number": "<string>",
"outbound_number_pool_id": "<string>",
"outbound_pool_max_attempts": 2,
"outbound_pool_retry_delay_minutes": 720,
"action_ids": [
"<string>"
],
"workflow_ids": [
"<string>"
],
"transfer_destination_ids": [
"<string>"
],
"instruction_ids": [
"<string>"
],
"instruction_directory_ids": [
"<string>"
],
"knowledge_item_ids": [
"<string>"
],
"knowledge_folder_keys": [
"<string>"
],
"inbound_number_ids": [
"<string>"
]
},
"field_changes": {}
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Requires the
phone:write scope. The live settings and calls are not affected. An agent that was never published has no live settings to reset to, so the request returns 400.Authorizations
Response
Default Response
Was this page helpful?