Updated AI Resource Content

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
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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.

📘

Authorization

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

⚠️

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

ItemValue
Security SchemeAPI Key
HeaderAuthorization
FormatThe raw key, without Bearer

Parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesAccount API key

Request Body

Content-Type: application/json

FieldTypeRequiredDescription
video_idstring (uuid)YesVideo the resource belongs to
langstringYes (v2)Language of the resource being saved. Without it, the write falls back to the legacy file (one language, no suffix)
questionsarrayConditionalComplete list of the Quiz questions
questions[].idstringNoQuestion ID. If it matches an existing one it updates; if not, it creates
questions[].enunciatestringYes (per question)Question text shown to the viewer
questions[].optionsarrayYes (per question)Alternatives: text and correct (boolean)
questions_configobjectNoQuiz behaviour — see Generate an AI Resource
mindmapobjectConditionalMind Map tree
abstractstringConditionaleBook text in markdown
abstract_htmlstringConditionalCanonical HTML of the eBook — this is what renders the PDF
abstract_summarystringNoShort summary
abstract_coverobjectNoCover: kicker, title, subtitle, edition_label
⚠️

lang is what separates v2 from legacy. With lang, the edit is written to that language's file ({video_external_id}-ai.{lang}.json). Without lang, it is written to the old file ({video_external_id}-ai.json), which is unique per video.

⚠️

When editing an eBook, abstract_html is the canonical source of the PDF. Changing only the abstract markdown may leave the PDF out of sync with the text.

Editing flow

  1. Call GET /videos/{video_id} and read config.ai.resources[] to know which resources exist and in which languages. (In the old model the pointer was the ai_url field of the same response.)
  2. 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.
  3. Change what you need, keeping everything that should continue to exist.
  4. Send the complete structure in this PUT, with the resource lang.

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 without enunciate, malformed options).
  • 401: missing or invalid API key.
  • 404: video or resource not found in the given language.
  • 500: internal error.

Related operations

ActionWhere
Create by hand, regenerate, allow downloadAI Package Actions
Remove one resource from one languageDelete an AI Resource
Generate a new resource with AIGenerate 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 }
        ]
      }
    ]
  }'
Body Params
uuid
required
string

Language of the resource being saved. Without it the legacy single language file is written.

questions
array of objects

Full list of Quiz questions. Replaces the current structure.

questions
questions_config
object

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

mindmap
object

Mind Map tree.

string

eBook text in markdown.

string

Canonical HTML of the eBook.

string
abstract_cover
object

Cover copy of the eBook.

Responses

401

Missing or invalid API key.

404

Video or resource not found.

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