Route a number to a SIP trunk
const url = 'https://api.caller9.app/v1/numbers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/trunk';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"trunk_guid":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.caller9.app/v1/numbers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/trunk \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "trunk_guid": "example" }'Sends inbound calls on this number to a SIP trunk’s PBX, replacing any existing trunk routing and clearing any studio assignment or direct forward. The trunk must belong to the same organization. Requires a full-access key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Phone number ID (UUID), not the phone number itself.
Request Bodyrequired
Section titled “Request Bodyrequired”object
ID of the SIP trunk.
Example generated
{ "trunk_guid": "example"}Responses
Section titled “Responses”The new trunk routing.
object
Example generated
{ "number_guid": "example", "trunk_guid": "example"}The request was invalid.
object
Human-readable error message.
Machine-readable code (authentication failures only, e.g. KEY_EXPIRED, RATE_LIMITED).
Example generated
{ "error": "example", "code": "example"}Missing, invalid, expired or revoked API key.
object
Human-readable error message.
Machine-readable code (authentication failures only, e.g. KEY_EXPIRED, RATE_LIMITED).
Example generated
{ "error": "example", "code": "example"}The key isn’t allowed to do this (e.g. a read-only key making a change).
object
Human-readable error message.
Machine-readable code (authentication failures only, e.g. KEY_EXPIRED, RATE_LIMITED).
Example generated
{ "error": "example", "code": "example"}Not found, or belongs to another organization.
object
Human-readable error message.
Machine-readable code (authentication failures only, e.g. KEY_EXPIRED, RATE_LIMITED).
Example generated
{ "error": "example", "code": "example"}Too many requests for this API key. Retry after Retry-After seconds.
object
Human-readable error message.
Machine-readable code (authentication failures only, e.g. KEY_EXPIRED, RATE_LIMITED).
Example generated
{ "error": "example", "code": "example"}Headers
Section titled “Headers”Seconds until the rate-limit window resets.