Add phone numbers to a trunk
const url = 'https://api.siprtc.io/v1/Accounts/example/SipTrunk/example/PhoneNumber';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"customer_auth_id":"AC000000000000000001","phone_number":["15555550100"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siprtc.io/v1/Accounts/example/SipTrunk/example/PhoneNumber \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "customer_auth_id": "AC000000000000000001", "phone_number": [ "15555550100" ] }'Routes phone numbers over a trunk. Numbers already on a trunk are skipped, and the request fails with 400 when all of them are. Numbers that are not in the SIPRTC number inventory are ignored. Each number is stored with its country, ISO code and type from the inventory and status active. Vendor accounts can act for a direct child account with customer_auth_id.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of your account.
ID of the trunk.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The numbers to add.
object
Vendor accounts only: add the numbers on behalf of this direct child account.
Example
AC000000000000000001Phone numbers to route over the trunk, digits only without “+”. Numbers already on a trunk are skipped; numbers not in the SIPRTC number inventory are ignored.
Example
[ "15555550100"]Responses
Section titled “ Responses ”The numbers that were added.
object
Country calling code.
ISO 3166-1 alpha-2 country code.
When the record was created (RFC 3339).
Auth ID of the account that created the record.
Trunk phone number ID (UUID); use it as trunk_number_id.
Auth ID of the account that last changed the record.
Phone number, digits only.
Status of the number on the trunk.
Trunk the number is routed over.
Number type.
When the record was last changed (RFC 3339).
Example
[ { "country_code": "1", "country_iso": "US", "created_at": "2026-01-15T10:30:00Z", "created_by": "AC000000000000000000", "id": "7e6d5c4b-3a29-4180-9f7e-6d5c4b3a2901", "modified_by": "AC000000000000000000", "phone_number": "15555550100", "status": "active", "trunk_id": "3d6f0a52-8c1e-4b7a-9f2d-1a2b3c4d5e01", "type": "local", "updated_at": "2026-01-16T08:00:00Z" }]Every number is already on a trunk, the numbers could not be stored, or the gateway did not supply your company (message “company id is empty”).
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}Missing or wrong Basic-auth credentials (returned by the API gateway).
Example generated
exampleCustomer_auth_id is not a direct child account of a vendor you belong to, or its parent is not a vendor.
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}The customer account could not be looked up.
object
Underlying error reported by the account lookup.
Human-readable explanation of the failure.
Always “failed”.
Example
{ "error": "account not found", "message": "Error fetching account details", "status": "failed"}