Early access: these interfaces are documented as drafts. Confirm commands, packages and endpoints with us before use.

REST API

Everything over HTTP, for your own dashboards, onboarding flows and automations.

Basics

Base URLhttps://app.trunkbeam.com/v1
AuthAuthorization: Bearer tb_live_…
FormatJSON, timestamps in UTC as ISO 8601
Phone numbersE.164, for example +493023125417
curl https://app.trunkbeam.com/v1/numbers \
  -H "Authorization: Bearer $TRUNKBEAM_API_KEY"

Endpoints

MethodPathPurpose
GET/numbers/available?area=030Search available numbers
POST/numbersBuy a number
GET/numbersYour numbers
GET/numbers/{number}One number with routing
PATCH/numbers/{number}Change SIP target and fallbacks
DELETE/numbers/{number}Cancel at month end
PUT/numbers/{number}/transfer-targetsSet allowed REFER targets
GET/verificationVerification status
GET/callsCalls with duration and cost
GET/usage?month=2026-10Usage for a month
GET/pricesCurrent price list

Buy a number

curl https://app.trunkbeam.com/v1/numbers \
  -H "Authorization: Bearer $TRUNKBEAM_API_KEY" \
  -H "Idempotency-Key: 6f1c2b" \
  -H "Content-Type: application/json" \
  -d '{"area": "040", "sip": "sip:agent@voice.example"}'
{
  "number": "+494066969351",
  "area": "040",
  "status": "active",
  "sip": "sip:agent@voice.example"
}

With Idempotency-Key a network error cannot make you buy two numbers by accident. Retrying with the same key returns the first response.

Errors

{ "error": { "code": "verification_required", "message": "Account is not approved yet." } }
HTTPcodeMeaning
400invalid_requestInput missing or invalid
401unauthorizedKey missing or invalid
403verification_requiredAccount not approved yet
402spend_limit_reachedSpend limit of the key reached
409number_unavailableNumber was taken in the meantime
429rate_limitedToo many requests, respect Retry-After

Webhooks

Register a URL for events. We send a POST with JSON and a signature in the Signature header.

trunkbeam webhooks add https://example.com/hooks/phone --events call.started,call.ended,call.transferred
EventWhen
call.startedA call comes in
call.endedA call ended, with duration and cost
call.transferredA call was transferred via REFER
verification.approvedAccount or address approved
verification.rejectedRejected, with reason
Connect your stack to TrunkBeam