Developer Guides
JSON to Video API: Projects, Templates and Bulk Rendering
Choose projects or reusable templates, manage design changes, and render audience variants in batches with a recovery plan for each item.
By Mina RamzyPublished Updated
A JSON to video API can render a project your application builds, reuse a saved template with new values, or produce a batch of separate videos. Choose between those paths by asking what changes: the composition, the content, or the number of outputs?
This guide helps you make that choice and keep the design, data and batch results in agreement. It assumes familiarity with JSON and HTTP. To follow a working editor and Node.js walkthrough, create your first video.
We will use one fictional software update: Release 2.4, “New dashboard.” Its video has an introduction, a scene for each feature highlight, and an optional beta notice. Later, the same design will produce separate customer and internal-team updates.
Choose the request around what changes
| What changes? | Use | Your application owns |
|---|---|---|
| The composition itself | A full project in payload |
Building and retaining the exact layout, elements and scene structure |
| Values inside a recurring design | A stored template plus variables |
Mapping records into the design's expected fields and controlling template changes |
| The number of independent outputs | A bulk request with payload or template, plus items |
Tracking each input record, accepted job and rejected item |
These choices combine. Bulk rendering can use an inline project or a stored template, and both accept variables. A render request must select exactly one of payload or template. You do not have to store a template before using placeholders.
For the release-update example, a saved template is a useful starting point. Typography and scene structure repeat while the headline, feature list and beta flag change. An inline project fits when your application calculates a different composition, or deliberately submits a retained design snapshot with each request.
The Zvid editor provides a visual way to author the same project model. Designers can use variables and templates and Save → Save as template; developers can construct the JSON directly. Choose who maintains the design, then make its expected inputs explicit.
- Release dataRelease 2.4New dashboardFeature list and beta flag
- Approved designProject or saved templateNamed variablesRepeated and optional scenes
- Audience outputsCustomer videoInternal-team videoSeparate jobs and review
Define the agreement between release data and the design
Here is the application record. These names belong to our release system; they are not required Zvid fields.
{
"releaseId": "release-2-4",
"version": "2.4",
"headline": "New dashboard",
"features": ["Saved views", "Faster filters"],
"isBeta": true
}
The application retains releaseId for tracking, formats version as Release 2.4, and maps the other values into the design. This request illustrates an already-created compatible template; its placeholder ID is not runnable.
{
"template": "tpl_YOUR_RELEASE_TEMPLATE",
"variables": {
"releaseLabel": "Release 2.4",
"headline": "New dashboard",
"highlights": ["Saved views", "Faster filters"],
Collapse example
{
"template": "tpl_YOUR_RELEASE_TEMPLATE",
"variables": {
"releaseLabel": "Release 2.4",
"headline": "New dashboard",
"highlights": ["Saved views", "Faster filters"],
"showBetaNotice": true
},
"overrides": {
"name": "release-2-4"
}
}
In the design, {{headline}} displays New dashboard. The highlights value is an ordered array of strings, while showBetaNotice is a boolean. Record those meanings alongside the variable names. If a later design expects highlight objects with titles and icons, the mapping must change too.
Variables and placeholders support strings, numbers, booleans, arrays and objects. An exact placeholder preserves the value's type; surrounding text produces a string. Request values override the declared defaults, so the application should supply every value it considers required.
Defaults can hide a broken mapping
Suppose the designer changes {{headline}} to {{releaseTitle}} and gives releaseTitle the default Release update. The application still sends headline: "New dashboard". The new placeholder resolves successfully, but the video uses Release update.
An unresolved placeholder is rejected. A resolved but incorrect default can pass that check. Validate the source record, inspect the resolved text, and check representative output before approving a design change. For executable mapping checks and this failure pattern, see separate data and design.
Change templates deliberately
A stored template ID loads that template's current design. Keeping the same ID in application configuration does not pin an immutable design version. Updating the template can therefore affect the next render without changing application code.
For a controlled update:
- Retain the currently approved project JSON and the variable names, types and meanings it expects.
- Duplicate the template and edit the copy. Keep the old template unchanged during the transition.
- Resolve representative records against the candidate: short and long headlines, different highlight counts, and both beta states. Check the resolved content and finished layout.
- Switch the application's template ID only after approving the candidate and its data mapping. Record which design was used for each submission.
Duplicating a template is a supported template operation. The approval process and design snapshot are application practices, not an automatic Zvid release-management feature.
| Design change | What to check before switching |
|---|---|
| Font, spacing or text-box width | Existing values still fit and remain readable. |
| Variable renamed or changed from string to object | The application supplies the new shape and does not fall back silently. |
| New repeated scene or longer scene duration | Expanded scene counts, duration, account limits and credit estimates still fit. |
| New optional notice | Both included and omitted compositions have a sensible ending. |
Switching back to the retained template ID can direct future submissions to the old design, provided that template is still available and unchanged. It does not replace files already rendered. Keep review and publication decisions separate from template updates.
Keep output overrides separate from design changes
Use overrides for the documented output fields, such as name, dimensions, resolution and format. They apply before variable resolution. They cannot replace scenes, visuals, duration or project type.
Changing dimensions also does not prove that a layout fits a new aspect ratio. Review the composition at the intended size. If the scene structure must change, revise the project or template instead of treating overrides as a general patch.
Use iteration inside a video and bulk rendering across videos
Dynamic content provides two controls for the release design:
iteraterepeats a scene for each item inhighlights. Two highlights create two feature scenes inside one video.conditionincludes or removes a scene or element. The boolean{{showBetaNotice}}controls the beta notice.
Compute business decisions in the application and pass their result as booleans. Conditions are not an arbitrary expression language. Stored video templates require explicit positive scene durations, including repeated scenes.
Consider a three-second introduction, three seconds per highlight and a two-second beta notice, with no transitions. The two-highlight release lasts 11 seconds with the notice and 9 seconds without it. Another highlight adds a scene and three seconds. Data changes can therefore change both the duration and the credit estimate.
Test the boundaries your application allows. An empty array creates no feature scenes; decide whether an introduction without highlights is useful. A non-array value is a different problem and fails iteration resolution. Expanded output must respect the account's maxIterateItems and maxScenes limits.
Bulk rendering creates independent outputs. The customer video and internal-team video are separate items, even when both use iteration for their feature scenes. A batch does not combine them into one file, and iteration does not create a batch.
Build a batch from shared values and audience differences
Bulk rendering accepts POST /api/render/bulk/api-key requests with a project or template, optional shared variables, and an items array. Each item's variables take precedence over the batch-level values.
For Release 2.4, share the release label, headline and feature list. Vary the beta notice per audience. This is another request-shape illustration using the same placeholder template:
{
"template": "tpl_YOUR_RELEASE_TEMPLATE",
"name": "release-2-4-audiences",
"variables": {
"releaseLabel": "Release 2.4",
"headline": "New dashboard",
Collapse example
{
"template": "tpl_YOUR_RELEASE_TEMPLATE",
"name": "release-2-4-audiences",
"variables": {
"releaseLabel": "Release 2.4",
"headline": "New dashboard",
"highlights": ["Saved views", "Faster filters"]
},
"items": [
{
"name": "release-2-4-customers",
"variables": { "showBetaNotice": false }
},
{
"name": "release-2-4-internal",
"variables": { "showBetaNotice": true }
}
]
}
With the scene timings above, the customer output is nine seconds and the internal output is eleven. Do not estimate a batch by multiplying one sample's cost if its items can resolve to different durations or dimensions.
Retain a mapping from each zero-based item position to your own record, such as release-2-4/customers and release-2-4/internal. Item names help people recognize outputs, but your saved mapping should determine which source record receives each result.
Split larger submissions to fit the account's maxBulkItems limit and the 500-item hard ceiling. Keep an original record identifier across batches because item indexes restart for every request.
Validate the resolved variants before submitting
For design review, POST /api/templates/{id}/preview returns resolved project JSON and statistics. For a credit estimate, validate the intended single render request with POST /api/render/validate/api-key. Both operations avoid creating media and do not consume render credits.
The validation endpoint is not a bulk dry-run endpoint. To check every audience variant, construct its single-render request using the shared values plus that item's values, and validate it. Inspect warnings, resolved content and the estimate. Validation does not reserve credits or guarantee a later submission will succeed.
Render representative variants when you need to approve their visual result; those renders spend credits. Then apply your application's approval and budget rules before submitting the full batch. Authentication and the working validate/render/download sequence are covered in the first-video tutorial linked above.
Recover individual items without repeating accepted work
Bulk submission is best effort. A response can contain accepted jobs and rejected items together. Save bulkId, every returned jobs[].jobId, and the original input position in jobs[].index. Validation rejections identify their position as errors[].item.
For example, suppose the customer item is accepted, but an upstream mapping accidentally replaces the internal item's highlights array with a string. The internal item fails validation. The customer video can still render.
| Item | Illustrative outcome | Application action |
|---|---|---|
| 0: customer update | Accepted job with index: 0 |
Associate its job ID with the customer record and keep tracking it. |
| 1: internal update | Validation error with item: 1 |
Correct the array and submit only the internal update. |
| Corrected internal update | Item 0 in a new request | Map the new batch/index back to the same internal record. |
The corrected item is index 0 if it is the only item in the new batch. That is why an index is meaningful only together with its batch or submission attempt. Retain the original failure and the replacement attempt rather than overwriting their relationship.
Distinguish these outcomes when deciding what to do next:
- Rejected before a job exists: correct the data and submit the affected item.
- Accepted job later fails: inspect its failure, correct the cause, and record any replacement job as a new attempt for that item.
- Submission reports
failedToQueue: reconcile the reported queue failures and returned job IDs before deciding which records need another attempt. - Submission response is lost: investigate the saved attempt and dashboard before sending it again. A timeout does not prove that nothing was queued.
Resubmitting the original full batch can duplicate accepted work and spend credits again. Application-side attempt records and concurrency controls help prevent that; do not assume Zvid deduplicates repeated POST requests.
Track aggregate results through GET /api/render/bulk/{bulkId}. A batch is not one successful output: retain each child's state, failure or result, then approve and publish the appropriate files separately. The job lifecycle documentation explains completion and output retention.
For event-driven delivery, registered account webhooks are signed, while a per-request webhookUrl callback is unsigned and fires for child jobs rather than once for the whole batch. See the webhook receiver guide for verification, durable acceptance and recovery. Whichever delivery method you use, correlate results with the saved job IDs.
Put the choice into your application
For this release workflow, use a saved template, explicit release-to-variable mapping, iteration for feature scenes, and bulk items for audience outputs. Retain the approved design and a record of every item attempt. Keep template approval, rendering and publishing as separate decisions.
Choose an inline project when your application needs to construct or submit the composition itself. Choose a stored template when the recurring design needs an independent editing workflow. Add bulk submission when several independent records need outputs, and plan item-level recovery before increasing volume.
Frequently asked questions
Can Zvid use variables without a stored template?
Yes. An inline project supplied as payload can declare variables and use placeholders, and request-time variables can replace its defaults. A stored template adds a reusable template ID and a separate design-management workflow; it is not required for variable substitution.
Does a Zvid template ID pin an immutable design version?
No. Rendering with a stored template ID uses its current design. Retain approved project snapshots and control changes deliberately. Duplicating a template before a redesign lets the application switch IDs after review while keeping the previous design available.
Can Zvid template defaults hide a renamed variable?
Yes. If a renamed placeholder has a default, it can resolve to that default while the application continues supplying the old variable name. Check the expected names, types and resolved content; successful resolution alone does not prove the intended data reached the design.
What is the difference between iteration and bulk rendering in Zvid?
Iteration repeats scenes inside one video, while bulk rendering creates separate jobs and output files. One release video can iterate over several highlights, and a bulk request can produce separate audience versions of that design.
Which variables take precedence in a Zvid bulk request?
Item-level variables override batch-level variables, which override the project's declared defaults. Supply explicit values for required application fields, and resolve each intended variant when its content or duration can differ.
How many items can I submit in one Zvid bulk render?
A bulk request accepts at most 500 items, and the account's maxBulkItems limit may be lower. Split larger inputs into batches within both limits and retain source record IDs because item indexes restart in each request.
Should I resubmit the whole Zvid batch when some items fail validation?
No. Correct and resubmit only the rejected items; accepted jobs may already be rendering. Match accepted jobs through jobs[].index and rejected items through errors[].item, retaining the batch ID and your source record IDs when a retry receives new indexes.