Skip to main content
PATCH
/
agents
/
{agent_id}
/
phone-numbers
/
{phone_number}
Update Phone Number
curl --request PATCH \
  --url https://api.example.com/agents/{agent_id}/phone-numbers/{phone_number} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "enable_outbound": true,
  "status": "<string>",
  "provider_config": {},
  "metadata": {}
}
'
import requests

url = "https://api.example.com/agents/{agent_id}/phone-numbers/{phone_number}"

payload = {
    "enable_outbound": True,
    "status": "<string>",
    "provider_config": {},
    "metadata": {}
}
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({enable_outbound: true, status: '<string>', provider_config: {}, metadata: {}})
};

fetch('https://api.example.com/agents/{agent_id}/phone-numbers/{phone_number}', 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.example.com/agents/{agent_id}/phone-numbers/{phone_number}",
  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([
    'enable_outbound' => true,
    'status' => '<string>',
    'provider_config' => [
        
    ],
    'metadata' => [
        
    ]
  ]),
  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.example.com/agents/{agent_id}/phone-numbers/{phone_number}"

	payload := strings.NewReader("{\n  \"enable_outbound\": true,\n  \"status\": \"<string>\",\n  \"provider_config\": {},\n  \"metadata\": {}\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.example.com/agents/{agent_id}/phone-numbers/{phone_number}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"enable_outbound\": true,\n  \"status\": \"<string>\",\n  \"provider_config\": {},\n  \"metadata\": {}\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/agents/{agent_id}/phone-numbers/{phone_number}")

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  \"enable_outbound\": true,\n  \"status\": \"<string>\",\n  \"provider_config\": {},\n  \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "agent_id": "<string>",
  "phone_number": "<string>",
  "provider": "<string>",
  "sip_uri": "<string>",
  "dispatch_rule_id": "<string>",
  "outbound_enabled": true,
  "status": "<string>",
  "created_at": "<string>",
  "instructions": {},
  "outbound_trunk_id": "<string>",
  "outbound_address": "<string>",
  "provider_config": {},
  "room_pattern": "<string>",
  "livekit_sip_domain": "<string>",
  "inbound_addresses": [
    "<string>"
  ],
  "supported_providers": [
    {}
  ]
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agent_id
string<uuid>
required
phone_number
string
required

Body

application/json

Schema for updating phone number configuration.

enable_outbound
boolean | null
status
string | null
Pattern: ^(active|inactive|suspended)$
provider_config
Provider Config · object | null
metadata
Metadata · object | null

Response

Successful Response

Response for phone number registration.

agent_id
string
required
phone_number
string
required
provider
string
required
sip_uri
string
required
dispatch_rule_id
string
required
outbound_enabled
boolean
required
status
string
required
created_at
string
required
instructions
Instructions · object
required
outbound_trunk_id
string | null

LiveKit outbound trunk ID if outbound is enabled

outbound_address
string | null

SIP address used for outbound calls (e.g., sip.telnyx.com)

provider_config
Provider Config · object | null
room_pattern
string | null

LiveKit room naming pattern for this agent's calls

livekit_sip_domain
string | null

LiveKit SIP domain for this deployment

inbound_addresses
string[] | null

LiveKit inbound SIP server addresses

supported_providers
Supported Providers · object[] | null

List of supported SIP providers with default addresses