Skip to content

Update a trunk phone number

PUT
/v1/Accounts/{auth_id}/SipTrunk/{trunk_id}/PhoneNumber/{trunk_number_id}
curl --request PUT \
--url https://api.siprtc.io/v1/Accounts/example/SipTrunk/example/PhoneNumber/example \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "country_code": "1", "country_iso": "US", "phone_number": "15555550100", "status": "active", "type": "local" }'

Overwrites a trunk phone number record: phone_number, type, country_code and country_iso are required and status is stored as sent, so send the current values of the fields you keep (an omitted status hides the number from lists). 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.

trunk_number_id
required
string

ID of the trunk phone number record (not the number itself).

customer_id
string

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

The new values.

Media type application/json
object
country_code
required

Country calling code.

string

Example

1
country_iso
required

ISO 3166-1 alpha-2 country code.

string

Example

US
phone_number
required

Phone number, digits only without “+”.

string

Example

15555550100
status

Number status on the trunk.

string
Allowed values: active inactive

Example

active
type
required

Number type.

string

Example

local

Updated (message “Trunk phone number 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"
}

A required field is missing, the record does not exist, the 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"
}