Authentication
The Nabbih API uses Bearer tokens (Laravel Sanctum). Create a key in the dashboard under Settings → API, choosing a name and abilities. The full key is shown exactly once after creation — store it somewhere safe.
Using the key
Send it in the Authorization header with the Bearer type:
curl
curl -X POST "https://nabbih.com/api/v1/whatsapp/messages/send-template"
-H "Authorization: Bearer {YOUR_API_KEY}"
-H "Content-Type: application/json"
Abilities
Each key carries abilities that determine what it can do:
| Ability | Description |
|---|---|
| whatsapp:consent:write | Register customer WhatsApp opt-in evidence |
| whatsapp:send | Send WhatsApp messages (templates and text) and query message status. |
| whatsapp:templates:read | List the business's WhatsApp templates. |
Managing keys
- Create a separate key for each system or integration.
- Revoke any suspicious key immediately — revocation stops every request using it, instantly.
- Never ship a key in frontend code or mobile apps.
Auth errors
A missing or revoked key returns:
401 unauthorized
{
"error": {
"code": "unauthenticated",
"message": "Unauthenticated."
}
}