Documentation menu

API reference

API keys

Bearer credentials for the REST API. See Authentication for how they're used and how to keep them safe.

GET/keys/

Returns array<ApiKey> — prefix and last-used only, never the secret.

POST/keys/create

Body { name: string }.

Returns an ApiKey plus key: string — the full secret, shown this one time only.

curl https://sauti-pbx.services.co.ke/api/keys/create \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "production server" }'

// → 201 Created — the full "key" is shown this one time only
{ "uuid": "...", "prefix": "sk_live_ab", "key": "sk_live_abcd..." }
POST/keys/revoke

Body { uuid: string }. Returns { message: string }.

The ApiKey object

FieldTypeDescription
uuidstringStable identifier (use with revoke).
namestringYour label.
prefixstringFirst chars of the key, to tell keys apart.
is_activebooleanWhether the key still works.
last_used_at / created_atstring, nullableISO-8601 timestamps.