Documentation menu

API reference

Account & webhooks

Account info, plus the account-default webhook URLs (one per purposevoice_inbound, voice_outbound, status), the shared fallback behaviour, and the signing secret. See the webhooks guide for how these fit together.

GET/account/

Returns { uuid: string, name: string, wallet_balance: string, status: string }, where status is active or suspended.

GET/account/webhooks

Returns the WebhookConfig object.

POST/account/webhooks

Set an account-default webhook URL (for one purpose) and/or the fallback behaviour. Only the fields you send are changed — send url to set that purpose's default, or omit it to change only the fallback.

FieldTypeRequiredDefaultDescription
purposestringOptionalvoice_inboundWhich purpose url applies to: voice_inbound, voice_outbound, or status.
urlstring, nullableOptionalnullDefault webhook for purpose. Blank string clears it; omit to leave it unchanged.
fallback_modestring, nullableOptionalnullmessage, play, or drop. Omit to leave the fallback unchanged.
fallback_valuestringOptional""Text for message, or audio URL for play.

Returns the WebhookConfig object.

curl https://sauti-pbx.services.co.ke/api/account/webhooks \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "purpose": "voice_inbound", "url": "https://yourapp.com/handle-call", "fallback_mode": "message", "fallback_value": "Sorry, we cannot take your call right now." }'
GET/account/webhooks/secret

Returns { signing_secret: string } — used to verify webhook signatures.

POST/account/webhooks/secret/rotate

Rotate the signing secret; the old one stops verifying immediately. Returns { signing_secret: string }.

The WebhookConfig object

FieldTypeDescription
endpointsobjectAccount-default URL per purpose, keyed by purpose value (voice_inbound, voice_outbound, status). Empty string = none set.
fallback_modestringmessage · play · drop.
fallback_valuestringMessage text or audio URL for the fallback.
numbersarrayPer-number overrides: { number, purpose, url }.