Register a dashboard webhook
Dashboard-managed webhooks are the default production path. They are reusable across tasks and signed with HMAC-SHA256.- Open the webhooks dashboard.
- Create a webhook with your HTTPS endpoint and the events you care about.
- Save the signing secret when it is shown — you need it to verify deliveries.
webhook field on each generate request.
Handle a delivery
Every delivery is an HTTPPOST with Content-Type: application/json.
| Header | Present on | Meaning |
|---|---|---|
X-Mynth-Event | All deliveries | Specific event name (for example task.image.generate.completed) |
X-Mynth-Signature | Dashboard-managed webhooks only | HMAC-SHA256 signature in t=...,v1=... format |
Content-Type | All deliveries | application/json |
2xx status as soon as you accept the payload. Treat deliveries as at-least-once: make handlers idempotent using task.id.
Completed generate task
Failed generate task
Failed tasks includeevent, task, and request. They do not include result.
request is the task request as stored by Mynth (including metadata when you set it). See Use Metadata.
For rate and alt payloads, see the Webhooks reference.
Verify webhook signatures
Dashboard-managed deliveries includeX-Mynth-Signature. Verify it before trusting the body.
Header format:
@mynthio/sdk/convex — see Convex integration.
Attach request-level custom webhooks
Onimage.generate only, you can add up to 5 extra endpoints per task with webhook.custom. These are useful for task-specific or temporary URLs.
| Constraint | Limit |
|---|---|
| Custom endpoints per generate task | 1 to 5 |
| Custom endpoint shape | { url: string } |
| Signature on custom endpoints | None — add your own token or secret check |
webhook on rate / alt requests | Not supported; use dashboard webhooks |
Choose events
Mynth delivers these concrete events:| Event | When it fires |
|---|---|
task.image.generate.completed | Image generation task succeeded |
task.image.generate.failed | Image generation task failed |
task.image.rate.completed | Standalone rating task succeeded |
task.image.rate.failed | Standalone rating task failed |
task.image.alt.completed | Alt text task succeeded |
task.image.alt.failed | Alt text task failed |
| Subscription | Matches |
|---|---|
task.completed | Any *.completed event above |
task.failed | Any *.failed event above |
all | Every event |
X-Mynth-Event header and payload.event always use the specific event name (for example task.image.generate.completed), even if the webhook was subscribed with task.completed or all.
Generation-time content rating (rating on generate) does not emit task.image.rate.*. Rating is attached to the generate result; see Use Content Rating.
Delivery retries
Mynth retries failed deliveries (non-2xx or network errors) with exponential backoff and jitter, up to 12 attempts. For dashboard-managed webhooks, consecutive failures are tracked. After 30 consecutive failed delivery attempts, Mynth disables that webhook. Fix the endpoint, then re-enable it in the dashboard. Custom request-level endpoints are not auto-disabled; retries still apply for that job.REST example
webhook and rely on that registration.
When to use webhooks vs polling
| Approach | Best for |
|---|---|
| Webhooks | Backend workflows, durable pipelines, cross-system sync |
| Polling | Browser previews, live progress, short user sessions |
| Both | UI waits on poll; server persists via webhook |
Next steps
- Payload reference: Webhooks
- Polling and task endpoints: Async and polling
- Convex helper: Convex integration
- Full Convex walkthrough: Convex full-stack image generation