Create video from template
curl --request POST \
--url https://api.jogg.ai/v2/create_video_with_template \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"template_id": 1234,
"voice_language": "english",
"variables": [
{
"name": "<string>",
"properties": {
"content": "Product description text",
"url": "https://res.jogg.ai/media/image.jpg",
"asset_id": 12345,
"webhook_url": "https://example.com/webhook"
}
}
],
"video_name": "My Template Video",
"avatar_id": 1,
"avatar_type": 0,
"voice_id": "en-US-ChristopherNeural",
"captions_enabled": true,
"background_music_id": 1,
"disable_random_trans": false,
"disable_random_moving": false,
"disable_trans": false,
"disable_moving": false
}
'import requests
url = "https://api.jogg.ai/v2/create_video_with_template"
payload = {
"template_id": 1234,
"voice_language": "english",
"variables": [
{
"name": "<string>",
"properties": {
"content": "Product description text",
"url": "https://res.jogg.ai/media/image.jpg",
"asset_id": 12345,
"webhook_url": "https://example.com/webhook"
}
}
],
"video_name": "My Template Video",
"avatar_id": 1,
"avatar_type": 0,
"voice_id": "en-US-ChristopherNeural",
"captions_enabled": True,
"background_music_id": 1,
"disable_random_trans": False,
"disable_random_moving": False,
"disable_trans": False,
"disable_moving": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_id: 1234,
voice_language: 'english',
variables: [
{
name: '<string>',
properties: {
content: 'Product description text',
url: 'https://res.jogg.ai/media/image.jpg',
asset_id: 12345,
webhook_url: 'https://example.com/webhook'
}
}
],
video_name: 'My Template Video',
avatar_id: 1,
avatar_type: 0,
voice_id: 'en-US-ChristopherNeural',
captions_enabled: true,
background_music_id: 1,
disable_random_trans: false,
disable_random_moving: false,
disable_trans: false,
disable_moving: false
})
};
fetch('https://api.jogg.ai/v2/create_video_with_template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jogg.ai/v2/create_video_with_template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template_id' => 1234,
'voice_language' => 'english',
'variables' => [
[
'name' => '<string>',
'properties' => [
'content' => 'Product description text',
'url' => 'https://res.jogg.ai/media/image.jpg',
'asset_id' => 12345,
'webhook_url' => 'https://example.com/webhook'
]
]
],
'video_name' => 'My Template Video',
'avatar_id' => 1,
'avatar_type' => 0,
'voice_id' => 'en-US-ChristopherNeural',
'captions_enabled' => true,
'background_music_id' => 1,
'disable_random_trans' => false,
'disable_random_moving' => false,
'disable_trans' => false,
'disable_moving' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.jogg.ai/v2/create_video_with_template"
payload := strings.NewReader("{\n \"template_id\": 1234,\n \"voice_language\": \"english\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"properties\": {\n \"content\": \"Product description text\",\n \"url\": \"https://res.jogg.ai/media/image.jpg\",\n \"asset_id\": 12345,\n \"webhook_url\": \"https://example.com/webhook\"\n }\n }\n ],\n \"video_name\": \"My Template Video\",\n \"avatar_id\": 1,\n \"avatar_type\": 0,\n \"voice_id\": \"en-US-ChristopherNeural\",\n \"captions_enabled\": true,\n \"background_music_id\": 1,\n \"disable_random_trans\": false,\n \"disable_random_moving\": false,\n \"disable_trans\": false,\n \"disable_moving\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jogg.ai/v2/create_video_with_template")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"template_id\": 1234,\n \"voice_language\": \"english\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"properties\": {\n \"content\": \"Product description text\",\n \"url\": \"https://res.jogg.ai/media/image.jpg\",\n \"asset_id\": 12345,\n \"webhook_url\": \"https://example.com/webhook\"\n }\n }\n ],\n \"video_name\": \"My Template Video\",\n \"avatar_id\": 1,\n \"avatar_type\": 0,\n \"voice_id\": \"en-US-ChristopherNeural\",\n \"captions_enabled\": true,\n \"background_music_id\": 1,\n \"disable_random_trans\": false,\n \"disable_random_moving\": false,\n \"disable_trans\": false,\n \"disable_moving\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jogg.ai/v2/create_video_with_template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template_id\": 1234,\n \"voice_language\": \"english\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"properties\": {\n \"content\": \"Product description text\",\n \"url\": \"https://res.jogg.ai/media/image.jpg\",\n \"asset_id\": 12345,\n \"webhook_url\": \"https://example.com/webhook\"\n }\n }\n ],\n \"video_name\": \"My Template Video\",\n \"avatar_id\": 1,\n \"avatar_type\": 0,\n \"voice_id\": \"en-US-ChristopherNeural\",\n \"captions_enabled\": true,\n \"background_music_id\": 1,\n \"disable_random_trans\": false,\n \"disable_random_moving\": false,\n \"disable_trans\": false,\n \"disable_moving\": false\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"video_id": "video_123456"
}
}Video
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.
POST
/
v2
/
create_video_with_template
Create video from template
curl --request POST \
--url https://api.jogg.ai/v2/create_video_with_template \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"template_id": 1234,
"voice_language": "english",
"variables": [
{
"name": "<string>",
"properties": {
"content": "Product description text",
"url": "https://res.jogg.ai/media/image.jpg",
"asset_id": 12345,
"webhook_url": "https://example.com/webhook"
}
}
],
"video_name": "My Template Video",
"avatar_id": 1,
"avatar_type": 0,
"voice_id": "en-US-ChristopherNeural",
"captions_enabled": true,
"background_music_id": 1,
"disable_random_trans": false,
"disable_random_moving": false,
"disable_trans": false,
"disable_moving": false
}
'import requests
url = "https://api.jogg.ai/v2/create_video_with_template"
payload = {
"template_id": 1234,
"voice_language": "english",
"variables": [
{
"name": "<string>",
"properties": {
"content": "Product description text",
"url": "https://res.jogg.ai/media/image.jpg",
"asset_id": 12345,
"webhook_url": "https://example.com/webhook"
}
}
],
"video_name": "My Template Video",
"avatar_id": 1,
"avatar_type": 0,
"voice_id": "en-US-ChristopherNeural",
"captions_enabled": True,
"background_music_id": 1,
"disable_random_trans": False,
"disable_random_moving": False,
"disable_trans": False,
"disable_moving": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_id: 1234,
voice_language: 'english',
variables: [
{
name: '<string>',
properties: {
content: 'Product description text',
url: 'https://res.jogg.ai/media/image.jpg',
asset_id: 12345,
webhook_url: 'https://example.com/webhook'
}
}
],
video_name: 'My Template Video',
avatar_id: 1,
avatar_type: 0,
voice_id: 'en-US-ChristopherNeural',
captions_enabled: true,
background_music_id: 1,
disable_random_trans: false,
disable_random_moving: false,
disable_trans: false,
disable_moving: false
})
};
fetch('https://api.jogg.ai/v2/create_video_with_template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jogg.ai/v2/create_video_with_template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template_id' => 1234,
'voice_language' => 'english',
'variables' => [
[
'name' => '<string>',
'properties' => [
'content' => 'Product description text',
'url' => 'https://res.jogg.ai/media/image.jpg',
'asset_id' => 12345,
'webhook_url' => 'https://example.com/webhook'
]
]
],
'video_name' => 'My Template Video',
'avatar_id' => 1,
'avatar_type' => 0,
'voice_id' => 'en-US-ChristopherNeural',
'captions_enabled' => true,
'background_music_id' => 1,
'disable_random_trans' => false,
'disable_random_moving' => false,
'disable_trans' => false,
'disable_moving' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.jogg.ai/v2/create_video_with_template"
payload := strings.NewReader("{\n \"template_id\": 1234,\n \"voice_language\": \"english\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"properties\": {\n \"content\": \"Product description text\",\n \"url\": \"https://res.jogg.ai/media/image.jpg\",\n \"asset_id\": 12345,\n \"webhook_url\": \"https://example.com/webhook\"\n }\n }\n ],\n \"video_name\": \"My Template Video\",\n \"avatar_id\": 1,\n \"avatar_type\": 0,\n \"voice_id\": \"en-US-ChristopherNeural\",\n \"captions_enabled\": true,\n \"background_music_id\": 1,\n \"disable_random_trans\": false,\n \"disable_random_moving\": false,\n \"disable_trans\": false,\n \"disable_moving\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jogg.ai/v2/create_video_with_template")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"template_id\": 1234,\n \"voice_language\": \"english\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"properties\": {\n \"content\": \"Product description text\",\n \"url\": \"https://res.jogg.ai/media/image.jpg\",\n \"asset_id\": 12345,\n \"webhook_url\": \"https://example.com/webhook\"\n }\n }\n ],\n \"video_name\": \"My Template Video\",\n \"avatar_id\": 1,\n \"avatar_type\": 0,\n \"voice_id\": \"en-US-ChristopherNeural\",\n \"captions_enabled\": true,\n \"background_music_id\": 1,\n \"disable_random_trans\": false,\n \"disable_random_moving\": false,\n \"disable_trans\": false,\n \"disable_moving\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jogg.ai/v2/create_video_with_template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template_id\": 1234,\n \"voice_language\": \"english\",\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"properties\": {\n \"content\": \"Product description text\",\n \"url\": \"https://res.jogg.ai/media/image.jpg\",\n \"asset_id\": 12345,\n \"webhook_url\": \"https://example.com/webhook\"\n }\n }\n ],\n \"video_name\": \"My Template Video\",\n \"avatar_id\": 1,\n \"avatar_type\": 0,\n \"voice_id\": \"en-US-ChristopherNeural\",\n \"captions_enabled\": true,\n \"background_music_id\": 1,\n \"disable_random_trans\": false,\n \"disable_random_moving\": false,\n \"disable_trans\": false,\n \"disable_moving\": false\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"video_id": "video_123456"
}
}Create a video using a pre-designed template. Templates provide consistent branding and faster video creation.
Example Usage
Basic Example with Text and Script Variables
curl -X POST 'https://api.jogg.ai/v2/create_video_with_template' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"template_id": 1234,
"video_name": "Product Showcase",
"avatar_id": 127,
"avatar_type": 0,
"voice_language": "english",
"voice_id": "en-US-ChristopherNeural",
"variables": [
{
"type": "text",
"name": "product_name",
"properties": {
"content": "Amazing Smart Watch"
}
},
{
"type": "script",
"name": "script",
"properties": {
"content": "Check out our amazing product!"
}
}
]
}'
Example with Image Variable (URL)
curl -X POST 'https://api.jogg.ai/v2/create_video_with_template' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"template_id": 1234,
"voice_language": "english",
"variables": [
{
"type": "image",
"name": "product_image",
"properties": {
"url": "https://example.com/product.jpg"
}
},
{
"type": "script",
"name": "script",
"properties": {
"content": "Check out this amazing product!"
}
}
]
}'
Example with Image Variable (Asset ID)
curl -X POST 'https://api.jogg.ai/v2/create_video_with_template' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"template_id": 1234,
"voice_language": "english",
"variables": [
{
"type": "image",
"name": "product_image",
"properties": {
"asset_id": 5678
}
},
{
"type": "script",
"name": "script",
"properties": {
"content": "Check out this amazing product!"
}
}
]
}'
Variable Properties
| Property | Type | Description |
|---|---|---|
content | string | For text/script type: Required, the text content. For image/video type: Optional, can be used as URL |
url | string | Media resource URL for image/video type (choose url or asset_id) |
asset_id | integer | Asset ID for image/video type, obtained from /v2/upload/asset (choose url or asset_id) |
Related Guides
Get Templates
Browse available templates
Upload Media
Upload assets to get asset_id
Authorizations
API key for authentication. Obtain your key from the JoggAI dashboard.
Body
application/json
Template ID
Example:
1234
Voice language for text-to-speech
Example:
"english"
Variables to replace in the template
Show child attributes
Show child attributes
Custom name for the video
Example:
"My Template Video"
Digital person ID
Example:
1
Source type of the avatar:
- 0 - Public avatar
- 1 - Custom avatar
Available options:
0, 1 Example:
0
Voice ID for text-to-speech
Example:
"en-US-ChristopherNeural"
Enable captions/subtitles
Example:
true
Background music ID
Example:
1
Disable random transitions
Example:
false
Disable random image effects
Example:
false
Disable all transitions
Example:
false
Disable all image effects
Example:
false
Response
200 - application/json
Success
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
Example:
0
Response message
Example:
"Success"
Show child attributes
Show child attributes
⌘I

