Skip to content

Update a SIP trunk and its URIs

PUT
/v1/Accounts/{auth_id}/SipTrunk/WithUris/{trunk_id}
curl --request PUT \
--url https://api.siprtc.io/v1/Accounts/example/SipTrunk/WithUris/example \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Main PBX trunk", "origination_uris_to_add": [ { "priority": "10", "sip_uri": "sip:pbx.example.com:5060", "status": true } ], "origination_uris_to_delete": [ "sip:old-pbx.example.com:5060" ], "status": "active", "termination_uris": "acme-trunk.pstn.siprtc.io" }'

Updates one of your trunks and its URIs in one call. name and status are overwritten. termination_uris replaces the SIP domain of the trunk’s termination URI (an empty or missing value clears it), creating the termination URI when the trunk has none. origination_uris_to_delete removes origination URIs by SIP URI and origination_uris_to_add adds new ones; adding a URI the trunk already has fails with 400 after the other changes have been saved. A vendor account can pass customer_id to act on a direct child account’s record.

auth_id
required
string

Auth ID of your account.

trunk_id
required
string

ID of the trunk.

customer_id
string

Vendor accounts only: act on this direct child account instead of your own.

The new trunk settings and URI changes.

Media type application/json
object
name
required

Trunk name, unique among the account’s trunks.

string

Example

Main PBX trunk
origination_uris_to_add

Origination URIs to add. Adding a URI the trunk already has fails.

Array<object>
object
priority

Priority of the URI as a decimal string; lower is tried first.

string

Example

10
sip_uri

SIP URI that inbound calls for the trunk’s numbers are sent to.

string

Example

sip:pbx.example.com:5060
status

Whether the URI is enabled.

boolean

Example

true
origination_uris_to_delete

SIP URIs of origination URIs to remove from the trunk.

Array<string>

Example

[
"sip:old-pbx.example.com:5060"
]
status

Trunk status, stored as sent (“active” or “inactive”).

string
Allowed values: active inactive

Example

active
termination_uris

SIP domain of the trunk’s termination URI. It replaces the stored value (an empty value clears it); a termination URI is created when the trunk has none.

string

Example

acme-trunk.pstn.siprtc.io

Updated (message “Trunk URIs updated successfully”).

Media type application/json
object
message

Human-readable explanation of the outcome.

string
status

Outcome of the request: “success” or “failed”.

string
Allowed values: success failed

Example

{
"message": "Invalid auth ID",
"status": "success"
}

Name is missing, the trunk is not yours or does not exist, the name is taken, a URI change failed, or the gateway did not supply your company (message “company id is empty”).

Media type application/json
object
message

Human-readable explanation of the outcome.

string
status

Outcome of the request: “success” or “failed”.

string
Allowed values: success failed

Example

{
"message": "Invalid auth ID",
"status": "success"
}

Missing or wrong Basic-auth credentials (returned by the API gateway).

Media type application/json
string

Example generated

example

Customer_id is not a direct child of your account.

Media type application/json
object
message

Human-readable explanation of the outcome.

string
status

Outcome of the request: “success” or “failed”.

string
Allowed values: success failed

Example

{
"message": "Invalid auth ID",
"status": "success"
}

Your account or the customer account could not be looked up.

Media type application/json
object
message

Human-readable explanation of the outcome.

string
status

Outcome of the request: “success” or “failed”.

string
Allowed values: success failed

Example

{
"message": "Invalid auth ID",
"status": "success"
}