Generates one AI resource (eBook, Mind Map or Quiz) per type and per language. Asynchronous, consumes credits.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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}.
AuthorizationRequires the account API key in the
Authorizationheader, without theBearerprefix.
What changed in v2Previously, a single call generated the three resources together (
ALL_TEXT_ITEMS) in one language (to_lang, singular). NowtypeacceptsABSTRACT,MINDMAPandQUESTIONSindividually, andto_langsis an array of up to 49 languages.to_langandALL_TEXT_ITEMSare 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.
| API | Interface |
|---|---|
abstract | eBook |
mindmap | Mind Map |
questions | Quiz |
Available Operations
type | What it generates | Accepted configuration |
|---|---|---|
ABSTRACT | eBook (text + canonical HTML + cover + chapter images) | abstract_config |
MINDMAP | Mind Map | mindmap_config |
QUESTIONS | Quiz | questions_config |
ALL_TEXT_ITEMS | The three resources together, in the old model (compatibility) | — |
TRANSCRIPTION | Transcription / subtitles — see Create AI Subtitles | — |
TRANSLATION | Translation of an existing subtitle — see Create AI Subtitles | — |
DUBBING | Dubbing — see Create AI Dubbing | — |
HTTP Method & Path
POST /aiworkflow
Base URL: https://api-v2.pandavideo.com.br
Authentication Requirements
| Item | Value |
|---|---|
| Security Scheme | API Key |
| Header | Authorization |
| Format | The raw key, without Bearer |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Authorization | header | string | Yes | Account API key |
Request Body
Content-Type: application/json
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
video_id | string (uuid) | Yes | Video the content is generated from |
type | string | Yes | Resource to generate — see Available Operations |
from_lang | string | No | Language of the video audio. auto detects it. 50 values (49 languages + auto) |
to_langs | array of string | No | Output languages, no duplicates. 49 values (the same list, without auto). One resource per language |
abstract_config | object | No | eBook layout — see the table below. Strict object |
mindmap_config | object | No | Mind Map appearance — orientation, accent_color |
questions_config | object | No | Quiz behaviour — see the table below |
custom_instructions | string | No | Extra instructions for the generation, up to 1000 characters |
image_generation_count | integer | No | How many chapter images to generate for the eBook, 0 to 10. Each image consumes credits |
abstract_config — eBook layout
abstract_config — eBook layout| Field | Type | Values |
|---|---|---|
layout | string | classic, modern, minimal, magazine |
title_font | string | Lato, Inter, Merriweather, Playfair Display, Raleway, Roboto, Rubik, Oswald |
content_font | string | Same list as title_font |
accent_color | string | 6-digit hex — ^#[0-9a-fA-F]{6}$ |
secondary_color | string | Same. Only takes effect in modern and magazine |
format | string | portrait, landscape, square |
header_footer | boolean | Header and footer on the pages |
logo_key | string or null | Key returned by the upload_logo_url action |
abstract_configis a strict object. Any field outside this list returns 400.
questions_config — Quiz behaviour
questions_config — Quiz behaviour| Field | Type | Values | Effect |
|---|---|---|---|
num_questions | integer or "auto" | 1 to 10 | Number of questions |
num_answers | integer | 2 to 5 | Alternatives per question |
allow_skip | boolean | — | Lets the viewer skip a question |
show_explanation | boolean | — | Reveals right or wrong immediately |
show_results | boolean | — | Shows the score at the end |
collect_lead | boolean | — | Asks for name and e-mail first |
In the player, an absent boolean counts as enabled. A Quiz generated withoutquestions_configallows skipping, shows explanations and shows the score. To turn a behaviour off, send the field asfalse— 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.ptandpt-BRare distinct values, and thesrclangof 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 insideabstract_config, duplicate language into_langs,custom_instructionsover 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
- Track the job with
GET /aiworkflow/{work_id}. - Call
GET /videos/{video_id}and readconfig.ai.resources[]— the manifest lists the type and language of every finished resource, and the PDF URL when there is one. - 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
}' 401Missing or invalid API key.
402Not enough AI credits.
404Video not found.
500Internal error.
