Skip to main content
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": [
    {
      "type": "text",
      "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
}
'
{
  "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

PropertyTypeDescription
contentstringFor text/script type: Required, the text content. For image/video type: Optional, can be used as URL
urlstringMedia resource URL for image/video type (choose url or asset_id)
asset_idintegerAsset ID for image/video type, obtained from /v2/upload/asset (choose url or asset_id)

Get Templates

Browse available templates

Upload Media

Upload assets to get asset_id

Authorizations

x-api-key
string
header
required

API key for authentication. Obtain your key from the JoggAI dashboard.

Body

application/json
template_id
integer
required

Template ID

Example:

1234

voice_language
string
required

Voice language for text-to-speech

Example:

"english"

variables
object[]
required

Variables to replace in the template

video_name
string

Custom name for the video

Example:

"My Template Video"

avatar_id
integer

Digital person ID

Example:

1

avatar_type
enum<integer>

Source type of the avatar:

  • 0 - Public avatar
  • 1 - Custom avatar
Available options:
0,
1
Example:

0

voice_id
string

Voice ID for text-to-speech

Example:

"en-US-ChristopherNeural"

captions_enabled
boolean

Enable captions/subtitles

Example:

true

background_music_id
integer

Background music ID

Example:

1

disable_random_trans
boolean

Disable random transitions

Example:

false

disable_random_moving
boolean

Disable random image effects

Example:

false

disable_trans
boolean

Disable all transitions

Example:

false

disable_moving
boolean

Disable all image effects

Example:

false

Response

200 - application/json

Success

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
Example:

0

msg
string
required

Response message

Example:

"Success"

data
object