subscribedEvents (or "*" for all). Every delivery also carries X-Gork-Event with the event name, so one endpoint can route on the header.
email.received
A new inbound email arrived, was parsed, sanitized, and stored. This is the event that wakes your agent.agent is null when the inbox has no agent attached. sender.kind is human, agent, or automated — classified from automation headers (Auto-Submitted, X-Autoreply, Precedence) and out-of-office subject patterns, with the supporting evidence included. Branch on it: an automated sender is usually an out-of-office reply, not a human waiting for an answer.
email.sent
An outbound send throughPOST /v1/messages/send was accepted by the provider.
email.bounced
The recipient mail server rejected the message.reason is hard_bounce (permanent — the address is automatically suppressed) or soft_bounce (transient — the message status is updated but the address is not suppressed). messageId is the Gork message id when the bounce could be matched to a sent message, otherwise null.
email.complained
A recipient flagged the message as spam via a feedback loop. The address is automatically suppressed — stop mailing it.email.unsubscribed
A recipient completed one-click unsubscribe. The address is suppressed with reasonunsubscribed — remove it from future campaigns.
Deliveries are at-least-once: a crash between the customer POST and bookkeeping can redeliver the same attempt. Dedupe on
X-Gork-Delivery, which is stable per delivery attempt.