Skip to main content

Overview

Use webhooks when your integration needs to react to Migma activity without polling. Migma creates an event, finds active webhook subscriptions for that event type, and sends an HTTPS POST request to your endpoint. Common uses:
  • Continue an automation when API email generation finishes
  • Sync contact changes into a CRM or data warehouse
  • Alert a team when generation fails
  • Track unsubscribe activity outside Migma
Webhooks are outbound notifications from Migma to your system. They are not an inbound custom-events API.
Most webhook events are emitted by API v1 activity. subscriber.unsubscribed also fires from real unsubscribe paths, including one-click unsubscribe, mailto unsubscribe, and dashboard status changes.

Set up a webhook

1

Create an HTTPS endpoint

Your endpoint must accept POST requests and return a 2xx status when the event is accepted.
2

Create the webhook in Migma

In the dashboard, go to Settings -> Developers -> Webhooks, add your endpoint URL, and choose the events to receive.You can also create a webhook through the API:
3

Store the signing secret

POST /v1/webhooks returns the signing secret once, in the create response. Store it securely.GET /v1/webhooks/{webhookId} only returns secretConfigured; it does not return the secret again. To rotate a secret, delete and recreate the webhook.
4

Send a test event

Use the dashboard test action or POST /v1/webhooks/{webhookId}/test to confirm your endpoint receives a signed event and returns 2xx.

Events Migma emits

Use GET /v1/webhooks/events to list the event types available to your account. For production automations, build around these emitted events:
Brand imports currently emit project.import.started. To detect completion, poll GET /v1/projects/import/{projectId}/status until the import status is active or error.
Email engagement events such as opens, clicks, bounces, and complaints are not delivered through this webhook system. Use campaign and sending analytics pages for those metrics.

Payload format

Every delivery uses the same envelope:

Delivery headers

Migma includes these headers with delivery requests: Custom headers configured on the webhook are also included.

Verify signatures

Always verify X-Migma-Signature before processing a webhook. Compute the HMAC over the exact raw request body, not a parsed and re-serialized JSON object.

Delivery and retries

Webhook delivery is non-blocking. Migma returns API responses without waiting for your webhook endpoint. Delivery behavior:
  • 2xx response: delivery succeeds.
  • Non-2xx response or timeout: delivery is retried with backoff.
  • Timeout: each attempt times out after 10 seconds.
  • Attempts: Migma stops after three total delivery attempts.
  • Ordering: do not rely on strict ordering across different event types or webhooks.
  • Duplicate handling: delivery is at least once, so process by id idempotently.
Keep handlers small. Acknowledge the event quickly, enqueue your own work, then process it asynchronously.

Monitor deliveries

Use delivery history when debugging endpoint failures:
Useful endpoints: Webhook management requires API keys with webhook:read and webhook:write permissions.

Troubleshooting

API Reference

Review webhook endpoints, schemas, and permissions.

n8n

Trigger no-code automations from Migma events.