Actions
| Field | Type | Notes |
|---|---|---|
POST /reactions | { emoji } | Set this number's reaction; an empty emoji removes it. |
POST /read | — | Blue ticks for a received message. Idempotent. |
PATCH | { body, context } | Edit a text message within 15 minutes, its context any time. |
POST /revoke | — | Delete 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.
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.

Correct what the AI answers from
Editing the text changes what the customer sees, not the context automatic AI replies answer from. When a correction matters to the AI — a new gate, a new time — send context in the same edit. A context-only edit has no time limit and does not reach WhatsApp, and it also updates AI replies that had already carried the old context forward, so a follow-up question gets the new answer.
curl -X PATCH https://www.chatrail.dev/v1/messages/$MESSAGE_ID \
-H "Authorization: Bearer $CHATRAIL_API_KEY" -H "Content-Type: application/json" \
-d '{
"body": "SK 330 boards from gate B14 at 13:05.",
"context": { "booking": { "flight": "SK330", "gate": "B14" } }
}'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.