{
"type": "message.unsubscribed",
"webhook_id": "abe11757-2886-4b55-96f1-0e0afc95795a",
"timestamp": "2024-05-06T10:25:16.687031577Z",
"data": {
"account_id": "4cdd7bdd-294e-4762-892f-83d40abf5a87",
"event": "on_unsubscribed",
"from": "Example News <news@example.com>",
"recipient": "recipient@example.com",
"subject": "Our October news",
"message_id_header": "<message-id-12345@localhost>",
"id": "019a0c3e-7c3e-7b2a-9d4e-5f6a7b8c9d0e",
"is_bot": false,
"unsubscribe": {
"method": "one_click"
},
"campaign_id": "8b0f4c2e-5d1a-4f6b-9c3e-2a7d1e9f0b44",
"list_id": "c3e1a9d2-7f4b-4e8a-b5c6-1d2e3f4a5b6c",
"segment_id": null
}
}Message Events
message.unsubscribed Webhook Event
The message.unsubscribed webhook fires when a recipient unsubscribes from an AhaSend campaign email through its link or one-click unsubscribe. Payload.
WEBHOOK
message.unsubscribed
{
"type": "message.unsubscribed",
"webhook_id": "abe11757-2886-4b55-96f1-0e0afc95795a",
"timestamp": "2024-05-06T10:25:16.687031577Z",
"data": {
"account_id": "4cdd7bdd-294e-4762-892f-83d40abf5a87",
"event": "on_unsubscribed",
"from": "Example News <news@example.com>",
"recipient": "recipient@example.com",
"subject": "Our October news",
"message_id_header": "<message-id-12345@localhost>",
"id": "019a0c3e-7c3e-7b2a-9d4e-5f6a7b8c9d0e",
"is_bot": false,
"unsubscribe": {
"method": "one_click"
},
"campaign_id": "8b0f4c2e-5d1a-4f6b-9c3e-2a7d1e9f0b44",
"list_id": "c3e1a9d2-7f4b-4e8a-b5c6-1d2e3f4a5b6c",
"segment_id": null
}
}AhaSend sends this event when the recipient unsubscribes through the unsubscribe link of your campaign email, or through the one-click unsubscribe of their email client (RFC 8058). This event is sent for campaign email only.
data.unsubscribe.method is one_click for a one-click unsubscribe, and link for any other unsubscribe request, for example through the link. data.campaign_id, data.list_id and data.segment_id say which campaign sent the email and how it reached the recipient.
Repeats: AhaSend sends this event for every unsubscribe request that it accepts for the message, also when the recipient is already unsubscribed, and again when the recipient uses the same link a second time. It sends at most one event per message in each 10-minute period. Drop the repeats by type and data.id. The contact events of the same request are sent only when the request changes something, and they are not limited this way, so a contact event can arrive without a message.unsubscribed of its own.
Setting: on_unsubscribed (Message Unsubscribed in the dashboard).
When it’s sent: When AhaSend accepts an unsubscribe request for the message.
Related Guides
- API authentication, Permission scopes, Webhook setup.
- Event reference, Webhook CLI, Local webhook testing.
- Signature verification, Retry policy, API errors.
- API rate limits, Unsubscribe links, Contacts API.
Body
application/json
The webhook ID (the same ID as returned by the Create Webhook API)
Response
Webhook received successfully

