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.
| Field | Type | Description |
|---|---|---|
typereq | string | email, sms, whatsapp, mobile_push or web_push. |
toreq | string | Recipient email address or phone number. |
subject | string | Email subject (email only). |
bodyreq | string | Message body. HTML or text for email; text for other channels. |
cc / bcc | string | Additional email recipients, each evaluated by rules independently. |
sending_identity_id | integer | From-identity to send as (email). Falls back to the integration default. |
attachments | file[] | File attachments (multipart). |
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.
| Field | Type | Description |
|---|---|---|
triggerreq | string | The trigger name of the template to render. |
toreq | string | Recipient email or phone number. |
data | object | Key/value pairs injected into the template's Liquid variables. |
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" }
}'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.