> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magnific.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks | Magnific API v2

> Get a signed notification when a generation, edit or tool completes or fails, as on API v1.

Send `webhook_url` in the body of any call that queues creations, and Magnific calls it once per creation when it finishes, instead of you polling `GET /v2/creations/{creation_id}`:

* **Generation**: `POST /v2/images/generate/{model}`, `POST /v2/videos/generate/{model}`, `POST /v2/videos/finalize`
* **Audio**: `POST /v2/audio/voiceover/{model}`, `POST /v2/audio/music/{model}`, `POST /v2/audio/sfx/{model}`
* **Image edits and tools**: `POST /v2/images/expand`, `/upscale`, `/relight`, `/restyle`, `/remove-background`, `/skin-enhancer`, `/change-camera`, `/reimagine`, `/retouch`, `/character-sheet`
* **Video tools**: `POST /v2/videos/speak/{model}`, `/upscale`, `/vfx`, `/depth-map`, `/audio-isolation`, `/camera-path`
* **Magnific Move**: `POST /v2/videos/move`, `POST /v2/videos/move/{motion_id}/versions`, `POST /v2/videos/move/versions/{version_id}/retry`, `POST /v2/videos/move/versions/{version_id}/render`
* **Brand kits**: `POST /v2/brand-kits/{brand_kit_id}/validation/runs/{run_id}/samples`

Magnific Move posts the motion instead of a creation, with `event` set to `move.version.ready`, `move.version.failed` or `move.version.cancelled`; its MP4 exports notify as creations.

Uploads (`POST /v2/uploads/*`) finish in the call itself, and a flow run (`POST /v2/flows/{flow_id}/run`) is not a creation: neither takes `webhook_url`.

> [!NOTE]
>
> Webhooks need an **API key**: the notification is signed with the webhook secret of the key that made the call. A call made with a personal access token that sends `webhook_url` is refused with `422`.

## The URL

* A public `https` URL on the default port, up to 512 characters, without credentials.
* It is checked when you make the call and again when the notification is sent: a URL that resolves to a private or internal address is refused (`422`) or not called.
* Redirects are not followed.

## What Magnific sends

A `POST` with a JSON body: the generation as `GET /v2/creations/{creation_id}` returns it, plus `event` and `request_id`.

```json theme={null}
{
  "creation_id": "ab12CdE",
  "status": "completed",
  "url": "https://…",
  "event": "generation.completed",
  "request_id": "ak-…"
}
```

| `event` | When |
| - | - |
| `generation.completed` | The generation finished; `url` points to the result. Download the original with `GET /v2/creations/{creation_id}/download` |
| `generation.failed` | The generation failed |

## Verify it

Each notification carries the same headers and signature as API v1, so the verification code you already run works unchanged:

* `webhook-id`: the delivery's id. It stays the same across retries, so you can drop duplicates.
* `webhook-timestamp`: when it was sent, in Unix seconds.
* `webhook-signature`: `v1,` followed by the base64 HMAC-SHA256 of `{webhook-id}.{webhook-timestamp}.{body}`, keyed by your API key's webhook secret.

How to compute and compare the signature, and where to find the secret, is in [Webhooks](https://docs.magnific.com/webhooks.md).

## Retries

Answer with any `2xx` within 10 seconds. A timeout, a network error, a `5xx`, `408` or `429` is retried up to 9 more times, each wait longer than the last, for about 25 hours in all:

| Retry | After the previous attempt |
| - | - |
| 1 | 10 seconds |
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 1 hour |
| 6 | 2 hours |
| 7 | 4 hours |
| 8 | 8 hours |
| 9 | 10 hours |

Every retry keeps the `webhook-id` and carries a fresh `webhook-timestamp` and signature, and its body is read again at that moment, so `url` is never expired. Any other answer is taken as final and not retried. A retry is not sent once the creation has moved to another status.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.