Skip to the content
Check NetworksHelp
  1. API and webhooks
  2. SIP trunks by API

SIP trunks by API

Creating a trunk, its SIP credential and IP list, registration, plan changes and what they cost, suspending and resuming, spend caps and holds, and the trunk webhooks.

Everything the portal’s trunk pages do, your own systems can do through the API. The full reference lists every call and its fields. This page covers how they fit together.

Scopes

  • voice:read lists and reads trunks, their IP list, source restrictions and registration.
  • voice:create creates a trunk, adds an IP entry, and gives a trunk its first SIP credential.
  • voice:update changes a trunk, rotates its password, suspends and resumes it, cancels a booked plan change, sets source restrictions and releases a spend cap hold.
  • voice:delete deletes a trunk and removes an IP entry.
  • secrets:read reveals a trunk’s current SIP password. voice:read never does.

Naming a trunk

Every trunk has an id, and most have a sipUsername. Every /trunks/{username} call takes either one. A trunk set up without a SIP credential authenticates only by IP and has a null sipUsername, so address it by its id. Trunk webhooks carry the id as trunkId.

Creating a trunk

  1. Send POST /trunks with a name and a defaultCallerId, with an Idempotency-Key so a retry never creates two. The caller ID must be a number on your account with an emergency address, or one approved with POST /caller-id-authorisations.
  2. Choose the plan with type. payg, the default, meters outbound calls. ultimate bills each channel monthly and needs channels. Send endUser to bill the trunk’s calls to one of your end users.
  3. The 201 answer has the trunk’s id, its sipUsername and its SIP password. The password is in this answer only, so store it.
  4. Read the trunk with GET /trunks/{username} until provisioningState is active, then make a test call. connection gives what the PBX needs: the registrar, ports, codecs and DTMF mode, and connection.allowList the addresses to let through your firewall.

To order call recording with the trunk, send recordingEnabled: true and acknowledgeRecording: true. Without the acknowledgement the answer is a 422 with the code charge_acknowledgement_required, the text you are agreeing to in error.consent and the monthly price in error.charge.

With bundleId, the trunk joins that bundle as a draft and is set up when the bundle is submitted. Take its password then with POST /trunks/{username}/credential/rotate.

The SIP credential

  • GET /trunks/{username}/credential reveals the current username and password, to set up a PBX without changing the password. It needs secrets:read, and each reveal is recorded in the trunk’s history with the key that read it.
  • POST /trunks/{username}/credential/rotate sets a new password and returns it once. The old password stops working at once. Send an Idempotency-Key: a retry with the same key gives the same password instead of rotating again.
  • POST /trunks/{username}/credential gives a trunk with no credential its first one, so it can register. Address the trunk by its id or its handle. A trunk that already has a credential answers 409: rotate it instead.

IP list and host names

A trunk accepts registration with its credential, or calls from an address on its IP list without registering.

  • GET /trunks/{username}/ips lists the entries.
  • POST /trunks/{username}/ips adds one: a public IPv4 address or a range no wider than /24, a single IPv6 address, or a host name such as pbx.example.com. A host name is resolved now and again on its DNS TTL, and listed with type: host. An address or host name already on another trunk, yours or another account’s, is refused, since the source address says which trunk a call belongs to.
  • DELETE /trunks/{username}/ips/{ipId} removes one.

Source restrictions are a different thing: they limit where the trunk’s credential may be used from. GET /trunks/{username}/source-restrictions reads them, and PUT /trunks/{username}/source-restrictions replaces both lists, cidrs and countries. Empty lists lift every restriction you set. An entry we added, for example to stop fraud, stays whatever you send. Raise a support ticket about one.

So a typo cannot lock you out, a cidrs list that leaves out the address your request came from answers 422 naming that address, and nothing changes. Add the address, or send confirmLockout: true if you mean it. The check does not look up countries, so send confirmLockout too when the address is let in by its country instead.

Registration

GET /trunks/{username}/registration gives the live registration state: whether the trunk is registered, and the contacts registered against it, which are PBXs and gateways. A trunk that sends calls only from its IP list does not register, so it reads registered: false.

Changing the plan or channels, and what is charged

Change type and channels with PATCH /trunks/{username}.

  • An upgrade takes effect at once and is billed from today: payg to ultimate, or more channels on ultimate.
  • A downgrade takes effect at the start of your next billing cycle: fewer channels, or ultimate to payg. Until then the trunk reads its current plan, and the booked change is in pendingPlanChange.

