Skip to main content
POST
/
v2
/
ai_scripts
Submit AI script generation request
curl --request POST \
  --url https://api.jogg.ai/v2/ai_scripts \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "language": "english",
  "video_length_seconds": "30",
  "script_style": "Storytime",
  "product_info": {
    "source_type": "id",
    "data": {
      "id": "NTQ0MTkzNjg",
      "name": "Owala FreeSip Insulated Stainless Steel Water Bottle",
      "description": "The Owala FreeSip bottle is perfect for active lifestyles..."
    }
  },
  "target_audience": "Fitness enthusiasts and outdoor adventurers"
}
'
import requests

url = "https://api.jogg.ai/v2/ai_scripts"

payload = {
"language": "english",
"video_length_seconds": "30",
"script_style": "Storytime",
"product_info": {
"source_type": "id",
"data": {
"id": "NTQ0MTkzNjg",
"name": "Owala FreeSip Insulated Stainless Steel Water Bottle",
"description": "The Owala FreeSip bottle is perfect for active lifestyles..."
}
},
"target_audience": "Fitness enthusiasts and outdoor adventurers"
}
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({
language: 'english',
video_length_seconds: '30',
script_style: 'Storytime',
product_info: {
source_type: 'id',
data: {
id: 'NTQ0MTkzNjg',
name: 'Owala FreeSip Insulated Stainless Steel Water Bottle',
description: 'The Owala FreeSip bottle is perfect for active lifestyles...'
}
},
target_audience: 'Fitness enthusiasts and outdoor adventurers'
})
};

fetch('https://api.jogg.ai/v2/ai_scripts', 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/ai_scripts",
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([
'language' => 'english',
'video_length_seconds' => '30',
'script_style' => 'Storytime',
'product_info' => [
'source_type' => 'id',
'data' => [
'id' => 'NTQ0MTkzNjg',
'name' => 'Owala FreeSip Insulated Stainless Steel Water Bottle',
'description' => 'The Owala FreeSip bottle is perfect for active lifestyles...'
]
],
'target_audience' => 'Fitness enthusiasts and outdoor adventurers'
]),
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/ai_scripts"

payload := strings.NewReader("{\n \"language\": \"english\",\n \"video_length_seconds\": \"30\",\n \"script_style\": \"Storytime\",\n \"product_info\": {\n \"source_type\": \"id\",\n \"data\": {\n \"id\": \"NTQ0MTkzNjg\",\n \"name\": \"Owala FreeSip Insulated Stainless Steel Water Bottle\",\n \"description\": \"The Owala FreeSip bottle is perfect for active lifestyles...\"\n }\n },\n \"target_audience\": \"Fitness enthusiasts and outdoor adventurers\"\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/ai_scripts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"language\": \"english\",\n \"video_length_seconds\": \"30\",\n \"script_style\": \"Storytime\",\n \"product_info\": {\n \"source_type\": \"id\",\n \"data\": {\n \"id\": \"NTQ0MTkzNjg\",\n \"name\": \"Owala FreeSip Insulated Stainless Steel Water Bottle\",\n \"description\": \"The Owala FreeSip bottle is perfect for active lifestyles...\"\n }\n },\n \"target_audience\": \"Fitness enthusiasts and outdoor adventurers\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.jogg.ai/v2/ai_scripts")

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 \"language\": \"english\",\n \"video_length_seconds\": \"30\",\n \"script_style\": \"Storytime\",\n \"product_info\": {\n \"source_type\": \"id\",\n \"data\": {\n \"id\": \"NTQ0MTkzNjg\",\n \"name\": \"Owala FreeSip Insulated Stainless Steel Water Bottle\",\n \"description\": \"The Owala FreeSip bottle is perfect for active lifestyles...\"\n }\n },\n \"target_audience\": \"Fitness enthusiasts and outdoor adventurers\"\n}"

response = http.request(request)
puts response.read_body
{
  "code": 0,
  "msg": "Success",
  "data": {
    "task_id": "task_123456789"
  }
}
Generate AI-powered video scripts based on product information. The AI will create multiple script variations optimized for your video duration.

Example Usage

Using Product ID

curl --request POST \
  --url 'https://api.jogg.ai/v2/ai_scripts' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "language": "english",
    "video_length_seconds": "30",
    "script_style": "Storytime",
    "product_info": {
      "source_type": "id",
      "data": {
        "id": "NTQ0MTkzNjg"
      }
    }
  }'

Using Product Details

curl --request POST \
  --url 'https://api.jogg.ai/v2/ai_scripts' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "language": "english",
    "video_length_seconds": "30",
    "script_style": "Discovery",
    "product_info": {
      "source_type": "details",
      "data": {
    "name": "Amazing Smart Watch",
        "description": "A smartwatch with health tracking, fitness monitoring, and smart notifications"
      }
    },
    "target_audience": "Fitness enthusiasts and tech-savvy consumers"
  }'

AI Scripts Guide

Learn the complete AI scripts workflow

Get Script Results

Retrieve generated scripts

Authorizations

x-api-key
string
header
required

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

Body

application/json
language
enum<string>
required

Script generation language

Available options:
english,
filipino,
french,
german,
hindi,
indonesian,
italian,
japanese,
korean,
malay,
portuguese,
russian,
spanish,
thai,
vietnamese,
arabic,
greek,
turkish,
slovenian,
croatian,
romanian,
chinese,
bengali,
urdu,
hungarian,
traditional-chinese,
polish,
cantonese,
danish,
malayalam,
tamil,
telugu,
czech,
hebrew,
zulu,
swedish,
lithuanian,
dutch,
flemish,
norwegian,
finnish,
bulgarian,
latvian,
ukrainian,
mongolian,
persian,
odia,
assamese,
kannada,
tagalog,
amharic,
serbian,
slovak,
swahili
Example:

"english"

video_length_seconds
enum<string>
required

Desired video length in seconds

Available options:
15,
30,
60
Example:

"30"

script_style
enum<string>
required

Script writing style for video content:

  • Don't Worry - Casual and reassuring tone
  • Storytime - Narrative and engaging storytelling approach
  • Discovery - Exploratory and revealing style
  • Data - Fact-based and analytical presentation
  • Top 3 reasons - List-based persuasive format
  • Light marketing - Soft-sell marketing approach
Available options:
Don't Worry,
Storytime,
Discovery,
Data,
Top 3 reasons,
Light marketing
Example:

"Storytime"

product_info
object
required

Product information for script generation

target_audience
string

Target audience for the product (optional)

Example:

"Fitness enthusiasts and outdoor adventurers"

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