Documentation menu

API reference

Numbers

Acquire numbers from the pool, release them, and point them at a webhook.

GET/numbers/

List numbers you own. Returns array<Number>.

GET/numbers/available

List numbers in the pool you can acquire. Returns array<{ uuid: string, number: string }>.

POST/numbers/acquire

Acquire a pool number. Charges the one-time setup fee to your wallet.

FieldTypeRequiredDescription
uuidstringRequiredThe pool number's uuid.

Header Idempotency-Key (optional, recommended — a retry never charges twice). Returns a Number object. Errors 404 unknown, 409 already taken, 402 insufficient funds.

curl https://sauti-pbx.services.co.ke/api/numbers/acquire \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "uuid": "the-number-uuid" }'

// → 200 OK
{ "uuid": "...", "number": "+254709080010", "is_active": true, … }
POST/numbers/release

Return a number to the pool. Body { uuid: string }. Returns { message: string }.

POST/numbers/configure

Update a number's per-purpose webhook URL overrides and/or friendly name. Only provided fields are changed. A blank URL for a purpose clears the per-DID override so that purpose falls back to the account default.

FieldTypeRequiredDescription
uuidstringRequiredThe number to configure.
webhook_urlsobject, nullableOptionalPer-purpose URL overrides — { voice_inbound?, voice_outbound?, status? }. Omit a key to leave that purpose unchanged.
friendly_namestring, nullableOptionalA label for your own reference.

Returns a Number object.

The Number object

FieldTypeDescription
uuidstringStable identifier.
numberstringThe DID in E.164.
friendly_namestringYour label.
webhook_urlsobjectPer-purpose URL overrides keyed by purpose value (voice_inbound, voice_outbound, status). Empty string = inherits account default for that purpose.
webhook_inboundobjectThe resolved inbound route: { url, source } where source is custom (this number's override), default (account default), or none. Use this to see where inbound calls actually go.
is_activebooleanWhether the number is live.
acquired_atstring, nullableWhen you acquired it.