---
title: "Generate Video from Template"
method: POST
path: "/v2/template/{template_id}/generate"
tags: ["Templates"]
---

# Generate Video from Template

`POST /v2/template/{template_id}/generate`

This API now supports New AI Studio!

## Path parameters

- `template_id` string, required

## Request body

- object
  - `caption` boolean
  - `callback_id` string
  - `title` string
  - `variables` object — variables
  - `dimension` object — (Optional)The dimension of the output video, you can use this to set the output video to be a different one from template, though the aspect ratio should be the same
    - `width` integer
    - `height` integer
  - `include_gif` boolean — include a GIF preview download URL in the webhook response
  - `enable_sharing` boolean — make the sharing page of this video public upon creation
  - `folder_id` string — enable users to specify video folder destination
  - `brand_voice_id` string — Brand Voice ID

## Response `200`

200

- object

## Other responses

- `400` — 400

---

[API](https://skmtc.net/heygen/apis/heygen-api.md) · [All operations](https://skmtc.net/heygen/apis/heygen-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/heygen/heygen-api/revisions/2f19176d6d56/schema)
