Skip to main content
This walkthrough takes you from zero to a number mapped onto your own SIP carrier. You’ll need your API Token and Org-Handle - see Authentication.
1

Set your credentials

Every request uses these two headers (writes also send Content-Type: application/json):
export BASE="https://unpod.ai"
export AUTH="Authorization: Token <your-api-key>"
export ORG="Org-Handle: <your-org-handle>"
Get your Org-Handle from Get All Organizations - the domain_handle field.
2

See the numbers available to you

List the unassigned numbers in your org’s pool. Note an id to use later.
curl -s "$BASE/api/v2/platform/telephony/numbers/" -H "$AUTH" -H "$ORG"
See List Numbers.
3

Create a trunk (your SIP carrier credential)

curl -s -X POST "$BASE/api/v2/platform/telephony/trunks/" \
  -H "$AUTH" -H "$ORG" -H "Content-Type: application/json" \
  -d '{
    "name": "My Carrier Trunk",
    "sip_url": "sip:carrier.net",
    "auth_username": "user",
    "auth_password": "pass",
    "transport": "tcp",
    "port": "5060",
    "source_ips": ["1.2.3.4", "5.6.7.0/24"]
  }'
The response returns the new trunk id (e.g. 21). Copy it. See Create Trunk.
4

Map a number to the trunk

Replace 21 with your trunk id and 501 with a number id from Step 2.
curl -s -X POST "$BASE/api/v2/platform/telephony/trunks/21/attach-numbers/" \
  -H "$AUTH" -H "$ORG" -H "Product-Id: unpod.dev" \
  -H "Content-Type: application/json" \
  -d '{"number_ids": [501]}'
The response includes the origin endpoint - the SBC ingress your carrier sends inbound calls to, plus the accepted source IPs. See Attach Numbers to Trunk.
5

Confirm the lifecycle

curl -s "$BASE/api/v2/platform/telephony/overview/" -H "$AUTH" -H "$ORG"
Each number shows connection_state, termination kind, agent link, and sync_state. See Telephony Overview.

What next

Detach numbers

Step 1 - unmap numbers from the trunk, returning them to NOT_ASSIGNED.

Delete trunk

Step 2 - remove the trunk and its credential once numbers are detached.