Create a termination trunk
const url = 'https://api.siprtc.io/v1/Accounts/example/Trunks/Termination';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"codecs":"PCMU,PCMA","except_cc":["CU"],"from_remove_prefix":"+","name":"Acme Carrier EU","password":"s3cret-Example-Pass","primary_ip":"203.0.113.10:5060","priority":10,"remove_prefix":"00","secondary_ip":"203.0.113.11","supported_cc":["GB","IE"],"trunk_prefix":"9","username":"acme-trunk-01"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siprtc.io/v1/Accounts/example/Trunks/Termination \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "codecs": "PCMU,PCMA", "except_cc": [ "CU" ], "from_remove_prefix": "+", "name": "Acme Carrier EU", "password": "s3cret-Example-Pass", "primary_ip": "203.0.113.10:5060", "priority": 10, "remove_prefix": "00", "secondary_ip": "203.0.113.11", "supported_cc": [ "GB", "IE" ], "trunk_prefix": "9", "username": "acme-trunk-01" }'Adds a termination (outbound) trunk: outbound calls to the countries in supported_cc (minus except_cc) are sent to primary_ip, with secondary_ip as fallback, before the platform’s own routes. The call is still rated and billed with your account’s outbound rates. With a username and password the platform registers with the carrier and answers its digest challenges; without them the carrier must accept you by IP address. trunk_prefix, remove_prefix and from_remove_prefix rewrite the dialled number and caller ID; codecs restricts the offered codecs. The trunk is saved only if the SIP proxy accepts its credentials; otherwise nothing is kept and 400 is returned.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your account Auth ID (20 characters). The request always acts on the authenticated account.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The trunk
object
Comma-separated codec names in order of preference (letters, digits, . _ / -), up to 100 characters. Empty means the platform default.
Example
PCMU,PCMAISO 3166-1 alpha-2 country codes this trunk must never carry (two letters each).
Example
[ "CU"]FromRemovePrefix is stripped from the caller ID (after its +) on calls sent to this trunk, e.g. “+” so the carrier sees the account’s user. Left out, the saved one is kept: clients that predate the field (older portals) would otherwise clear it on every save; “” clears it.
Example
+Display name, up to 100 characters.
Example
Acme Carrier EUDigest password, up to 128 characters. Required with a new username; on an update, empty keeps the saved password while the username is unchanged. Never returned.
Example
s3cret-Example-PassCarrier SIP host calls are sent to: IP address or hostname, optionally with :port.
Example
203.0.113.10:50600 to 100 (default 0). Among the account’s trunks that carry a destination, the highest priority is tried first.
Example
10Leading digits stripped from the dialled number before trunk_prefix is added (digits, +, *, #; up to 20).
Example
00Optional fallback carrier SIP host, same format as primary_ip.
Example
203.0.113.11ISO 3166-1 alpha-2 country codes of destinations this trunk carries, or [“ALL”]. At least one.
Example
[ "GB", "IE"]Digits prepended to the dialled number before it is sent (digits, +, *, #; up to 20).
Example
9Digest username for the carrier, up to 64 characters, no spaces or @ : ; < > quotes. Leave empty for a carrier that authenticates you by IP address.
Example
acme-trunk-01Responses
Section titled “ Responses ”Created
object
Comma-separated codec names offered to the carrier, in order of preference. Empty means the platform default.
When the trunk was created, RFC 3339.
ISO 3166-1 alpha-2 country codes this trunk never carries, even when supported_cc is ALL.
Leading characters stripped from the caller ID (after its +) on calls sent to this trunk; “+” sends the bare number.
Whether a password is saved. The password itself is never returned.
Trunk ID, unique across the platform.
Display name.
Carrier SIP host calls are sent to: IP address or hostname, optionally with :port.
0 to 100. When several of the account’s trunks carry a destination, the highest priority is tried first.
Whether the carrier’s hosts answer SIP OPTIONS.
object
Explanation, when there is one.
Each pinged host.
object
The pinged host, as saved on the trunk.
Round-trip time of the last OPTIONS answer, in milliseconds.
Reachable, unreachable or checking (added, no answer or time-out yet).
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).
Live state of the trunk’s registration with its carrier.
object
Origination trunks: number of registered contacts for the login.
Explanation, when there is one.
Termination trunks: seconds until the registration with the carrier expires.
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).
Leading digits stripped from the dialled number before trunk_prefix is added.
Fallback carrier SIP host, used when the primary does not answer. Empty when not set.
ISO 3166-1 alpha-2 country codes of destinations this trunk carries, or [“ALL”].
Digits prepended to the dialled number before it is sent to the carrier (digits, +, *, #).
When the trunk was last changed, RFC 3339.
Digest username for the carrier. Empty for a trunk the carrier authenticates by IP address.
Example
{ "codecs": "PCMU,PCMA", "created": "2026-11-20T09:30:00Z", "except_cc": [ "CU" ], "from_remove_prefix": "+", "has_password": true, "id": 42, "name": "Acme Carrier EU", "primary_ip": "203.0.113.10:5060", "priority": 10, "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" }, "remove_prefix": "00", "secondary_ip": "203.0.113.11", "supported_cc": [ "GB", "IE" ], "trunk_prefix": "9", "updated": "2026-11-21T14:05:00Z", "username": "acme-trunk-01"}Invalid body, a field failing validation, a username without password (or the reverse), bad prefix or codec characters, or the SIP proxy refusing the trunk (body is ErrorResponse except for field validation)
object
One line per refused field: the field, the rule it broke and the value sent.
Always “invalid request”.
Always “failed”.
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)
Example generated
exampleSigned in as a sub-user (portal login) rather than the account owner: only the owner can change trunks
object
What went wrong, in plain words.
Always “failed”.
Example
{ "message": "trunk not found", "status": "failed"}