---
title: "Create video from template"
method: POST
path: "/v2/create_video_with_template"
tags: ["Video"]
---

# Create video from template

`POST /v2/create_video_with_template`

Create a video using a template with custom variables and settings.
Templates support various variable types including text, image, video, and script.

## Request body

- object
  - `template_id` integer, required — Template ID
  - `video_name` string — Custom name for the video
  - `avatar_id` integer — Digital person ID
  - `avatar_type` 0 | 1 — Source type of the avatar: * 0 - Public avatar * 1 - Custom avatar
  - `voice_language` string, required — Voice language for text-to-speech
  - `voice_id` string — Voice ID for text-to-speech
  - `captions_enabled` boolean — Enable captions/subtitles
  - `background_music_id` integer — Background music ID
  - `variables` object[], required — Variables to replace in the template
    - `type` 'text' | 'image' | 'video' | 'script', required — Variable type
    - `name` string, required — Variable name
    - `properties` object, required
      - `content` string — Variable content: * For text/script type: Required, the text content * For image/video type: Optional, can be used as URL (compatible with url field)
      - `url` string, uri — Media resource URL for image/video type. Either url or asset_id is required for image/video type.
      - `asset_id` integer — Asset ID for image/video type. Obtained after uploading via /v2/upload/asset endpoint. Either url or asset_id is required for image/video type.
      - `webhook_url` string, uri — Webhook URL for status notifications
  - `disable_random_trans` boolean — Disable random transitions
  - `disable_random_moving` boolean — Disable random image effects
  - `disable_trans` boolean — Disable all transitions
  - `disable_moving` boolean — Disable all image effects

## Response `200`

Success

- object
  - `code` integer, required — Business status code: * 0 - Success * 10104 - Record not found * 10105 - Invalid API key * 18020 - Insufficient credit * 18025 - No permission to call APIs * 40000 - Parameter error * 50000 - System error
  - `msg` string, required — Response message
  - `data` object
    - `video_id` string — Created video ID

---

[API](https://skmtc.net/jogg/apis/joggai-openapi-v2.md) · [All operations](https://skmtc.net/jogg/apis/joggai-openapi-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/jogg/joggai-openapi-v2/versions/ec8807ce9c12/schema)
