API referenceEvents

A mail sent through POST /emails has left: mail_sent, origin: api, tracking_id as the send answered. The engine knows only the envelope: the body and subject are empty. gateway.provider_message_id is the server's own Message-ID when it rewrote it (Gmail API, Graph).

Header Parameters

X-LG-Signature*string

base64url(HMAC-SHA256(raw body, your webhook's signing secret)), the secret being the whsec_… shown in the console. Verify it over the raw bytes before parsing, and refuse the event when it does not match.

X-LG-Event-Id*string

The event id, also event_id in the body: the same on every retry of the event. Deduplicate on it.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A mail event (email_id, not id), plus gateway: { references, headers (lower-case name → values), is_auto_reply, is_bounce, special_use } (and on mail_sent: queue_id, provider_message_id).

Response Body

Example Requests

A mail event (email_id, not id), plus gateway: { references, headers (lower-case name → values), is_auto_reply, is_bounce, special_use } (and on mail_sent: queue_id, provider_message_id).

POST/EmailMailSent