Developers
Whapick Public API
Send approved WhatsApp template messages from your own systems — no dashboard login required. Bearer-authenticated, business-scoped and asynchronous. Bulk/template sends are charged 1 AI credit per dispatched message from your shared AI-credit pool.
Base URL https://whapick.com/api/v1
1. Authenticate
Create a key under Settings -> API (shown once). Send it as a bearer token. Every key is bound to one business — the account is always taken from the key, never the body.
Authorization: Bearer wh_live_<prefix>_<secret>
A test key validates the full path but never dispatches or charges.
2. Scopes
| Scope | Grants |
|---|---|
| broadcasts:send | Create, schedule and cancel broadcasts |
| broadcasts:read | List broadcasts and poll their status |
| templates:read | List templates (with status) and their variables |
| account:read | Read plan, credit and limit information |
| templates:write | Create utility, marketing and authentication templates |
3. Send a broadcast
POST /api/v1/broadcasts
curl -X POST https://whapick.com/api/v1/broadcasts \
-H "Authorization: Bearer $WHAPICK_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "665f1c2ab3e4d5f6a7b8c9d0",
"recipient": { "source": "groups", "groupIds": ["665f1c2ab3e4d5f6a7b8c9d1"] },
"variables": { "1": "Ada", "2": "20% off" },
"externalId": "order-4821"
}'{
"broadcastId": "665f1c2ab3e4d5f6a7b8c9d2",
"status": "QUEUED",
"totalRecipients": 412,
"creditsReserved": 412,
"scheduledFor": null
}- Recipients:
sourceisphonesorgroups. Numbers are normalised and de-duplicated. - Variables: positional map, e.g.
{ "1": "Ada" }. - Scheduling: pass
scheduledFor(ISO-8601) to hold the send. - Idempotency: replaying the same
externalIdreturns the original broadcast (HTTP 200) instead of sending twice.
4. Templates
POST /api/v1/templates creates a template with the key's business (scope templates:write). It starts PENDING; once Meta approves it, GET /api/v1/templates lists it and a broadcast can send it.
A template created outside this API (for example in Meta Business Manager) is not in our records, so GET /api/v1/templates will not show it. Add ?source=meta to read the WhatsApp Business Account's own list and recover its id.
curl -X POST https://whapick.com/api/v1/templates \
-H "Authorization: Bearer $WHAPICK_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "otp_login",
"category": "AUTHENTICATION",
"language": "en_US",
"auth": { "otpType": "COPY_CODE", "codeExpirationMinutes": 10, "addSecurityRecommendation": true }
}'- Authentication templates: Meta fixes the body; you choose the button (
COPY_CODE, orONE_TAP/ZERO_TAPwithsupportedApps). - Sending an OTP: send the authentication template through
POST /api/v1/broadcastswithvariables: { "code": "482913" }— one recipient or many; the worker puts the code in the body and the button. - Test keys: cannot create templates (a real Meta review action); use a live key.
5. Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/broadcasts | Create and enqueue (or schedule) a broadcast |
| GET | /api/v1/broadcasts | List your broadcasts |
| GET | /api/v1/broadcasts/:id | Poll a broadcast status |
| POST | /api/v1/broadcasts/:id/cancel | Cancel a scheduled/queued broadcast |
| GET | /api/v1/templates | List templates (all statuses); ?source=meta reads Meta directly |
| GET | /api/v1/templates/:id | Get one template |
| POST | /api/v1/templates | Create a template (utility, marketing, authentication) |
| GET | /api/v1/me | Plan, credits and limits |
| GET | /api/v1/openapi.json | OpenAPI 3.1 spec (public) |
6. Credits & billing
Bulk sends charge 1 AI credit per dispatched message from the same pool as your chatbot usage. Credits are reserved up front for the whole list, then reconciled on completion: dispatched messages are charged, recipients skipped before any attempt are refunded. remaining = allowance - used - reserved. A send that does not fit is refused with 402 insufficient_credits, and bulk sends require a billing method on file. These credits are our platform fee only — Meta also charges your WhatsApp account for each template message, with no free allowance, and will not deliver them unless a payment method is attached to that account.
7. Webhooks
Configure an endpoint under Settings -> API. We POST a signed event when a broadcast completes or fails, so your system can react without polling.
- Headers:
X-Whapick-Signature(sha256=<hex>),X-Whapick-Event(broadcast.completed/broadcast.failed),X-Whapick-Delivery(a stable id for de-duplication). - Signature: HMAC-SHA256 of the raw body, keyed by your signing secret. Verify the raw bytes — re-serialising changes them.
- Payload:
event,broadcastId,externalId,status,totalRecipients,sent,failed,creditsCharged,completedAt. - Retries: delivery is retried with backoff; answer
2xxonce handled.GET /broadcasts/:idstays available if an event is missed. - Test: use Send test event under Settings -> API.
8. Errors
| Status | Meaning |
|---|---|
| 400 | Validation error |
| 401 | Key missing, invalid, revoked or expired |
| 402 | insufficient_credits |
| 403 | missing_scope, template not approved, payment_method_required |
| 404 | Unknown resource (or not yours) |
| 413 | Recipient list over the plan cap |
| 429 | Rate limited |