Authentication
Authenticate every request with an API key sent as a Bearer token.
API keys
Create keys in Developers → API keys (keys can only be created from the dashboard, not with another key). Each key belongs to one organization and carries its own set of permissions — never more than the person who created it holds. The full secret is displayed once; Engage stores only a keyed hash and afterwards shows the prefix so you can recognise the key.
curl https://engage.swastik.ai/v1/numbers \
-H "Authorization: Bearer egk_live_xxxxxxxxxxxxxxxx"An organization can have up to 50 active keys.
Key prefixes
When you create a key you choose a label of live or test, which becomes its prefix (egk_live_… or egk_test_…).
Permissions
Grant each key only what it needs. These are the permissions a key can hold:
Keys can also hold flows:* and catalog:* for WhatsApp Flows and commerce features. A request without the required permission returns 403 forbidden. Some actions — deleting contacts, managing numbers, team members and billing — can only be done by signed-in people in the dashboard.
IP allowlist
Optionally restrict a key to specific IPv4/IPv6 addresses or CIDR ranges, e.g. 203.0.113.0/24. Requests from other addresses are rejected with 403 forbidden.
Expiry and revocation
Keys can carry an expiry date at least one hour in the future; expired keys return 401. Revoking a key in the dashboard takes effect immediately. The dashboard also shows when and from where each key was last used.
Failed authentication
{
"error": {
"code": "unauthorized",
"message": "authentication required",
"details": {},
"request_id": "01a1cc77ecf374f9bdd7cf0b762e870d"
}
}