Create an AI Resource

Generates one AI resource (eBook, Mind Map or Quiz) per type and per language. Asynchronous, consumes credits.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

POST /aiworkflow

Generates one AI resource from a video: eBook (abstract), Mind Map (mindmap) or Quiz (questions). The type field selects which resource and to_langs selects which languages — one resource per language.

Generation is asynchronous and consumes AI credits. The response returns the job that was created; track its state with GET /aiworkflow/{work_id}.

📘

Authorization

Requires the account API key in the Authorization header, without the Bearer prefix.

🚧

What changed in v2

Previously, a single call generated the three resources together (ALL_TEXT_ITEMS) in one language (to_lang, singular). Now type accepts ABSTRACT, MINDMAP and QUESTIONS individually, and to_langs is an array of up to 49 languages. to_lang and ALL_TEXT_ITEMS are still accepted for backward compatibility and write in the old format.

Naming reference

The API uses technical names; the Panda interface uses commercial names. In fields and enum values, always the technical ones.

APIInterface
abstracteBook
mindmapMind Map
questionsQuiz

Available Operations

typeWhat it generatesAccepted configuration
ABSTRACTeBook (text + canonical HTML + cover + chapter images)abstract_config
MINDMAPMind Mapmindmap_config
QUESTIONSQuizquestions_config
ALL_TEXT_ITEMSThe three resources together, in the old model (compatibility)
TRANSCRIPTIONTranscription / subtitles — see Create AI Subtitles
TRANSLATIONTranslation of an existing subtitle — see Create AI Subtitles
DUBBINGDubbing — see Create AI Dubbing

HTTP Method & Path

POST /aiworkflow

Base URL: https://api-v2.pandavideo.com.br

Authentication Requirements

ItemValue
Security SchemeAPI Key
HeaderAuthorization
FormatThe raw key, without Bearer

Parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesAccount API key

Request Body

Content-Type: application/json

Body Parameters

FieldTypeRequiredDescription
video_idstring (uuid)YesVideo the content is generated from
typestringYesResource to generate — see Available Operations
from_langstringNoLanguage of the video audio. auto detects it. 50 values (49 languages + auto)
to_langsarray of stringNoOutput languages, no duplicates. 49 values (the same list, without auto). One resource per language
abstract_configobjectNoeBook layout — see the table below. Strict object
mindmap_configobjectNoMind Map appearance — orientation, accent_color
questions_configobjectNoQuiz behaviour — see the table below
custom_instructionsstringNoExtra instructions for the generation, up to 1000 characters
image_generation_countintegerNoHow many chapter images to generate for the eBook, 0 to 10. Each image consumes credits

abstract_config — eBook layout

FieldTypeValues
layoutstringclassic, modern, minimal, magazine
title_fontstringLato, Inter, Merriweather, Playfair Display, Raleway, Roboto, Rubik, Oswald
content_fontstringSame list as title_font
accent_colorstring6-digit hex — ^#[0-9a-fA-F]{6}$
secondary_colorstringSame. Only takes effect in modern and magazine
formatstringportrait, landscape, square
header_footerbooleanHeader and footer on the pages
logo_keystring or nullKey returned by the upload_logo_url action
⚠️

abstract_config is a strict object. Any field outside this list returns 400.

questions_config — Quiz behaviour

FieldTypeValuesEffect
num_questionsinteger or "auto"1 to 10Number of questions
num_answersinteger2 to 5Alternatives per question
allow_skipbooleanLets the viewer skip a question
show_explanationbooleanReveals right or wrong immediately
show_resultsbooleanShows the score at the end
collect_leadbooleanAsks for name and e-mail first
⚠️

In the player, an absent boolean counts as enabled. A Quiz generated without questions_config allows skipping, shows explanations and shows the score. To turn a behaviour off, send the field as false — omitting it is not enough.

Supported languages

from_lang accepts auto plus the 49 languages below; to_langs accepts the same 49, without auto:

en · en-US · en-UK · pt · pt-BR · es · es-MX · it · it-ch · fr · fr-be · fr-ca · fr-lu · fr-ch · de · de-at · de-li · de-lu · de-ch · ja · zh · hi · ko · id · nl · tr · fil · pl · sv · bg · vi · th · no · hu · sw · sr · ro · ar · cs · el · fi · hr · sk · da · uk · ru · ta · ms · ur

