Skip to content

Create a SIP trunk

POST
/v1/Accounts/{auth_id}/SipTrunk
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/example/SipTrunk \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "customer_auth_id": "AC000000000000000001", "name": "Main PBX trunk", "phone_number": [ "15555550100" ] }'

Creates an active SIP trunk with recording off and a limit of 1 call per second and 1 concurrent call in each direction. The name must be unique on the account, and an account can have at most 5 trunks. phone_number optionally routes up to 5 numbers over the trunk: each must exist in the SIPRTC number inventory and none may already be on a trunk. Add termination and origination URIs afterwards. Vendor accounts can act for a direct child account with customer_auth_id.

auth_id
required
string

Auth ID of your account.

The trunk to create.

Media type application/json
object
customer_auth_id

Vendor accounts only: create the trunk for this direct child account.

string

Example

AC000000000000000001
name
required

Trunk name, unique among the account’s trunks.

string

Example

Main PBX trunk
phone_number

Optional phone numbers to route over the trunk, digits only without “+”. Each must exist in the SIPRTC number inventory and must not already be on another trunk. At most 5.

Array<string>

Example

[
"15555550100"
]

The new trunk and the numbers added to it.

Media type application/json
object
Trunk

The new trunk. Counters and URIs are not filled in this response.

object
auth_id

Auth ID of the account that owns the trunk.

string
created_at

When the record was created (RFC 3339).

string
created_by

Auth ID of the account that created the record.

string
id

Trunk ID (UUID).

string
is_recording

Whether calls over the trunk are recorded.

boolean
modified_by

Auth ID of the account that last changed the record.

string
name

Trunk name.

string
origination_channel_limit

Concurrent inbound calls allowed.

integer
origination_cps

Inbound calls per second allowed.

integer
origination_uris

The trunk’s origination URIs.

Array<object>
object
priority

Priority as a decimal string; lower is tried first.

string
status

Whether the URI is enabled.

boolean
uri

SIP URI inbound calls are sent to.

string
status

Trunk status.

string
Allowed values: active inactive
termination_channel_limit

Concurrent outbound calls allowed.

integer
termination_cps

Outbound calls per second allowed.

integer
termination_uris

SIP domain of the trunk’s termination URI; empty when it has none.

string
updated_at

When the record was last changed (RFC 3339).

string
TrunkPhoneNumber

Phone numbers added to the trunk; null when none were given.

Array<object>
object
country_code

Country calling code.

string
country_iso

ISO 3166-1 alpha-2 country code.

string
created_at

When the record was created (RFC 3339).

string
created_by

Auth ID of the account that created the record.

string
id

Trunk phone number ID (UUID); use it as trunk_number_id.

string
modified_by

Auth ID of the account that last changed the record.

string
phone_number

Phone number, digits only.

string
status

Status of the number on the trunk.

string
Allowed values: active inactive
trunk_id

Trunk the number is routed over.

string
type

Number type.

string
updated_at

When the record was last changed (RFC 3339).

string

Example

{
"Trunk": {
"auth_id": "AC000000000000000000",
"created_at": "2026-01-15T10:30:00Z",
"created_by": "AC000000000000000000",
"id": "3d6f0a52-8c1e-4b7a-9f2d-1a2b3c4d5e01",
"is_recording": false,
"modified_by": "AC000000000000000000",
"name": "Main PBX trunk",
"origination_channel_limit": 1,
"origination_cps": 1,
"origination_uris": [
{
"priority": "10",
"status": true,
"uri": "sip:pbx.example.com:5060"
}
],
"status": "active",
"termination_channel_limit": 1,
"termination_cps": 1,
"termination_uris": "acme-trunk.pstn.siprtc.io",
"updated_at": "2026-01-16T08:00:00Z"
},
"TrunkPhoneNumber": [
{
"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"
}
]
}

Name is missing, too many phone numbers were given, 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_auth_id is not a direct child account of a vendor you belong to, or its parent is not a vendor.

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"
}

The trunk was not created: the trunk limit is reached, the name is taken, a number is already on a trunk, or an account lookup failed.

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"
}