Messaging

React, mark read, edit and delete WhatsApp messages over the API

Four actions on a message that has already reached WhatsApp, and three webhooks for when someone else acts on one.

Actions

FieldTypeNotes
POST /reactions{ emoji }Set this number's reaction; an empty emoji removes it.
POST /readBlue ticks for a received message. Idempotent.
PATCH{ body }Edit a text message this number sent, within 15 minutes.
POST /revokeDelete a message this number sent, for everyone, within about 2.5 days.

All four live under /v1/messages/{id} and return the updated message. Each is refused before WhatsApp is contacted when it would not apply — a received message cannot be edited, a deleted one cannot be reacted to, a window that has passed has passed. Edits keep the first text and, like deletions, are written to the audit log.

React to a customer's message
curl -X POST https://www.chatrail.dev/v1/messages/$MESSAGE_ID/reactions \
  -H "Authorization: Bearer $CHATRAIL_API_KEY" -H "Content-Type: application/json" \
  -d '{ "emoji": "👍" }'

Only text messages can be edited. The caption on an image, video or document cannot be changed after sending.

When the other side does it

message.reaction carries by, emoji and removed; reactions are also kept on the message, one per person. message.edited carries the new body, and the message keeps its original text. message.revoked marks the message deleted. Subscribe to them like any event, or to message.*.

Typing, before you answer

POST /v1/connections/{connection}/presence with { "to": "+447700900123", "state": "typing" } shows the typing indicator. Automatic AI replies do this for you: with the AI policy's humanize on (the default) the question is marked read and typing shows briefly before the answer arrives.

Related documentation

API reference · Webhook events · WhatsApp API · Security

BUILD IT

Wire it against the real schemas.

Every shape on this page is the one the endpoint validates. Verify it in your own stack before production rollout.

Start free