Quickstart
Send your first WhatsApp message through Nabbih in four steps.
1. Connect your official WhatsApp account
In the dashboard: Settings → Platforms → Official WhatsApp. Your account must be connected with an active number and at least one approved template.
2. Create an API key
Under Settings → API,
create a key with a clear name and the whatsapp:send and whatsapp:consent:write ability, then copy it.
3. Register the customer’s WhatsApp opt-in
Before starting a conversation, record the customer’s actual WhatsApp opt-in using the consent endpoint. A template’s approval does not establish recipient consent. Keep your API key on your server.
4. Send a template message
API_KEY="your-api-key-here"
TEMPLATE_ID=42
curl -X POST "https://nabbih.com/api/v1/whatsapp/messages/send-template" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1001-welcome" \
-d "{
\"to\": \"+966500000000\",
\"template_id\": $TEMPLATE_ID,
\"parameters\": [\"Ahmed\", \"NB1001\"]
}"
A successful response looks like:
{
"data": {
"message_id": 1024,
"attempt_id": 512,
"status": "pending",
"created": true
}
}
The message is queued and delivered through Nabbih's pipeline with automatic retries.
Track it via Message status
using the message_id.
Idempotency-Key
Sending the same key with the same request body returns the original request instead of sending a duplicate —
always use one for operations like order confirmations so retries are safe.
Reusing a key with a different body returns idempotency_conflict.