How it works
Webhooks in MailGlyph are powered by the workflow system. The basic flow is:- An event occurs in MailGlyph (e.g. an email bounces, a contact subscribes, or a custom event is tracked)
- A workflow is triggered by that event
- The workflow executes a Webhook step, sending an HTTP request to your URL with relevant data
Internal events
MailGlyph automatically tracks a set of internal events that you can use as workflow triggers. These events cannot be manually tracked via the API — they are generated by the system.Email events
Contact events
Segment events
Segment events use a slugified version of the segment name. For example, a segment called “VIP Users” would produce the events
segment.vip-users.entry and segment.vip-users.exit.Setting up a webhook
1
Create the workflow
Navigate to the Workflows section in the dashboard and create a new workflow. Choose the event you want to listen for as the trigger. For example, to receive notifications when an email bounces, use
email.bounce as the trigger event.2
Add a Webhook step
After the trigger, add a Webhook step and configure it:
- URL: The endpoint on your server that will receive the webhook (e.g.
https://api.example.com/webhooks/mailglyph) - Method: The HTTP method to use. Defaults to
POST, which is recommended for most use cases. - Headers (optional): Custom headers to include in the request, provided as JSON. This is useful for authentication.
3
Enable the workflow
Once configured, enable the workflow. It will start sending webhook requests whenever the trigger event occurs.
Webhook payload
When using the default payload (no custom body configured), MailGlyph sends a JSON request with the following structure:event field contains the data associated with the event that triggered the workflow. The exact contents depend on the event type.
Event data by type
Email events
Most email events share a common set of base fields:
In addition to these base fields, each event includes event-specific fields:
email.sent
email.delivery
email.open
email.click
email.bounce
Permanent bounce:
email.complaint
email.received
This event fires when an email is received at your verified domain. See Receiving emails for setup instructions.
Contact events
contact.subscribed and contact.unsubscribed carry no event data by default. The event field will be an empty object {}.
The exception is when an unsubscription is triggered automatically by an email bounce or complaint. In that case event includes a reason field:
Segment events
Bothsegment.<name>.entry and segment.<name>.exit include:
Custom events
Custom events tracked via the API include whatever data you passed in thedata field when calling track.
No event data
For events that carry no data, theevent field will be an empty object {}.
Common use cases
Bounce and complaint monitoring
Create a workflow triggered byemail.bounce or email.complaint to forward these events to your application. This allows you to keep your own database in sync with MailGlyph’s contact statuses.
You can use additional workflow steps before the webhook to add logic:
- Condition: Only send the webhook for hard bounces by checking the
bounceTypefield - Delay: Add a short delay to batch-process related events
- Update Contact: Mark the contact with metadata before sending the webhook
Syncing unsubscribes
Trigger a workflow oncontact.unsubscribed to notify your application when a contact opts out. This is useful for keeping subscription status synchronized across multiple systems.
Custom event forwarding
If you track custom events in MailGlyph (e.g.user.signup, order.completed), you can forward those same events to other services via webhooks. This turns MailGlyph into an event router — track once, distribute to multiple endpoints.
Adding conditions and delays
Since webhooks are part of the workflow system, you can combine them with other step types for more advanced setups:- Use a Condition step to only fire the webhook when certain criteria are met (e.g. only notify for contacts on a specific plan)
- Use a Wait for Event step to wait for a follow-up event before sending the webhook (e.g. wait to see if a bounced contact re-subscribes)
- Use a Delay step to add a time buffer before the webhook fires

