Skip to main content
Webhooks let you receive HTTP notifications when video generation jobs reach a terminal state, eliminating the need to poll the jobs endpoint. When a job completes, fails, or partially completes, Nouvel sends a POST request to your registered URL with the job details.

How It Works

1

Register a Webhook URL

Include a webhookUrl in your POST /api/v1/generate request body. The URL is stored with the job and will receive a notification when the job finishes.
2

Job Runs

Video generation proceeds as normal. You can still poll the jobs endpoint if desired — webhooks and polling are not mutually exclusive.
3

Receive Notification

When all projects in the job reach a terminal state (completed, partial, or failed), Nouvel sends a POST to your webhook URL with the full job details.

Registration

Register a webhook by including webhookUrl in your generate request:

URL Requirements

Your webhook URL must meet the following requirements:
If the webhook URL fails validation, the generate request returns a 400 error and no job is created.

Webhook Payload

When a job reaches a terminal state, Nouvel sends the following POST request to your URL:

Payload Fields

string
required
Event type. Currently always job.completed (covers completed, partial, and failed terminal states).
string
required
UUID of the generation job.
string
required
Terminal job status. One of:
  • completed — all projects finished successfully
  • partial — some projects completed, some failed
  • failed — all projects failed
integer
required
Total number of projects in the job.
integer
required
Number of projects that completed successfully.
integer
required
Number of projects that failed.
array
required
Details for each project in the job.

Signature Verification

Every webhook request includes an X-Nouvel-Signature header containing an HMAC-SHA256 signature of the request body. Always verify this signature to ensure the request is genuinely from Nouvel.
The signing secret is the WEBHOOK_SIGNING_SECRET environment variable configured on the Nouvel server. Contact support@nouvel.ai to obtain your webhook signing secret for signature verification.

Delivery Behavior

Retry Logic

If your endpoint is temporarily unreachable or returns a server error (5xx), Nouvel retries with exponential backoff: Non-retryable errors: HTTP 4xx responses (except 429 Too Many Requests) are treated as permanent failures and are NOT retried. Ensure your endpoint returns 200 on success.
While retries cover most transient failures, we still recommend periodic polling of the jobs endpoint as a safety net for mission-critical workflows.

Timing

The webhook fires when the job status endpoint detects that a job has transitioned to a terminal state. This happens during a status poll — not at the exact moment of completion. In practice, this means:
  • If you’re polling the job status endpoint, the webhook fires during one of your polls
  • If you’re not polling, the webhook fires when any poll (including internal monitoring) checks the job
For the fastest notification, combine webhooks with periodic polling. The webhook will typically arrive within seconds of job completion if you’re actively polling.

Best Practices

Your webhook endpoint should return a 200 status code within 10 seconds. If you need to do heavy processing, accept the webhook immediately and process asynchronously.
Never trust webhook payloads without verifying the X-Nouvel-Signature header. This prevents attackers from sending fake webhook events to your endpoint.
Design your webhook handler to be idempotent. Since webhooks retry up to 3 times, your endpoint may receive the same event multiple times. Use the jobId as a deduplication key.
While webhooks now retry up to 3 times, implement periodic polling of the jobs endpoint as a safety net for mission-critical workflows. Check for completed jobs that may have been missed if all retry attempts fail.

Example: Full Integration

Here’s a complete example combining webhook registration with a handler: