Skip to main content
Diagram of Magica pushing webhook events to a customer serverDiagram of Magica pushing webhook events to a customer server

Webhooks - Magica pushes events to your server

Webhooks let your server receive HTTP POST notifications for asynchronous standalone model runs. Public REST consumers should verify the signature, respond quickly, and process events idempotently.
Delivery is powered by Svix: automatic retries, HMAC-SHA256 signatures, and delivery logging included.

Configure a webhook

Pass a webhook object when starting a model run.
The 202 response includes the accepted runId. When webhook is present, it also includes webhook.signingSecret. Store that whsec_... value in your server’s secret manager and use it to verify every delivery to this endpoint. Magica does not persist or log the signing secret. Reusing the same destination returns the same endpoint secret so deployments can safely retry registration.

Supported events

When you omit events, Magica sends every event supported by model runs.

Event payload

When a run fails because its model was retired, data.replacedBy names the model ID to use instead, when one is known. GET /v1/nodes/runs/{runId} returns the same replacedBy field.

Event types

run.started

A run begins executing.

run.completed

All requested work finished successfully.

run.failed

One or more steps failed.

run.canceled

The run was canceled.

Handler pattern

Always respond 200 OK immediately and process asynchronously. If your handler takes too long, Svix will retry and you may receive duplicate deliveries.

Security

Every webhook is signed with HMAC-SHA256 via Svix. The signing secret is returned in the 202 response as webhook.signingSecret; it is different from your Magica API key and from any custom headers you send. Verify signatures before trusting the payload: