Skip to content

Create an origination trunk

POST
/v1/Accounts/{auth_id}/Trunks/Origination
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/example/Trunks/Origination \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "cidrs": [ "198.51.100.20", "198.51.100.64/27" ], "name": "Office PBX", "password": "s3cret-Example-Pass", "status": "active", "username": "officepbx01" }'

Adds an origination (inbound) trunk so a carrier or PBX can send calls in: calls from the addresses in cidrs are accepted, and so are calls authenticated with username and password in the auth_domain realm. A trunk needs at least one address or a username. Usernames are unique across the platform (409 when taken). An inactive trunk is saved but nothing is whitelisted. The trunk is saved only if the SIP proxy accepts it; otherwise nothing is kept and 400 is returned.

auth_id
required
string

Your account Auth ID (20 characters). The request always acts on the authenticated account.

The trunk

Media type application/json
object
cidrs

IP addresses or CIDR ranges calls are accepted from. A trunk needs addresses, a username, or both.

Array<string>

Example

[
"198.51.100.20",
"198.51.100.64/27"
]
name
required

Display name, up to 100 characters.

string
<= 100 characters

Example

Office PBX
password

Password for the login, 8 to 128 characters. Required with a new username; on an update, empty keeps the saved password while the username is unchanged. Never returned.

string
>= 8 characters <= 128 characters

Example

s3cret-Example-Pass
status

Active (default) or inactive. Left out on an update, the trunk becomes active.

string
Allowed values: active inactive

Example

active
username

Login the carrier or PBX authenticates with: 2 to 64 letters and digits, stored lower case, unique across the platform.

string
>= 2 characters <= 64 characters

Example

officepbx01

Created

Media type application/json
object
auth_domain

SIP domain (realm) the username belongs to. Present only when username is set.

string
cidrs

Addresses calls are accepted from, as CIDRs (a single IP is shown as /32 or /128).

Array<string>
created

When the trunk was created, RFC 3339.

string
has_password

Whether a password is saved. The password itself is never returned.

boolean
id

Trunk ID, unique across the platform.

integer
name

Display name.

string
reachability

Whether the whitelisted single addresses answer SIP OPTIONS.

object
detail

Explanation, when there is one.

string
hosts

Each pinged host.

Array<object>
object
host

The pinged host, as saved on the trunk.

string
latency_ms

Round-trip time of the last OPTIONS answer, in milliseconds.

number
state

Reachable, unreachable or checking (added, no answer or time-out yet).

string
Allowed values: reachable unreachable checking
state

Overall state: reachable, unreachable, checking, not_checked (nothing to ping: an address range, a login-only or an inactive trunk) or unknown (the status could not be read).

string
Allowed values: reachable unreachable checking not_checked unknown
registration

Whether the carrier or PBX holds a registration with this login.

object
contacts

Origination trunks: number of registered contacts for the login.

integer
detail

Explanation, when there is one.

string
expires_in

Termination trunks: seconds until the registration with the carrier expires.

integer
state

Registered, registering, unregistered, disabled, not_required (the trunk authenticates by IP address, nothing registers) or unknown (the SIP proxy could not be asked; the trunk itself is fine).

string
Allowed values: registered registering unregistered disabled not_required unknown
status

Active: calls are accepted; inactive: the addresses and login are removed from the SIP proxy.

string
Allowed values: active inactive
updated

When the trunk was last changed, RFC 3339.

string
username

Username the carrier or PBX authenticates with (lower case). Empty for an IP-only trunk.

string

Example

{
"auth_domain": "trunk.siprtc.io",
"cidrs": [
"198.51.100.20/32",
"198.51.100.64/27"
],
"created": "2026-11-20T09:30:00Z",
"has_password": true,
"id": 7,
"name": "Office PBX",
"reachability": {
"detail": "address ranges cannot be pinged",
"hosts": [
{
"host": "203.0.113.10:5060",
"latency_ms": 23.4,
"state": "reachable"
}
],
"state": "reachable"
},
"registration": {
"contacts": 1,
"detail": "the carrier has not accepted the registration; check the username and password. It is retried every few minutes",
"expires_in": 3540,
"state": "registered"
},
"status": "active",
"updated": "2026-11-21T14:05:00Z",
"username": "officepbx01"
}

Invalid body, a field failing validation, an invalid address, neither addresses nor username, a username without password, or the SIP proxy refusing the trunk (body is ErrorResponse except for field validation)

Media type application/json
object
errors

One line per refused field: the field, the rule it broke and the value sent.

Array<string>
message

Always “invalid request”.

string
status

Always “failed”.

string

Example

{
"errors": [
"validation failed on field 'primary_ip'",
" condition: required"
],
"message": "invalid request",
"status": "failed"
}

Missing or wrong Auth ID / Auth Secret (answered by the API gateway)

Media type application/json
string

Example generated

example

Signed in as a sub-user (portal login) rather than the account owner: only the owner can change trunks

Media type application/json
object
message

What went wrong, in plain words.

string
status

Always “failed”.

string

Example

{
"message": "trunk not found",
"status": "failed"
}

The username is already used by another trunk

Media type application/json
object
message

What went wrong, in plain words.

string
status

Always “failed”.

string

Example

{
"message": "trunk not found",
"status": "failed"
}