Add an origination URI to a trunk
const url = 'https://api.siprtc.io/v1/Accounts/example/SipTrunk/example/OriginationUri';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"customer_auth_id":"AC000000000000000001","meta_data":"primary site","priority":"10","sip_uri":"sip:pbx.example.com:5060","status":true}'};
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/OriginationUri \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "customer_auth_id": "AC000000000000000001", "meta_data": "primary site", "priority": "10", "sip_uri": "sip:pbx.example.com:5060", "status": true }'Adds an origination URI to a trunk: a SIP URI that SIPRTC sends inbound calls for the trunk’s phone numbers to, tried in priority order (lowest first). A trunk can have at most 5 origination URIs and the same SIP URI cannot be added twice. priority must be a whole number sent as a string. The URI is registered in the SIP edge’s routing cache when it is created. 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 origination URI to add.
object
Vendor accounts only: create the URI on behalf of this direct child account.
Example
AC000000000000000001Free-form text stored with the URI.
Example
primary sitePriority as a decimal string; lower is tried first. Must be a number.
Example
10SIP URI that inbound calls for the trunk’s numbers are sent to.
Example
sip:pbx.example.com:5060Whether the URI is enabled.
Example
trueResponses
Section titled “ Responses ”The new origination URI.
object
When the record was created (RFC 3339).
Auth ID of the account that created the record.
Origination URI ID (UUID).
Free-form text stored with the URI.
Auth ID of the account that last changed the record.
Priority as a decimal string; lower is tried first.
SIP URI inbound calls are sent to.
Whether the URI is enabled.
Trunk the URI belongs to.
When the record was last changed (RFC 3339).
Example
{ "created_at": "2026-01-15T10:30:00Z", "created_by": "AC000000000000000000", "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c01", "meta_data": "primary site", "modified_by": "AC000000000000000000", "priority": "10", "sip_uri": "sip:pbx.example.com:5060", "status": true, "trunk_id": "3d6f0a52-8c1e-4b7a-9f2d-1a2b3c4d5e01", "updated_at": "2026-01-16T08:00:00Z"}Sip_uri is missing, the limit is reached, the URI already exists, priority is not a number, or (with customer_auth_id) 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"}