API reference 2 min read
Two-way chat API
Read conversations, reply with context and send read receipts.
On this page
GET /api/platform/messages
API key required. Returns messages from the entire key workspace, including messages owned by other members. Newest first, ordered by timestamp and ID. Query: recipient (10–15 international digits without +), sender (5–32 digits, Meta phone number ID), limit (1–100, default 50), cursor (opaque message record ID). x-whatsapp-sender is an alternative to the sender query parameter. Use both sender and recipient for one conversation; omit both for the workspace inbox feed.
History response
{"messages":[{"id":"record-id","messageId":"wamid.example","from":"919876543210","to":"123456789012345","type":"text","content":{"text":"Hello","direction":"inbound"},"status":"received","timestamp":"2026-11-25T09:00:00.000Z","direction":"inbound"}],"pagination":{"hasNext":false,"nextCursor":null}}Continue pagination
Pass nextCursor unchanged with the same filters until hasNext is false. Encrypted recipient/sender filtering has a scan budget: a page can be empty while hasNext is true. Continue with its cursor. A deleted or foreign-workspace cursor returns 400 INVALID_CURSOR. Treat cursors as opaque. To refresh live messages, start from the first page and deduplicate by messageId; use webhooks for timely updates.
POST /api/platform/messages/text
Required JSON: to (10–15 digits), body (nonblank text, at most 4096 characters). Optional replyToMessageId is the WhatsApp messageId, not the database id. The referenced message must belong to the same workspace, recipient and sender. Its business sender is inferred; a conflicting x-whatsapp-sender returns 409 REPLY_CONTEXT_MISMATCH. The outgoing Meta payload includes context.message_id so WhatsApp displays the quoted reply. Consent, billing, quotas and the customer service window still apply.
POST /api/platform/messages/read
API key required. JSON: {"messageIds":["wamid.inbound-example"]}. Accepts 1–50 distinct IDs. Only unread inbound messages from this workspace are eligible. Each receipt uses that message’s connected business sender. Returns {"marked":1,"failed":0,"skipped":0}. Unknown, already-read and other-workspace IDs are skipped. Partial provider failures are reported in failed; if every attempted receipt fails, HTTP 502 is returned. Repeating a successful receipt request skips the already-read message. This endpoint does not send a chat message or consume send credits.
Live delivery and media
Use signed message.inbound events for incoming text, interactive and media messages, plus message.sent, message.delivered, message.read and message.failed for outbound state. Event data.object.message contains messageId, from, to, type, content, status and timestamp for inbound messages. This API currently sends text and approved templates; it does not offer public media upload/download or a browser websocket authenticated by API key. Do not expose Meta credentials to clients. The authenticated dashboard inbox remains available for operators.
Need help with this guide? Contact support