Webhooks - Magica pushes events to your server
Delivery is powered by Svix: automatic retries,
HMAC-SHA256 signatures, and delivery logging included.
Configure a webhook
Pass awebhook object when starting a model run.
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 respond200 OK immediately and process asynchronously. If your handler takes too long, Svix will retry and you may receive duplicate deliveries.
- Node.js
- Python
Security
Every webhook is signed with HMAC-SHA256 via Svix. The signing secret is returned in the202 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:
- Node.js
- Python