curl --request PATCH \
--url https://api.fish.audio/v1/agent/phone-numbers/{phone_number_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"agent_id": "<string>",
"retry_caller_id_sync": false
}
'import requests
url = "https://api.fish.audio/v1/agent/phone-numbers/{phone_number_id}"
payload = {
"label": "<string>",
"agent_id": "<string>",
"retry_caller_id_sync": False
}
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({label: '<string>', agent_id: '<string>', retry_caller_id_sync: false})
};
fetch('https://api.fish.audio/v1/agent/phone-numbers/{phone_number_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.fish.audio/v1/agent/phone-numbers/{phone_number_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([
'label' => '<string>',
'agent_id' => '<string>',
'retry_caller_id_sync' => false
]),
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.fish.audio/v1/agent/phone-numbers/{phone_number_id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"retry_caller_id_sync\": false\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.fish.audio/v1/agent/phone-numbers/{phone_number_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"retry_caller_id_sync\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fish.audio/v1/agent/phone-numbers/{phone_number_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 \"label\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"retry_caller_id_sync\": false\n}"
response = http.request(request)
puts response.read_body{
"phone_number_id": "<string>",
"workspace_id": "<string>",
"phone_number": "<string>",
"provider": "livekit",
"agent_id": "<string>",
"status": "provisioning",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"label": "",
"transfer_caller_id": "agent_number",
"cold_transfer_use_original_caller": true,
"cold_transfer_use_original_caller_effective": true,
"caller_id_sync_status": "carrier_managed",
"caller_id_sync_error": "",
"status_detail": "",
"supports_outbound": false,
"termination_uri": "<string>",
"inbound_auth_username": "<string>",
"inbound_allowed_addresses": [
"<string>"
],
"termination_transport": "<string>",
"termination_auth_username": "<string>",
"termination_headers": {}
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}Update Phone Number
Change the label and/or repoint the number at another agent — the deployment-pipeline move (rebind from the staging agent to the production one).
curl --request PATCH \
--url https://api.fish.audio/v1/agent/phone-numbers/{phone_number_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"agent_id": "<string>",
"retry_caller_id_sync": false
}
'import requests
url = "https://api.fish.audio/v1/agent/phone-numbers/{phone_number_id}"
payload = {
"label": "<string>",
"agent_id": "<string>",
"retry_caller_id_sync": False
}
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({label: '<string>', agent_id: '<string>', retry_caller_id_sync: false})
};
fetch('https://api.fish.audio/v1/agent/phone-numbers/{phone_number_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.fish.audio/v1/agent/phone-numbers/{phone_number_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([
'label' => '<string>',
'agent_id' => '<string>',
'retry_caller_id_sync' => false
]),
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.fish.audio/v1/agent/phone-numbers/{phone_number_id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"retry_caller_id_sync\": false\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.fish.audio/v1/agent/phone-numbers/{phone_number_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"retry_caller_id_sync\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fish.audio/v1/agent/phone-numbers/{phone_number_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 \"label\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"retry_caller_id_sync\": false\n}"
response = http.request(request)
puts response.read_body{
"phone_number_id": "<string>",
"workspace_id": "<string>",
"phone_number": "<string>",
"provider": "livekit",
"agent_id": "<string>",
"status": "provisioning",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"label": "",
"transfer_caller_id": "agent_number",
"cold_transfer_use_original_caller": true,
"cold_transfer_use_original_caller_effective": true,
"caller_id_sync_status": "carrier_managed",
"caller_id_sync_error": "",
"status_detail": "",
"supports_outbound": false,
"termination_uri": "<string>",
"inbound_auth_username": "<string>",
"inbound_allowed_addresses": [
"<string>"
],
"termination_transport": "<string>",
"termination_auth_username": "<string>",
"termination_headers": {}
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}{
"status": 123,
"message": "<string>",
"reason": "<string>"
}Authorizations
Body
Managed twilio numbers only: the caller ID a transfer target sees, agent_number (this number) or original_caller (the caller's own number). Applies to cold and warm transfers. It is a number setting, not agent config: no publish is needed and agent rollbacks leave it alone. Warm transfers follow it from the next call, cold transfers once caller_id_sync_status is synced. The deprecated boolean cold_transfer_use_original_caller is still accepted in its place.
agent_number, original_caller Response
Request fulfilled, document follows
Managed twilio numbers: the caller ID a transfer target sees, on cold and warm transfers alike. agent_number shows this number, original_caller shows the caller's own number (a warm transfer falls back to this number when the caller withholds theirs). null for imported sip numbers, whose carrier decides.
agent_number, original_caller synced once the carrier confirmed the policy, pending while it is being applied, error when the last attempt failed (send retry_caller_id_sync), carrier_managed for imported sip numbers.
synced, pending, error, carrier_managed Was this page helpful?

