Send a message

One endpoint, every channel. Send raw content directly, or render a saved template with the trigger endpoint.

Direct send

POST /messages sends content you provide inline. Set type to the channel; the other fields follow the channel.

FieldTypeDescription
typereqstringemail, sms, whatsapp, mobile_push or web_push.
toreqstringRecipient email address or phone number.
subjectstringEmail subject (email only).
bodyreqstringMessage body. HTML or text for email; text for other channels.
cc / bccstringAdditional email recipients, each evaluated by rules independently.
sending_identity_idintegerFrom-identity to send as (email). Falls back to the integration default.
attachmentsfile[]File attachments (multipart).
sms.sh
curl https://api.messy.sh/messages \
  -H "Authorization: Bearer $MESSY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "type": "sms", "to": "+15551234567", "body": "Your code is 481920" }'

Templated send

POST /messages/trigger renders a saved template by its trigger name, substituting the values you pass in data with Liquid. The template decides the channel, subject and body, so you keep copy out of your code.

FieldTypeDescription
triggerreqstringThe trigger name of the template to render.
toreqstringRecipient email or phone number.
dataobjectKey/value pairs injected into the template's Liquid variables.
trigger.sh
curl https://api.messy.sh/messages/trigger \
  -H "Authorization: Bearer $MESSY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "trigger": "order_confirmed",
    "to": "ada@example.com",
    "data": { "order_number": "1024", "total": "€42.00" }
  }'
A real per-message unsubscribe_url is generated and made available to your templates automatically, so you never have to build one.

Statuses

A message moves through these states: pending (queued), sent / delivered (success), failed (provider error), rejected (blocked by a rule), suppressed (recipient unsubscribed) and expired.

Listing & retrying

GET /messages supports channel, status, search, date_from, date_to and pagination (page, per_page). Re-send a failed delivery with POST /messages/{id}/retry_delivery.