Skip to content

Lines and numbers

A number is a phone number in your workspace. A line is a SIP registration with your carrier that carries one or more numbers.

Scopes: numbers:read, numbers:write, lines:read, lines:write.

Terminal window
curl https://app.airfone.app/v1/numbers \
-H "Authorization: Bearer $AIRFONE_KEY"

Each number shows who answers while you are open (when_open) and while you are closed (when_closed), and whether that works today (live).

Terminal window
curl -X PATCH https://app.airfone.app/v1/numbers/NUMBER_ID \
-H "Authorization: Bearer $AIRFONE_KEY" \
-H "Content-Type: application/json" \
-d '{
"when_open": { "kind": "assistant" },
"when_closed": { "kind": "message" }
}'

kind is one of:

kindextra field
assistantassistant_id (optional, defaults to your workspace assistant)
teamteam_id
membermember_id
menumenu_id
messagenone, the caller leaves a message
Terminal window
curl https://app.airfone.app/v1/lines \
-H "Authorization: Bearer $AIRFONE_KEY"

status is the live registration state: active, unreachable, auth_failed, node_offline or moving. status_reason explains a problem.

Terminal window
curl https://app.airfone.app/v1/lines \
-H "Authorization: Bearer $AIRFONE_KEY" \
-H "Content-Type: application/json" \
-d '{
"reach": "internet",
"proxy": "sip.carrier.example",
"realm": "carrier.example",
"username": "9779800000000",
"sip_password": "...",
"numbers": ["+97798XXXXXXXX"],
"carrier_label": "Main line"
}'

The password is stored encrypted and is never returned. A private line needs a premises box already connected to your workspace.

Terminal window
curl -X PATCH https://app.airfone.app/v1/lines/LINE_ID \
-H "Authorization: Bearer $AIRFONE_KEY" \
-H "Content-Type: application/json" \
-d '{ "enabled": false }'

You can also change carrier_label or send a new sip_password.

Terminal window
curl -X DELETE https://app.airfone.app/v1/lines/LINE_ID \
-H "Authorization: Bearer $AIRFONE_KEY"

Returns 409 while numbers are still on the line.