Skip to main content

Delivery model

Mynth supports:
  • dashboard-managed webhooks
  • task-level custom webhook endpoints
Dashboard-managed webhooks are signed. Task-level custom endpoints are not signed.

Headers

Signed deliveries include:
HeaderMeaning
X-Mynth-EventThe event name
X-Mynth-SignatureHMAC-SHA256 signature in t=...,v1=... format

Events

Payloads sent by the worker are image-task payloads:
  • task.image.generate.completed
  • task.image.generate.failed
Dashboard event subscriptions also support hierarchical matching through:
  • task.completed
  • task.failed
  • all
For example, a task.image.generate.completed delivery can satisfy a webhook subscribed to task.completed.

Signature verification

The signature is calculated from:
{timestamp}.{raw_request_body}
using the webhook secret and HMAC-SHA256. The X-Mynth-Signature header format is:
t={timestamp},v1={signature}
Parse the timestamp and signature from the header, then recompute the HMAC over {timestamp}.{raw_request_body} using your webhook secret. Compare the result to the v1 value. See Use Webhooks for a complete code example.

task.image.generate.completed payload

{
  "event": "task.image.generate.completed",
  "task": { "id": "tsk_123" },
  "request": {
    "prompt": "A campaign image for a summer travel brand"
  },
  "result": {
    "model": "google/gemini-3.1-flash-image",
    "images": [
      {
        "status": "succeeded",
        "id": "img_123",
        "url": "https://...",
        "cost": "0.01250000"
      }
    ],
    "cost": {
      "images": "0.01000000",
      "total": "0.01250000"
    }
  }
}

task.image.generate.failed payload

Failed tasks do not include a result object because generation did not produce images.
{
  "event": "task.image.generate.failed",
  "task": { "id": "tsk_123" },
  "request": {
    "prompt": "A campaign image for a summer travel brand"
  }
}