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>",
"cold_transfer_use_original_caller": true,
"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>",
"cold_transfer_use_original_caller": True,
"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>',
cold_transfer_use_original_caller: true,
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>',
'cold_transfer_use_original_caller' => true,
'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 \"cold_transfer_use_original_caller\": true,\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 \"cold_transfer_use_original_caller\": true,\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 \"cold_transfer_use_original_caller\": true,\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": "",
"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>"
}{
"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>",
"cold_transfer_use_original_caller": true,
"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>",
"cold_transfer_use_original_caller": True,
"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>',
cold_transfer_use_original_caller: true,
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>',
'cold_transfer_use_original_caller' => true,
'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 \"cold_transfer_use_original_caller\": true,\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 \"cold_transfer_use_original_caller\": true,\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 \"cold_transfer_use_original_caller\": true,\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": "",
"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>"
}{
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
120Agent that answers this number's inbound calls. Explicit null unbinds; omit the field to keep the current binding.
Managed twilio numbers only: show the original caller's number on cold transfers (true) or this number (false). Takes effect for new calls once caller_id_sync_status is synced.
Re-apply the current caller ID policy after a failed synchronization.
Response
Request fulfilled, document follows
E.164, e.g. +14155550123.
livekit, twilio, sip Inbound calls route to this agent; unbound numbers ring busy.
provisioning, active, error, released Managed twilio numbers: whether a cold-transfer target sees the original caller's number (true) or this number (false). null for imported sip numbers, whose carrier owns the setting.
The policy the carrier has confirmed; null while unknown or for imported sip numbers.
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 Why the last synchronization failed; empty otherwise.
What failed when status is error; empty otherwise.
Whether the number can place calls (outbound and warm-transfer consult legs): managed twilio always, imported sip only when a termination was configured.
Imported sip numbers: the customer trunk's termination host.
Imported sip numbers: the inbound digest username. Passwords are never echoed.
Imported sip numbers: allowed source IPs/CIDRs.
Imported sip numbers: termination transport.
Imported sip numbers: the termination digest username. Passwords are never echoed.
Was this page helpful?

