Create videos from a template.

Creating videos from a template can be a fast and efficient way to produce high-quality videos without the need for manual editing or other time-consuming processes. HeyGen provides a user-friendly frontend interface that allows you to create videos from templates using a simple, intuitive interface.

Create a video on HeyGen Frontend (not from API).

To create a video on HeyGen Frontend, you will need to sign up for a HeyGen account and log in to the frontend interface. Once you are logged in, you can click on the "Create Video" button to create a new video project.

Then you will be taken to the video editor interface, where you can customize the template to create your own unique video. You can use the various controls and tools in the editor to change the text, images, audio, and other elements in the video to match your desired content.

After creating a new video project, you will be presented with a list of available templates that you can use as a starting point for your video. You can browse the videos and select the one that you want to use for your video. Any video can be used as a template except videos generated from API, which will be marked as "API" in the top right corner of the video.

Get the template variables

Once you have created a video project using HeyGen, you can use the Retrieve a template API endpoint to retrieve a template variable in the video(template). This endpoint takes the video_id parameter, which is the ID of the video project that you want to retrieve the template variables for.

For example, you could use the following request to get the template variables for a video project with the ID abc123:

GET /v1/template.get?template_id=abc123
Content-Type: application/json

This request would return a list of template variables for the specified video project, along with their corresponding data types and other information. You can use this information to determine which template variables you want to customize in your video.

Replace the text variable and generate the video.

Once you have identified the template variables that you want to customize in your video, you can use the Generate from template API endpoint to generate a new version of the video with your customizations. This endpoint takes a data parameter, which is an object containing the template variables and their corresponding values.

For example, let's say that you want to customize the text_0 variables in your video. You could use the following request to generate a new version of the video with your customizations:

POST /v1/template.generate HTTP/1.1
Content-Type: application/json

    "template_id": "abc123",
    "variables": {
        "text_0": {"text": "A Brand New Text"}

This request would generate a new version of the video with the title and subtitle template variables set to the values specified in the data object. You can then use the Retrieve a video API endpoints to get the final video URL and download it to your computer.