POST requests to the URLs you configure in your dashboard or per-request.
Events
Mynth currently sends the following events:task.image.completed: Sent when all images in a task have finished generating.task.image.failed: Sent if the entire task fails to process.
Headers
Each webhook request includes these headers to help you identify the event and verify its authenticity:X-Mynth-Event: The name of the event (e.g.,task.image.completed).X-Mynth-Signature: HMAC SHA-256 signature for payload verification.
Security and Verification
Mynth supports two ways to configure webhooks, each with different security characteristics:1. Dashboard Webhooks (Recommended)
Webhooks configured in your Dashboard are the most secure. They use a shared secret to sign payloads, allowing you to verify that the request truly came from Mynth using theX-Mynth-Signature header.
2. Custom Webhooks (Per-request)
You can also provide awebhook URL directly in your API request. These are useful for dynamic endpoints, but they do not support signature verification because there is no shared secret.
Pro Tip: For custom webhooks, we recommend adding a unique token or secret to your URL search parameters to validate the request.
Signature Verification
To ensure webhooks are sent by Mynth (available only for Dashboard webhooks), you should verify the signature in theX-Mynth-Signature header.
The signature header has the following format:
Verification Steps
- Extract the
timestampandsignaturefrom the header. - Concatenate the timestamp and the raw JSON request body with a
.(dot):${timestamp}.${rawBody}. - Compute an HMAC SHA-256 hash of this string using your webhook secret as the key.
- Compare your computed signature with the
v1value in the header.
Node.js Example
Reliability and Retries
To ensure reliability, Mynth will automatically retry failing webhook deliveries with exponential backoff.Automatic Disabling
If a webhook endpoint consistently fails (e.g., returns 5xx errors or times out) for 30 consecutive attempts, it will be automatically disabled to prevent system strain.- You can monitor the status of your webhooks in the dashboard.
- Once you’ve fixed the issue on your server, you must manually re-enable the webhook in the Mynth dashboard.