Whapick
LoginSign Up

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

OpenAPI specCreate an API key

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

ScopeGrants
broadcasts:sendCreate, schedule and cancel broadcasts
broadcasts:readList broadcasts and poll their status
templates:readList templates (with status) and their variables
account:readRead plan, credit and limit information
templates:writeCreate 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: source is phones or groups. 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 externalId returns 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, or ONE_TAP/ZERO_TAP with supportedApps).
  • Sending an OTP: send the authentication template through POST /api/v1/broadcasts with variables: { "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

MethodPathDescription
POST/api/v1/broadcastsCreate and enqueue (or schedule) a broadcast
GET/api/v1/broadcastsList your broadcasts
GET/api/v1/broadcasts/:idPoll a broadcast status
POST/api/v1/broadcasts/:id/cancelCancel a scheduled/queued broadcast
GET/api/v1/templatesList templates (all statuses); ?source=meta reads Meta directly
GET/api/v1/templates/:idGet one template
POST/api/v1/templatesCreate a template (utility, marketing, authentication)
GET/api/v1/mePlan, credits and limits
GET/api/v1/openapi.jsonOpenAPI 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 2xx once handled. GET /broadcasts/:id stays available if an event is missed.
  • Test: use Send test event under Settings -> API.

8. Errors

StatusMeaning
400Validation error
401Key missing, invalid, revoked or expired
402insufficient_credits
403missing_scope, template not approved, payment_method_required
404Unknown resource (or not yours)
413Recipient list over the plan cap
429Rate limited