Skip to content

REST API ​

Base URL https://your-host/api/v1. The interactive reference (Swagger UI) is at /api/docs once you're signed in; the raw OpenAPI 3.1 document is at /api/v1/openapi.json.

Authentication ​

Create keys under API Credentials with a name, scopes, accounts, outbound policy and optional expiry. The full key is shown once and stored only as a hash.

Authorization: Bearer cwk_xxxxxxxx_…

Conventions ​

  • Success: { "data": …, "meta": { "pagination": { "total", "limit", "offset", "has_more" } } }
  • Errors: { "error": { "code", "message", "details" } }
  • Chats accept the internal ID or the WhatsApp chat ID (447700900123@c.us, …@g.us).
  • Idempotency-Key on outbound requests: the same key and body replays the stored response and never sends twice.
  • Rate limited per key (Settings → API rate limit).

Sending ​

HTTPdata.statusMeaning
200sentAccepted by WhatsApp
202pending_approvalNot sent — awaiting dashboard approval
409ambiguous_recipientNot sent — see error.details.candidates
422not_on_whatsappNumber not on WhatsApp
503unavailableAccount not connected
502delivery_uncertainCheck the chat before retrying

Endpoints ​

AreaEndpoints
AccountsGET/POST /accounts, GET/PATCH/DELETE /accounts/:id, GET /accounts/:id/status, POST /accounts/:id/{connect,disconnect,restart,logout,reauthenticate}
ConversationsGET /accounts/:id/chats, …/chats/unread, …/chats/:chatId, …/chats/:chatId/messages, POST …/chats/:chatId/read, POST …/chats/:chatId/backfill, GET /accounts/:id/messages/search, GET /chats, GET /messages/search, GET /messages/recent
ContactsGET /accounts/:id/contacts, …/contacts/search, …/contacts/:contactId, …/contacts/check, PUT …/tags, POST …/notes
MessagingPOST /accounts/:id/messages/{send,reply,media,react}, POST /accounts/:id/attachments, GET /media/:id, POST /media/:id/fetch
SchedulingGET/POST /scheduled-messages, GET/PATCH/DELETE /scheduled-messages/:id
GroupsGET /accounts/:id/groups, …/groups/:chatId/participants
SystemGET /health, GET /system/status

Examples ​

bash
curl -s https://your-host/api/v1/accounts -H "Authorization: Bearer $KEY"

curl -s -X POST https://your-host/api/v1/accounts/$ACC/messages/send \
  -H "Authorization: Bearer $KEY" -H "Idempotency-Key: invoice-1042" -H 'content-type: application/json' \
  -d '{"phone_number":"+44 7700 900123","text":"Your invoice INV-1042 is due tomorrow."}'

curl -s -X POST https://your-host/api/v1/accounts/$ACC/messages/media \
  -H "Authorization: Bearer $KEY" -F chat_id=447700900123@c.us -F caption="Invoice" -F file=@INV-1042.pdf

curl -s -X POST https://your-host/api/v1/scheduled-messages \
  -H "Authorization: Bearer $KEY" -H 'content-type: application/json' \
  -d '{"account_id":"'$ACC'","phone_number":"+27821234567","text":"Payment reminder","scheduled_at":"2026-12-01T09:00","timezone":"Africa/Johannesburg"}'

Released under the AGPL-3.0 licence. Not affiliated with WhatsApp or Meta.