put
https://api-v2.pandavideo.com.br/aiworkflow/aipackage
Saves the edited content of an AI resource in one language. The PUT replaces what is sent.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
PUT /aiworkflow/aipackage
Saves the edited content of an AI resource — eBook (abstract), Mind Map (mindmap) or Quiz (questions) — in one language. This is the endpoint that persists what the user changed in the editor.
AuthorizationRequires the account API key in the
Authorizationheader, without theBearerprefix.
The PUT replaces the content sent. Any question, alternative or block not present in the payload is removed. Send the complete structure, not a delta.
HTTP Method & Path
PUT /aiworkflow/aipackage
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
| Field | Type | Required | Description |
|---|---|---|---|
video_id | string (uuid) | Yes | Video the resource belongs to |
lang | string | Yes (v2) | Language of the resource being saved. Without it, the write falls back to the legacy file (one language, no suffix) |
questions | array | Conditional | Complete list of the Quiz questions |
questions[].id | string | No | Question ID. If it matches an existing one it updates; if not, it creates |
questions[].enunciate | string | Yes (per question) | Question text shown to the viewer |
questions[].options | array | Yes (per question) | Alternatives: text and correct (boolean) |
questions_config | object | No | Quiz behaviour — see Generate an AI Resource |
mindmap | object | Conditional | Mind Map tree |
abstract | string | Conditional | eBook text in markdown |
abstract_html | string | Conditional | Canonical HTML of the eBook — this is what renders the PDF |
abstract_summary | string | No | Short summary |
abstract_cover | object | No | Cover: kicker, title, subtitle, edition_label |
langis what separates v2 from legacy. Withlang, the edit is written to that language's file ({video_external_id}-ai.{lang}.json). Withoutlang, it is written to the old file ({video_external_id}-ai.json), which is unique per video.
When editing an eBook,abstract_htmlis the canonical source of the PDF. Changing only theabstractmarkdown may leave the PDF out of sync with the text.
Editing flow
- Call
GET /videos/{video_id}and readconfig.ai.resources[]to know which resources exist and in which languages. (In the old model the pointer was theai_urlfield of the same response.) - Fetch the current structure at
https://config.tv.pandavideo.com.br/{pullzone_name}/{video_external_id}-ai.{lang}.json— see Get Mind Map, eBook or Quiz. - Change what you need, keeping everything that should continue to exist.
- Send the complete structure in this
PUT, with the resourcelang.
Example — save an edited Quiz in Portuguese
{
"video_id": "{video_id}",
"lang": "pt-BR",
"questions": [
{
"id": "{question_id}",
"enunciate": "Which vitamin is synthesised through sun exposure?",
"options": [
{ "text": "Vitamin A", "correct": false },
{ "text": "Vitamin D", "correct": true },
{ "text": "Vitamin K", "correct": false }
]
},
{
"enunciate": "A new question, with no id — it will be created",
"options": [
{ "text": "Right", "correct": true },
{ "text": "Wrong", "correct": false }
]
}
],
"questions_config": { "num_answers": 3, "show_results": true }
}Example — save an edited eBook in English
{
"video_id": "{video_id}",
"lang": "en",
"abstract": "# Chapter 1\n\nEdited text in markdown...",
"abstract_html": "<section class=\"panda-ebook\">...</section>",
"abstract_summary": "Updated summary.",
"abstract_cover": {
"kicker": "Biochemistry",
"title": "Vitamins",
"subtitle": "Functions, sources and deficiencies",
"edition_label": "Edition 1"
}
}Response
Success Response (200)
Confirms the write. The public file of that language is rewritten right after — CDN propagation is not instantaneous.
Error Responses
400: invalid payload (e.g. a question withoutenunciate, malformedoptions).401: missing or invalid API key.404: video or resource not found in the given language.500: internal error.
Related operations
| Action | Where |
|---|---|
| Create by hand, regenerate, allow download | AI Package Actions |
| Remove one resource from one language | Delete an AI Resource |
| Generate a new resource with AI | Generate an AI Resource |
Example Usage
cURL
curl -X PUT "https://api-v2.pandavideo.com.br/aiworkflow/aipackage" \
-H "Authorization: {api_key}" \
-H "Content-Type: application/json" \
-d '{
"video_id": "{video_id}",
"lang": "pt-BR",
"questions": [
{
"id": "{question_id}",
"enunciate": "Which vitamin is synthesised through sun exposure?",
"options": [
{ "text": "Vitamin A", "correct": false },
{ "text": "Vitamin D", "correct": true }
]
}
]
}' 401Missing or invalid API key.
404Video or resource not found.
