Webhooks#

The webhooks enables receiving of real-time feedback of email events such as: sent, opened, clicked, bounced, marked as spam, unsubscribed, blocked, recipient delete, recipient profile update. This is done by defining an url on your domain that will be called on each email event.

Events#

List of events that can be received by webhooks:

Sent event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=sent&
timestamp=1366278365&
email=recipient_email@somedomain.com&
campaign_id=123&
campaign_name=x-sendmachine-campaign

Open event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=open&
timestamp=1366278365&
email=recipient_email@somedomain.com&
campaign_id=123&
campaign_name=x-sendmachine-campaign

Click event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=click&
timestamp=1366278365&
email=recipient_email@somedomain.com&
campaign_id=123&
campaign_name=x-sendmachine-campaign&
url=clicked_url

Bounce event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=bounce&
timestamp=1366278365&
email=recipient_email@somedomain.com&
sender=sender_email@somedomain.com&
subject=Email Subject&
campaign_id=123&
campaign_hash=CampaignHash&
campaign_name=CampaignName&
campaign_name=x-sendmachine-campaign&
hard_bounce=true|false&
bounce_category=bad-mailbox|other|message-expired|bad-configuration|bad-connection|bad-domain|content-related|inactive-mailbox|invalid-sender|no-answer-from-host|policy-related|protocol-errors|relaying-issues|routing-error|quota-issues|spam-related|virus-related

Spam event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=spam&
timestamp=1366278365&
email=recipient_email@somedomain.com&
campaign_id=123&
campaign_name=x-sendmachine-campaign&
cfl=provider

Unsubscribe event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=unsub&
timestamp=1366278365&
email=recipient_email@somedomain.com&
campaign_id=123&
list_id=5&
campaign_name=x-sendmachine-campaign

Block event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=block&
timestamp=1366278365&
email=recipient_email@somedomain.com&
campaign_id=123&
campaign_name=x-sendmachine-campaign

Recipient delete event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=recipient_delete&
timestamp=1366278365&
email=recipient_email@somedomain.com

Recipient profile update event#

Request:

POST http://yourdomain.com/hook
Content-Type: application/x-www-form-urlencoded

event=recipient_profile_update&
timestamp=1366278365&
email=recipient_email@somedomain.com
contactlist_hash=BD2F152D