Skip to main content
When you configure a webhook URL, Ecomail sends HTTP POST requests with JSON payloads for each email event in real time.

Delivery

Each batch is sent as a POST request with Content-Type: application/json. Ecomail retries delivery for up to 8 hours if your endpoint does not respond with a 2xx status code. Each request has a 10-second timeout. Each batch includes the header X-MessageSystems-Batch-ID which can be used for deduplication.

Payload structure

Every webhook payload is an array of event objects wrapped in the following structure:
[
  {
    "msys": {
      "message_event": {
        "type": "delivery",
        "timestamp": "1716300000",
        ...
      }
    }
  }
]

Ecomail metadata

Every email sent through Ecomail includes the following custom metadata in the rcpt_meta field:
FieldTypeDescription
campaign_idstringID of the campaign this email belongs to (bulk campaigns only).
pipeline_idstringID of the automation pipeline (automation emails only).
pipeline_action_idstringID of the specific action within the automation pipeline.
subaccountstringYour Ecomail account name.
Example rcpt_meta in a payload:
{
  "msys": {
    "message_event": {
      "type": "delivery",
      "rcpt_meta": {
        "campaign_id": "123",
        "pipeline_id": "45",
        "pipeline_action_id": "67",
        "subaccount": "my-account"
      },
      ...
    }
  }
}

Event types

Delivery

Sent when a message is successfully delivered to the recipient’s mail server.
FieldTypeDescription
typestringdelivery
timestampstringUnix timestamp of the event.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
friendly_fromstringFriendly from address.
subjectstringEmail subject line.
sending_ipstringIP address used for sending.
sending_domainstringSender domain.
recipient_domainstringRecipient domain portion.
msg_sizestringMessage size in bytes.
rcpt_metaobjectCustom metadata (see above).
rcpt_tagsarrayTags applied to the recipient.
delv_methodstringDelivery protocol (e.g. esmtp).
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.
customer_idstringCustomer identifier.

Bounce

Sent when a message is permanently rejected by the remote mail server.
FieldTypeDescription
typestringbounce
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
bounce_classstringBounce classification code.
error_codestringRemote server error code.
raw_reasonstringExact response from the remote server.
reasonstringCanonicalized bounce reason.
num_retriesstringNumber of delivery attempts before bounce.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Spam complaint

Sent when a recipient marks the email as spam.
FieldTypeDescription
typestringspam_complaint
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
friendly_fromstringFriendly from address.
subjectstringEmail subject line.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Open

Sent when a recipient opens an email (tracked via pixel).
FieldTypeDescription
typestringopen
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
geo_ipobjectGeographic info: country, region, city, latitude, longitude.
ip_addressstringIP address of the opener.
user_agentstringBrowser/client user agent string.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Initial open

Sent only for the first open of a message (subsequent opens fire the open event). Fields are identical to the Open event with type set to initial_open.

Click

Sent when a recipient clicks a tracked link in the email.
FieldTypeDescription
typestringclick
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
target_link_urlstringThe URL that was clicked.
target_link_namestringLink identifier/name.
geo_ipobjectGeographic info: country, region, city, latitude, longitude.
ip_addressstringIP address of the clicker.
user_agentstringBrowser/client user agent string.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Injection

Sent when a message is received by Ecomail for delivery.
FieldTypeDescription
typestringinjection
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
msg_fromstringEnvelope sender address.
msg_sizestringMessage size in bytes.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Delay

Sent when a message delivery is temporarily delayed.
FieldTypeDescription
typestringdelay
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
error_codestringRemote server error code.
raw_reasonstringExact response from the remote server.
reasonstringCanonicalized delay reason.
num_retriesstringNumber of delivery attempts so far.
queue_timestringTime spent in queue (ms).
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Out of band bounce

Sent when an asynchronous bounce occurs after initial acceptance.
FieldTypeDescription
typestringout_of_band
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
bounce_classstringBounce classification code.
error_codestringRemote server error code.
raw_reasonstringExact response from the remote server.
reasonstringCanonicalized bounce reason.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.

Policy rejection

Sent when a message is rejected due to policy rules.
FieldTypeDescription
typestringpolicy_rejection
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
error_codestringError code.
reasonstringRejection reason.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.

List unsubscribe

Sent when a recipient unsubscribes via the List-Unsubscribe email header.
FieldTypeDescription
typestringlist_unsubscribe
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Sent when a recipient unsubscribes by clicking an unsubscribe link in the email body.
FieldTypeDescription
typestringlink_unsubscribe
timestampstringUnix timestamp.
event_idstringUnique event identifier.
message_idstringUnique message identifier.
rcpt_tostringRecipient email address.
rcpt_metaobjectCustom metadata.
campaign_idstringCampaign identifier.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Generation failure

Sent when email generation (template rendering) fails.
FieldTypeDescription
typestringgeneration_failure
timestampstringUnix timestamp.
event_idstringUnique event identifier.
rcpt_tostringRecipient email address.
error_codestringError code.
reasonstringFailure reason.
rcpt_metaobjectCustom metadata.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.

Generation rejection

Sent when email generation is rejected due to policy.
FieldTypeDescription
typestringgeneration_rejection
timestampstringUnix timestamp.
event_idstringUnique event identifier.
rcpt_tostringRecipient email address.
error_codestringError code.
reasonstringRejection reason.
rcpt_metaobjectCustom metadata.
template_idstringTemplate identifier.
transmission_idstringTransmission identifier.