Campaigns
Broadcast a message to a segment across one channel, then track how it landed. Build campaigns in the app, or drive them through the API.
How a campaign works
A campaign pairs a segment with a channel and a template. You send a test to yourself, then launch; Messy queues one delivery per segment member, skips anyone who has opted out, and reports the results as they come in.
A campaign moves through draft → sending → sent (or failed if delivery errors out).
Create
Create a draft with POST /campaigns:
| Field | Type | Description |
|---|---|---|
namereq | string | Internal name for the campaign. |
channelreq | string | email, sms, whatsapp or push. |
segment_idreq | integer | The audience to send to. |
template_id | integer | Template to render (or provide content). |
subject | string | Email subject (email only). |
content | string | Inline content when not using a template. |
sending_identity_id | integer | From-identity for email. |
Test, then send
# send a test to one contact first
curl https://api.messy.sh/campaigns/123/send_test \
-H "Authorization: Bearer $MESSY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "customer_id": 456 }'
# then launch to the whole segment
curl -X POST https://api.messy.sh/campaigns/123/send_campaign \
-H "Authorization: Bearer $MESSY_API_KEY"Track results
Fetch per-recipient outcomes with GET /campaigns/{id}/deliveries. A campaign’s stats include counts of sent, failed, pending and rejected, plus open and click rates and the number of unsubscribes it generated. Re-send failures with POST /campaigns/{id}/retry_delivery or POST /campaigns/{id}/retry_all_failed.
For ongoing, triggered sequences rather than one-off broadcasts, use drip automation (built on the same segments and templates).