Image Events

The request example illustrates what your webhook endpoint should expect.

post/image.errored

Request

  • Base URL
    https://your-webhook.com
  • URL
    https://your-webhook.com/image.errored
  • Auth
    none declared. Required headers: magic-hour-event-signature, magic-hour-event-timestamp

Headers

magic-hour-event-signaturestring required

A 64-character hexadecimal HMAC-SHA256 signature. Use the complete webhook secret, not an API key, to sign the timestamp header, a period, and the exact raw request body.

Example:3e771b50c...
magic-hour-event-timestampstring required

Unix time in seconds for this delivery attempt. Reject missing or invalid timestamps; a five-minute window before or after the current time is recommended to limit replay.

Example:1730742038

Request body

type'image.errored' required

Example request

{
  "payload": {
    "id": "cuid-example",
    "name": "Example Name",
    "status": "complete",
    "image_count": 1,
    "type": "AI_IMAGE",
    "credits_charged": 5,
    "downloads": [
      {
        "url": "https://videos.magichour.ai/id/output.png",
        "expires_at": "2024-10-19T05:16:19.027Z"
      }
    ],
    "error": {
      "message": "Please use an image with a detectable face",
      "code": "no_source_face"
    }
  }
}

Response

Success

messagestring required

Example response

{
  "message": "Success message from your endpoint"
}

Changes