Skip to content

Update a SIP trunk

PUT
/v1/Accounts/{auth_id}/SipTrunk/{trunk_id}
curl --request PUT \
--url https://api.siprtc.io/v1/Accounts/example/SipTrunk/example \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "is_recording": false, "name": "Main PBX trunk", "status": "active" }'

Renames one of your trunks, sets its status and turns call recording on or off. name, status and is_recording are all overwritten, so send the current values of those you do not want to change: an omitted status is stored empty (which hides the trunk from lists) and an omitted is_recording turns recording off. The name must be unique among the account’s trunks. 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.

Media type application/json
object
is_recording

Whether calls over the trunk are recorded. Omitting it turns recording off.

boolean

Example

false
name
required

Trunk name, unique among the account’s trunks.

string

Example

Main PBX trunk
status

Trunk status. The value is stored as sent, so always send it (“active” or “inactive”).

string
Allowed values: active inactive

Example

active

Updated (message “Trunk 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 does not exist, the name is taken, 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"
}