REST API

REST API reference

Pairing, send, history, MCP credentials and tenant flows. Interactive docs at /docs.

Public endpoints

MethodPathAuthDescription
GET/health—Liveness
GET/connect—Pairing UI (QR / code + MCP copy)
POST/api/session/connect/kitTenantQR + code + image (best for agents)
POST/api/session/connect/codeTenant8-digit pairing code
GET/api/session/connect/statusTenant / API keyPoll pairing; returns MCP on success
POST/api/sendwbot_...Send text or media
GET/api/historywbot_...Message history with filters
GET/api/mcp/connectionwbot_...MCP config block
POST/mcpmcp_...MCP Streamable HTTP transport

Data & write operations — full MCP parity

Every MCP tool has a REST equivalent under /api/*, authenticated with the wbot_ API key. Build WhatsApp-Web-style clients, dashboards, and enterprise tools directly over HTTP. All calls are tenant-scoped and audited. See /docs for parameters and schemas.

MethodPathDescriptionMCP tool
GET/api/messagesList stored messages (filters, cursor)whatsapp_list_messages
GET/api/messages/searchFull-text searchwhatsapp_search_messages
POST/api/send/replyQuoted replywhatsapp_reply_to_message
POST/api/send/typingTyping indicatorwhatsapp_send_typing
POST/api/messages/reactionReact with emojiwhatsapp_send_reaction
POST/api/messages/editEdit a sent messagewhatsapp_edit_message
POST/api/messages/deleteRevoke a sent messagewhatsapp_delete_message
POST/api/messages/forwardForward to same/other chat—
POST/api/messages/scheduleSchedule future deliverywhatsapp_schedule_message
GET/api/messages/mediaMedia URL or download byteswhatsapp_download_media
GET/api/chatsList conversationswhatsapp_list_chats
GET/api/chats/detailOne chat summarywhatsapp_get_chat
GET/api/chats/interactedWindowed activity digest (+ needs_reply)whatsapp_list_interacted_chats
POST/api/chats/readMark chat readwhatsapp_mark_chat_read
GET/api/chats/statsPer-chat statisticswhatsapp_get_chat_stats
GET/api/contactsList contactswhatsapp_list_contacts
GET/api/contacts/resolveResolve to JIDwhatsapp_resolve_recipient
GET/api/contacts/checkCheck WhatsApp registrationwhatsapp_check_number
GET/api/groupsList groupswhatsapp_list_groups
GET/api/groups/membersGroup memberswhatsapp_get_group_members
POST/api/groups/createCreate groupwhatsapp_create_group
POST/api/groups/participantsAdd/remove/promote/demotewhatsapp_update_group_participants
GET/api/groups/inviteInvite link (reset optional)whatsapp_get_group_invite_link
GET/api/groups/subject-historyRename historywhatsapp_get_group_subject_history
GET/api/notificationsList notificationswhatsapp_list_notifications
GET/api/notifications/streamSSE push streamwhatsapp_watch_notifications
POST/api/notifications/readMark one readwhatsapp_mark_notification_read
POST/api/notifications/cleanupBulk mark-read/delete by filterwhatsapp_cleanup_notifications
GET/api/session/syncSync statuswhatsapp_get_sync_status
GET/api/session/wait-syncBlock until syncedwhatsapp_wait_for_sync
GET/api/stats/overviewCross-chat analyticswhatsapp_get_overview_stats
GET/api/auditTool audit logwhatsapp_get_audit_log

Connect kit flow

# Start
curl -X POST https://zap.zaptdev.com/api/session/connect/kit \
  -H "X-Tenant-Key: tnt_..." \
  -H "Content-Type: application/json" \
  -d '{"phone_number":"5511999999999"}'

# Poll (every 3s)
curl "https://zap.zaptdev.com/api/session/connect/status?uuid=UUID" \
  -H "X-Tenant-Key: tnt_..."

# Optional QR image
curl "https://zap.zaptdev.com/api/session/connect/kit-image?uuid=UUID" \
  -H "X-Tenant-Key: tnt_..." -o kit.png

Send message

curl -X POST https://zap.zaptdev.com/api/send \
  -H "X-API-Key: wbot_..." \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": "5511888888888@s.whatsapp.net",
    "content": "Hello from REST API"
  }'

# With media
curl -X POST https://zap.zaptdev.com/api/send \
  -H "X-API-Key: wbot_..." \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": "5511888888888@s.whatsapp.net",
    "content": "See attached",
    "media_url": "https://example.com/doc.pdf",
    "media_type": "document"
  }'

History query

curl "https://zap.zaptdev.com/api/history?limit=25&chat_jid=5511999999999@s.whatsapp.net" \
  -H "X-API-Key: wbot_..."

SaaS tenant provisioning (before numbers)

Create a tenant, put WAMCP_TENANT_ID and WAMCP_TENANT_KEY in your app .env, then connect numbers with that key.

# Public self-service (rate-limited)
curl -X POST https://zap.zaptdev.com/api/tenants \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme Corp WhatsApp","slug":"acme"}'
# Save id + tenant_key (tnt_...) — shown once

# Add a WhatsApp number under that tenant
curl -X POST https://zap.zaptdev.com/api/session/connect/kit \
  -H "X-Tenant-Key: $WAMCP_TENANT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone_number":"5511999999999"}'

# Or UI: https://zap.zaptdev.com/connect (step 1 create tenant, step 2 link number)

# Platform admin (optional)
curl -X POST https://zap.zaptdev.com/api/admin/tenants \
  -H "X-Admin-Token: $ADMIN_MASTER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"slug":"acme","name":"Acme Corp WhatsApp"}'

HTTP status codes

  • 401 — Missing or invalid tenant key, API key, or MCP token.
  • 403 — Connect UUID belongs to another tenant.
  • 408 — Pairing code not ready yet; keep polling.
  • 409 — WhatsApp offline; reconnect or re-pair.