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 draftsendingsent (or failed if delivery errors out).

Create

Create a draft with POST /campaigns:

FieldTypeDescription
namereqstringInternal name for the campaign.
channelreqstringemail, sms, whatsapp or push.
segment_idreqintegerThe audience to send to.
template_idintegerTemplate to render (or provide content).
subjectstringEmail subject (email only).
contentstringInline content when not using a template.
sending_identity_idintegerFrom-identity for email.

Test, then send

campaign.sh
# 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"
Email campaigns must include an unsubscribe link, and Messy adds a real per-recipient one for you. Contacts who have opted out of the relevant channel or the marketing category are skipped automatically; see consent.

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).