Skip to main content
Instead of polling for job status, provide a callback_url when starting a generation to receive a webhook notification when the job completes or fails.

Using Webhooks

Include the callback_url parameter in your generation request:

Webhook Payload

When the job completes or fails, a POST request will be sent to your callback_url. Success:
Failure:

Retry Behavior

If your endpoint does not return a 2xx status code, the webhook will be retried with exponential backoff: After 5 failed attempts, the webhook is marked as failed. You can check delivery status via the Get Generation Status endpoint:
The webhook field is only present when a callback_url was provided. Possible statuses: pending, delivered, failed.
Your webhook endpoint should return a 2xx status code within 10 seconds to acknowledge receipt. Process the payload asynchronously if your handler needs more time.