AI video renders take minutes, not milliseconds. Polling for minutes is wasteful, and a worker that holds a connection open for every job doesn't scale past a few dozen. With webhooks, the platform calls you when the job is done. Webhook handlers are also where a lot of integration bugs live: unverified payloads, duplicate processing, and handlers that time out and trigger the very retries that cause the duplicates.
This post covers Mantinea's webhooks specifically: which events you get, how they're signed, how retries work, and a handler design that holds up. Facts are from Mantinea's public docs as of November 2026; check the API and MCP help page for exact payload fields.
The events
Mantinea sends signed events for two kinds of object, each with three outcomes:
| Object | Succeeded | Failed | Canceled |
|---|---|---|---|
| Job (one generation, edit, translation...) | Yes | Yes | Yes |
| Workflow run (a whole pipeline) | Yes | Yes | Yes |
Choose based on what your system cares about. A product-feed pipeline that submits individual jobs wants job events. A team that triggers whole workflows from an inbound URL usually only needs the workflow-run event, which fires once at the end instead of once per step.
A note on money: failed or canceled jobs are refunded automatically. Your handler doesn't need to reconcile credits on failure; it needs to tell a human, or resubmit.
Signatures: verify before you trust
Every delivery carries a signature in the X-Autonomous-Signature header. ("Autonomous" is an older product name still used in developer surfaces, so don't be surprised by it.) Verify it with your webhook secret before you read anything in the body.
Three rules that apply to any signed webhook, including this one:
- Verify against the raw body. Parse the JSON first and re-serialize it, and the bytes may change, breaking the signature. Most frameworks have a way to get the raw request body; use it.
- Compare in constant time. Use your language's constant-time comparison (for example
hmac.compare_digestin Python,crypto.timingSafeEqualin Node) rather than==. - Reject without detail. On a bad signature, return an error status and log it. Don't process it, and don't echo details back.
Compute the expected signature exactly as the docs describe. Don't guess the scheme from a blog post, including this one.
The retry schedule
If your endpoint doesn't acknowledge a delivery, Mantinea retries at:
1 min, 5 min, 30 min, 2 h, 6 h, 12 h.
That's a backoff schedule spread over the better part of a day. It has three practical consequences.
Short outages heal themselves. A deploy that takes your endpoint down for three minutes loses nothing; the 1-minute or 5-minute retry picks it up.
Long outages still have a window. If your endpoint is down overnight, later retries arrive hours apart. Monitor your endpoint; if it's been down longer than the schedule covers, reconcile by listing job states through the API instead of waiting.
You will receive duplicates. If your handler does the work and then times out before responding, the platform sees no acknowledgment and retries. Your handler must be safe to run twice on the same event.
A handler that holds up
The design that avoids nearly every webhook bug is: verify, record, acknowledge, then work.
@app.post("/hooks/mantinea")
def mantinea_hook(request):
raw = request.raw_body
if not verify_signature(raw, request.headers["X-Autonomous-Signature"], SECRET):
return Response(status=401)
event = json.loads(raw)
if already_seen(event_id(event)): # dedupe on the event's id
return Response(status=200)
store_event(event) # durable write, fast
queue.enqueue(process_event, event_id(event))
return Response(status=200) # acknowledge in milliseconds
Then, in the worker:
- On succeeded: fetch the asset (results are assets with signed URLs; refresh them if they've expired), run your next step, open a review, post to Slack.
- On failed: alert, and resubmit if the cause is on your side. Reuse the original idempotency key only if you want the original job back; use a new one for a genuine retry with changes.
- On canceled: usually just mark it. Someone canceled it on purpose.
Use the event's own identifier for deduping, plus the job or run id. Check the payload in the docs for the exact field names.
Testing the handler
Before production:
- Point a test webhook at a staging endpoint and run a cheap job. A narrated 10-second clip at 3 credits per second is 30 credits; captions are 2. The trial's 1,000 credits cover a lot of test events.
- Kill your endpoint mid-test and watch the retries arrive.
- Send the same event twice and confirm the second is ignored.
- Send a payload with a broken signature and confirm it's rejected.
Webhooks vs polling: a quick decision
Use webhooks when jobs are started by a system and finished by a system: feed workers, launch automations, batch runs. Use long-poll (up to 50 seconds per request) when a person is waiting on the other end, such as a CLI tool or an internal app with a spinner. Many teams run both: long-poll for the interactive path, webhooks as the reliable record.
Where webhooks fit in a pipeline
Webhooks are the "out" half of automation. The "in" half is an inbound trigger URL that starts a workflow, or a batch call through the API. Together they make a loop: something happens, a workflow runs, a webhook tells you it's done. Ecommerce ops automation with webhook-triggered ads shows that loop end to end, and long-poll job status covers the alternative for interactive tools.
Webhooks, the API and inbound triggers are on every Mantinea plan from $29 a month, with a 14-day trial (1,000 credits, no card).