The answer carries a planChange block saying which way the change went, whether it applied at once, and its effectiveOn date. A new request replaces a change already booked. DELETE /trunks/{username}/plan-change cancels a booked change, and so does DELETE /account/booked-changes/{id}, which lists it with your other booked changes.

On payg, channels is only a ceiling on concurrent calls and changes nothing on your bill.

Recording is a monthly charge per trunk. Turning it on with PATCH needs acknowledgeRecording: true, as on create. Turning it off does not.

DELETE /trunks/{username} deletes a trunk once its numbers are routed elsewhere or cancelled. A trunk still in contract has an early termination charge. The first request answers 422 charge_acknowledgement_required with the charge in error.charge. Sending acknowledgeEarlyTermination=true accepts it and deletes the trunk.

Suspending and resuming

POST /trunks/{username}/suspend stops a trunk’s calls at once, for example to stop a compromised PBX. New outbound calls are refused and calls to its numbers are refused before they reach the PBX. The caller hears that the number can’t be reached. No failover step runs, voicemail takes no message, and the line’s forwarding and Do Not Disturb are not applied. It still places 000, 112 and 106 calls, and for an hour after one, calls to its numbers are delivered so the emergency service can call back, ringing the trunk whatever its forwarding or Do Not Disturb says. Billing is unchanged. The trunk reads status: suspended and suspendedBy: account.

Calls already up carry on when a trunk is suspended. To end them too, send POST /trunks/{username}/calls/hangup with an Idempotency-Key. It hangs up every live call on the trunk and answers 202 with how many were ended, skipped and failed. The skipped ones are calls to 000, 112 or 106, which are never hung up. Send it again with a new key to retry the failed ones.

POST /trunks/{username}/resume reverses a suspension. A trunk we suspended, for example for non-payment, reads suspendedBy: checkNetworks. It answers 409 with the reason, and stays suspended until we lift it.

A trunk whose defaultCallerId ported to another carrier keeps it. We don’t change it for you. 48 hours after the port completes, a trunk still presenting it is suspended, with suspendedBy: checkNetworks. 000 still connects. Setting another defaultCallerId with PATCH /trunks/{username} lifts it within a couple of minutes. We email your technical and primary contacts before then.

Spend caps and holds

Set dailySpendCapExGst with PATCH /trunks/{username}, as a dollar string, to limit what the trunk’s outbound calls may cost in a day. null removes the cap. The trunk reads spendTodayExGst beside it. A call counts toward it when the call ends, so calls still up are not in it yet.

When a trunk reaches its cap, spendCapHeld is true and its new outbound calls stop until midnight Brisbane time, given in spendCapReleasesAt. Calls already up carry on. To let calls through sooner, send POST /trunks/{username}/spend-cap/release, which keeps the same cap for the rest of the day, or raise the cap above spendTodayExGst. A cap set at or below spendTodayExGst, "0.00" included, holds the trunk at once, and the PATCH answer reads spendCapHeld: true. 000 and inbound calls are never held. While it is held, each outbound call the trunk tries is refused with 403 Outbound calling suspended and a Retry-After header giving the seconds until spendCapReleasesAt, so the PBX learns it without polling.

A trunk can also be held at its international minutes cap, shown as internationalHold. Its international calls are refused until we release it, so raise a support ticket. Your whole account’s outbound calls can be held for unusual spend or calling patterns.

Webhooks

  • trunk.down when an active trunk has neither registered nor sent an OPTIONS keepalive for 10 minutes, and trunk.up when it is back. When one of our own SBCs stops recording trunks, we send no trunk.down until it records again: that fault is ours, and we deal with it. A trunk really down through it is sent trunk.down once it does.
  • trunk.planChangeScheduled, trunk.planChangeCancelled and trunk.planChanged as a plan change is booked, cancelled and applied, with bookedChange.applied, bookedChange.cancelled and bookedChange.failed beside them.
  • voice.hold.placed and voice.hold.released when a hold starts and ends: a spend cap hold (dailySpendCap), an international cap hold (internationalCap), or an account hold.

Webhook event types lists each event’s fields.

Still stuck? Log a ticket in the portal, or call support on 1800 718 449, Monday to Friday, 9 am to 6 pm AEST.

Log a ticket

© 2026 Check Networks. ABN 22 623 070 057. checknetworks.tools