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:

Ecomail metadata

Every email sent through Ecomail includes the following custom metadata in the rcpt_meta field: Example rcpt_meta in a payload:

Event types

Delivery

Sent when a message is successfully delivered to the recipient’s mail server.

Bounce

Sent when a message is permanently rejected by the remote mail server.

Spam complaint

Sent when a recipient marks the email as spam.

Open

Sent when a recipient opens an email (tracked via pixel).

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.

Injection

Sent when a message is received by Ecomail for delivery.

Delay

Sent when a message delivery is temporarily delayed.

Out of band bounce

Sent when an asynchronous bounce occurs after initial acceptance.

Policy rejection

Sent when a message is rejected due to policy rules.

List unsubscribe

Sent when a recipient unsubscribes via the List-Unsubscribe email header.
Sent when a recipient unsubscribes by clicking an unsubscribe link in the email body.

Generation failure

Sent when email generation (template rendering) fails.

Generation rejection

Sent when email generation is rejected due to policy.