JsonCut
All articlesDeveloper guides

Video generation API guide: projects, templates, renders and webhooks

Plan a reliable video generation API integration from editable source to asynchronous delivery.

A video generation API does more than accept a payload and return an MP4. Production workflows need durable source projects, separately managed media, validation before expensive work, asynchronous status and a reliable connection between each request and its result. This guide explains the architecture without exposing internal rendering implementation.

Choose between projects and templates

Use a project when the composition itself changes. Use a template when the composition is already approved and only known inputs change. Both should remain inspectable in the visual editor.

For one-off backend rendering, create or update the project source and submit a render. For recurring products, campaigns or customer outputs, publish a versioned template and fill its typed inputs.

  • Projects preserve the complete editable source
  • Templates expose a deliberate public contract
  • Template versions keep existing integrations stable
  • Renders reference the source instead of duplicating it
Public integration path
01Upload

Move large media into scoped storage first.

02Create

Save a project or fill a versioned template.

03Validate

Resolve missing fields and unsupported media before rendering.

04Render

Start an asynchronous operation with an idempotency key.

05Deliver

Receive a signed webhook and store the result URL.

Recommended API responsibilities
ResourceResponsibilityCommon mistake
MediaDurable uploads and readable metadataEmbedding large base64 files in every request
ProjectEditable composition and versionsTreating render input as disposable text
TemplateTyped repeatable inputsExposing coordinates and internal layer IDs
RenderFormat, status and outputKeeping the HTTP request open for the full job
WebhookSigned completion and failure eventsPolling every operation without backoff

Design for retries and partial failure

Networks fail after a server accepts work. Send an idempotency key with create and render operations so the same retry resolves to the original operation instead of producing a duplicate charge.

Bulk jobs should isolate rows. One missing product image must not discard 499 valid outputs. Return field-specific validation messages and let the caller retry only failed rows.

  • Persist your own business identifier with every operation
  • Verify webhook signatures against the raw request body
  • Return a success response only after the event is durably accepted
  • Reconcile unresolved operations with bounded polling

Keep the integration contract smaller than the project

The editable project may contain hundreds of layers, keyframes and media references. An application should not need to understand all of them to create a valid variation. Publish a template contract with stable, meaningful inputs and keep layout implementation details behind it.

Version that contract when a required field changes or when an existing field receives a different meaning. Additive optional fields are easier to roll out, but they still need defaults. Store the template version beside every render so support can reproduce an output after the source evolves.

  • Use business names such as productImage and offerText
  • Return field paths and accepted values in validation errors
  • Keep a default output for every published template version
  • Never silently reinterpret an existing input

Plan observability before volume

Every operation should be traceable from the caller's identifier to the project or template version, render status and delivered artifact. Record timestamps for accepted, started, completed and failed states. This makes queue delays, invalid inputs and downstream delivery problems distinguishable.

Monitor outcomes rather than only HTTP success. Useful measures include validation failure rate, completion time by output profile, webhook delivery attempts and the proportion of results that users regenerate. A rising regeneration rate can signal a creative or input-quality problem even when every render is technically successful.

CONTINUE EXPLORING
API reference and playgroundAuthenticationWebhooks