⚠️

Use the exact code from the list. pt and pt-BR are distinct values, and the srclang of the generated resources — later used to build the file path — repeats the code sent here.

Example — eBook in English from Spanish audio

{
  "type": "ABSTRACT",
  "video_id": "{video_id}",
  "from_lang": "es",
  "to_langs": ["en"],
  "abstract_config": {
    "layout": "modern",
    "title_font": "Rubik",
    "content_font": "Rubik",
    "accent_color": "#3F55EE",
    "secondary_color": "#E12AFB",
    "format": "portrait",
    "header_footer": true
  },
  "image_generation_count": 10
}

Example — Quiz in two languages, with defined behaviour

{
  "type": "QUESTIONS",
  "video_id": "{video_id}",
  "from_lang": "auto",
  "to_langs": ["pt-BR", "en"],
  "questions_config": {
    "num_questions": 5,
    "num_answers": 4,
    "allow_skip": false,
    "show_explanation": true,
    "show_results": true,
    "collect_lead": false
  }
}

Response

Success Response (200)

The response returns the job that was created. When more than one language is requested in to_langs, the response is an array — one entry per job. Keep the identifier to check the state with GET /aiworkflow/{work_id}.

⚠️

Important

  • The call returns as soon as the job is accepted — the content does not exist yet at that point. In a real measurement, a short video with 1 language and 1 chapter image took 1m36s to finish. More languages and more images take longer.
  • Do not poll GET /aiworkflow/{work_id} aggressively; a few seconds between checks is enough.
  • Finished content is read from the public per-language file — see Get Mind Map, eBook or Quiz.

Error Responses

  • 400: unknown field inside abstract_config, duplicate language in to_langs, custom_instructions over 1000 characters, or a language outside the enum.
  • 401: missing or invalid API key.
  • 402: not enough AI credits.
  • 404: video not found.
  • 500: internal error.

How to read the result

  1. Track the job with GET /aiworkflow/{work_id}.
  2. Call GET /videos/{video_id} and read config.ai.resources[] — the manifest lists the type and language of every finished resource, and the PDF URL when there is one.
  3. Fetch the content at https://config.tv.pandavideo.com.br/{pullzone_name}/{video_external_id}-ai.{lang}.json.

To edit, regenerate, delete or allow the download of a resource that already exists, see AI Package Actions.

Example Usage

cURL

curl -X POST "https://api-v2.pandavideo.com.br/aiworkflow" \
  -H "Authorization: {api_key}" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "ABSTRACT",
    "video_id": "{video_id}",
    "from_lang": "es",
    "to_langs": ["en"],
    "abstract_config": {
      "layout": "modern",
      "title_font": "Rubik",
      "content_font": "Rubik",
      "accent_color": "#3F55EE",
      "secondary_color": "#E12AFB",
      "format": "portrait",
      "header_footer": true
    },
    "image_generation_count": 10
  }'
Body Params
uuid
required

Video the resource is generated from.

string
enum
required

Resource to generate. ABSTRACT, MINDMAP and QUESTIONS generate one resource each. ALL_TEXT_ITEMS keeps the previous behaviour and generates the three together.

Allowed:
string
enum

Source language of the video audio. Use auto to detect.

to_langs
array of strings, unique

Languages to generate the resource in. One resource per language. No duplicates. Same list as from_lang, without auto.

abstract_config
object

eBook layout. Strict object: an unknown field returns 400. On regenerate, an omitted field reuses the value of the previous generation.

mindmap_config
object

Mind Map appearance. On regenerate, an omitted field reuses the value of the previous generation.

questions_config
object

Quiz behaviour. In the player an absent boolean counts as enabled.

string
length ≤ 1000

Extra instructions for the generation, up to 1000 characters.

integer
0 to 10

How many chapter images to generate for the eBook. Each image consumes credits.

Responses

401

Missing or invalid API key.

402

Not enough AI credits.

404

Video not found.

500

Internal error.

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json