WebhooksDeveloper integration

Receive the result when the video is ready.

Let ngram notify your service when a video completes or fails. Verify the signature, match the video ID to the original record, and send completed files and failures to different destinations.

  • Choose the scope — Set a callback for one job or subscribe to one account event type.
  • Verify the request — Check the raw body, timestamp and HMAC-SHA256 signature.
  • Handle a repeat — Keep the video and version IDs so retries do not duplicate customer delivery.

Three example webhook deliveries

Route a completed video

The example matches a signed video.completed event to its job and checks the result URL before delivery.

Send a failure to the job owner

The receiver gets video.failed with error_code and error, records the failure and acknowledges receipt.

Recover after a temporary receiver outage

A receiver returns HTTP 503 on its first attempt and HTTP 204 on the retry. Match the same video and version before notifying the customer again.

How it works

From a terminal event to a customer record

Keep creation, webhook receipt and customer delivery as separate states in your application.

01

Choose a job callback or subscription

For one job, include webhook_url and webhook_secret when creating it. For persistent events, POST to /api/v1/webhooks/subscriptions with event_type and a publicly reachable HTTPS target_url. Subscribe separately to video.completed and video.failed; save each returned secret before closing the response.

02

Verify before using the payload

Use the secret for that endpoint, X-Ngram-Timestamp and the exact raw request body to verify X-Ngram-Signature. Reject an invalid signature or a timestamp more than five minutes from your server clock.

03

Record the event durably

Match video_id to the source record. Persist the event or enqueue work durably, then return a 2xx response within ten seconds. A valid duplicate that is already recorded can be acknowledged without repeating the work.

04

Route the result

For video.completed, inspect version_id and result.url before delivery. For video.failed, keep error_code and error with the job and notify the owner. A preview-only completion has no MP4 URL; read the job or export the version.

What the server exposes

What the receiver needs to handle

Keep event verification and durable receipt separate from downstream work.

Two event types

video.completed carries the delivered result and can include version_id. video.failed carries the job ID and an error code and message. Register a standing subscription for each event type needed.

Signed deliveries

Subscriptions return their signing secret only when created. For a job-specific callback, supply webhook_secret to receive signed events. Signatures cover the timestamp, a period and the raw body.

Retries without duplicate delivery

A timeout or non-2xx response triggers retry attempts. Acknowledge durable receipt promptly and make notifications or file placement idempotent in your own service.

Edits are new deliveries

An edit that produces a new version can announce video.completed again under the same video_id. Use video_id plus version_id to distinguish the new result from an earlier delivery.

How it compares

Choose how your application starts and follows a job

Webhooks
Signed event
Status polling
Caller reads
MCP
Assistant
Zapier
Workflow
Who initiatesngram on completion or failureYour serverA person in chatA trigger in a Zap
Result referenceJob and version IDsJob and version IDsProject or preview linkMapped action result
Where it fitsAsynchronous deliveryOccasional status readsA changing creative briefManaged workflow routing
Next stepAuthenticate and route the eventRead after the suggested delayReview in conversationContinue the configured Zap

FAQ

Questions about webhook delivery

Use video.completed and video.failed. An account subscription accepts one event_type per subscription. A callback specified on the create request follows that particular job.

Still curious? Read the setup guide

Webhooks

Test both outcomes on your receiver

Register a receiver, verify a signature and route completed and failed events before connecting a customer destination.