{"components":{"responses":{"Error":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error."},"Expired":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`expired`: the file was deleted after the retention period (see `retention_days` in /v1/usage)."},"Forbidden":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`plan_no_api`: your plan has no API access (any /v1 call). `trial_expired`: the free trial has ended (new renders and batches; the error includes `trial_ends_at`)."},"Quota":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"`monthly_quota_exceeded`: the month's renders are used up. `trial_quota_exceeded`: the trial's renders (a total, not per month) are used up. `queue_full`: 500 of your renders are already waiting. The error includes `limit` and `current`, and `requested` for batches."}},"schemas":{"Audio":{"properties":{"alignment":{"description":"Character timings (characters, character_start_times_seconds, character_end_times_seconds) on voice-overs generated earlier.","type":"object"},"bytes":{"type":"integer"},"chars":{"description":"Characters of speech, on voice-overs generated earlier.","type":"integer"},"content_type":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"duration_ms":{"nullable":true,"type":"integer"},"error":{"description":"Why an earlier generation failed.","type":"string"},"id":{"format":"uuid","type":"string"},"kind":{"description":"upload for your files; the other kinds were generated before generation was retired and still work in renders.","enum":["voiceover","upload","music","effect"],"type":"string"},"name":{"type":"string"},"status":{"enum":["generating","ready","failed"],"type":"string"},"text":{"type":"string"},"url":{"description":"The file. Fetch it with your API key.","type":"string"}},"type":"object"},"Batch":{"properties":{"counts":{"properties":{"done":{"type":"integer"},"failed":{"type":"integer"},"queued":{"type":"integer"},"rendering":{"type":"integer"}},"required":["queued","rendering","done","failed"],"type":"object"},"created_at":{"format":"date-time","type":"string"},"expired":{"description":"Renders whose files were deleted after the retention period.","type":"integer"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"template":{"type":"string"},"total":{"description":"Number of rows (renders).","type":"integer"}},"required":["id","name","template","total","created_at","counts","expired"],"type":"object"},"BatchRequest":{"properties":{"audio":{"$ref":"#/components/schemas/RenderAudio"},"duration_ms":{"default":10000,"type":"integer"},"fps":{"default":30,"maximum":60,"minimum":1,"type":"integer"},"height":{"default":1920,"type":"integer"},"name":{"description":"Your label, also used for the ZIP's file name.","maxLength":200,"type":"string"},"poster_ms":{"minimum":0,"type":"integer"},"rows":{"example":[{"title":"Ayşe"},{"title":"Mehmet"}],"items":{"description":"The `data` of one render."},"maxItems":200,"minItems":1,"type":"array"},"template":{"example":"promo","type":"string"},"viewport":{"properties":{"height":{"type":"integer"},"scale":{"default":3,"type":"number"},"width":{"type":"integer"}},"type":"object"},"webhook":{"description":"Called on done/failed of each render.","format":"uri","type":"string"},"width":{"default":1080,"type":"integer"}},"required":["template","rows"],"type":"object"},"Error":{"properties":{"error":{"properties":{"code":{"example":"monthly_quota_exceeded","type":"string"},"current":{"type":"integer"},"limit":{"type":"integer"},"message":{"type":"string"},"requested":{"description":"Renders asked for at once (batches).","type":"integer"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"GalleryTemplate":{"properties":{"html":{"description":"Only returned by GET /v1/gallery/{name}.","type":"string"},"manifest":{"$ref":"#/components/schemas/Manifest"},"name":{"type":"string"}},"required":["name","manifest"],"type":"object"},"Manifest":{"additionalProperties":true,"description":"The form the panel builds for a template: JSON in \u003cscript type=\"application/json\" id=\"scenebake-manifest\"\u003e in its HTML. See the panel docs.","type":"object"},"Render":{"properties":{"attempts":{"type":"integer"},"batch_id":{"description":"The batch this render belongs to.","format":"uuid","nullable":true,"type":"string"},"batch_row":{"description":"0-based row in its batch.","nullable":true,"type":"integer"},"created_at":{"format":"date-time","type":"string"},"duration_ms":{"type":"integer"},"error":{"nullable":true,"type":"string"},"expired":{"description":"The files were deleted after the retention period; video_url and poster_url are null.","type":"boolean"},"finished_at":{"format":"date-time","nullable":true,"type":"string"},"fps":{"type":"integer"},"frames":{"nullable":true,"type":"integer"},"height":{"type":"integer"},"id":{"format":"uuid","type":"string"},"max_attempts":{"type":"integer"},"outputs_deleted_at":{"format":"date-time","nullable":true,"type":"string"},"poster_ms":{"nullable":true,"type":"integer"},"poster_url":{"description":"PNG poster frame. Fetch it with your API key.","nullable":true,"type":"string"},"started_at":{"format":"date-time","nullable":true,"type":"string"},"status":{"$ref":"#/components/schemas/RenderStatus"},"template":{"type":"string"},"timings":{"properties":{"queue_ms":{"format":"int64","nullable":true,"type":"integer"},"render_ms":{"format":"int64","nullable":true,"type":"integer"},"total_ms":{"format":"int64","nullable":true,"type":"integer"}},"type":"object"},"video_bytes":{"format":"int64","nullable":true,"type":"integer"},"video_url":{"description":"MP4 (H.264, yuv420p, faststart). Set when status is done. Fetch it with your API key.","nullable":true,"type":"string"},"webhook":{"nullable":true,"type":"string"},"width":{"type":"integer"}},"required":["id","status","template","attempts","max_attempts","width","height","fps","duration_ms","created_at","timings"],"type":"object"},"RenderAudio":{"description":"Sound of the video. Without it the video is silent.","properties":{"cues_ms":{"description":"When the transition effect plays.","items":{"type":"integer"},"type":"array"},"effect":{"description":"Audio id of the transition effect; replaces the theme's. Needs cues_ms.","format":"uuid","type":"string"},"music":{"description":"Audio id of the background; loops, and replaces the theme's background.","format":"uuid","type":"string"},"music_volume":{"default":0.25,"maximum":1,"minimum":0,"type":"number"},"sound_theme":{"enum":["stadium","energetic","calm"],"type":"string"},"voiceover":{"description":"Audio id of the spoken track, e.g. an uploaded recording.","format":"uuid","type":"string"}},"type":"object"},"RenderRequest":{"properties":{"audio":{"$ref":"#/components/schemas/RenderAudio"},"data":{"description":"Any JSON; exposed to the template as window.DATA (and window.MATCH_DATA).","example":{"title":"Hello"}},"duration_ms":{"default":10000,"description":"duration × fps may not exceed 3600 frames.","type":"integer"},"fps":{"default":30,"maximum":60,"minimum":1,"type":"integer"},"height":{"default":1920,"type":"integer"},"poster_ms":{"description":"Time of the poster frame. Default: template's window.POSTER_MS, else the middle of the clip.","minimum":0,"type":"integer"},"template":{"example":"promo","type":"string"},"viewport":{"description":"CSS viewport the page is laid out in, and the device scale it is captured at. Default: scale 3, size = output × 9/8 ÷ scale (405×720 for 1080×1920).","properties":{"height":{"type":"integer"},"scale":{"default":3,"type":"number"},"width":{"type":"integer"}},"type":"object"},"webhook":{"description":"Called on done/failed.","format":"uri","type":"string"},"width":{"default":1080,"type":"integer"}},"required":["template"],"type":"object"},"RenderStatus":{"enum":["queued","rendering","done","failed"],"type":"string"},"SceneDoc":{"properties":{"created_at":{"format":"date-time","type":"string"},"doc":{"description":"The document; see GET /v1/scene-schema/{pack}.","type":"object"},"duration_ms":{"type":"integer"},"id":{"type":"integer"},"kind":{"type":"string"},"name":{"type":"string"},"pack":{"type":"string"},"problems":{"items":{"properties":{"message":{"type":"string"},"path":{"type":"string"}},"type":"object"},"type":"array"},"sources":{"items":{"properties":{"bytes":{"type":"integer"},"fetched_at":{"format":"date-time","type":"string"},"kind":{"enum":["file","url"],"type":"string"},"name":{"type":"string"},"preview":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"Template":{"properties":{"created_at":{"format":"date-time","type":"string"},"html":{"description":"Only returned by GET /v1/templates/{name}.","type":"string"},"manifest":{"$ref":"#/components/schemas/Manifest"},"name":{"type":"string"},"size":{"description":"HTML length in bytes.","type":"integer"},"updated_at":{"format":"date-time","type":"string"}},"required":["name","size","created_at","updated_at"],"type":"object"},"TemplateInput":{"properties":{"html":{"description":"Full HTML document, max 2 MiB.","type":"string"},"name":{"example":"promo","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","type":"string"}},"required":["name","html"],"type":"object"},"Usage":{"properties":{"api_access":{"type":"boolean"},"done_this_month":{"type":"integer"},"failed_this_month":{"type":"integer"},"in_flight":{"description":"queued + rendering.","type":"integer"},"max_concurrent_jobs":{"description":"How many of your renders run at once; the rest wait in the queue.","type":"integer"},"monthly_render_quota":{"description":"On a trial, the trial's total.","type":"integer"},"period_start":{"format":"date-time","type":"string"},"plan":{"enum":["trial","starter","pro","enterprise","custom"],"type":"string"},"queued":{"type":"integer"},"rendering":{"type":"integer"},"renders_this_month":{"description":"Renders counted against the quota: this month's, or on a trial every render of the trial.","type":"integer"},"retention_days":{"description":"Finished renders' files are deleted this many days after they finish; 0 keeps them.","type":"integer"},"trial_ends_at":{"format":"date-time","nullable":true,"type":"string"}},"type":"object"},"WebhookEvent":{"properties":{"created_at":{"format":"date-time","type":"string"},"event":{"enum":["render.done","render.failed"],"type":"string"},"id":{"example":"evt_42","type":"string"},"render":{"$ref":"#/components/schemas/Render"}},"required":["id","event","created_at","render"],"type":"object"}},"securitySchemes":{"bearerAuth":{"description":"API key, e.g. sb_live_…","scheme":"bearer","type":"http"}}},"info":{"description":"Render GSAP-animated HTML templates to MP4. Authenticate every request with `Authorization: Bearer \u003capi key\u003e` (create keys in the panel). Errors are `{\"error\": {\"code\": \"...\", \"message\": \"...\"}}`.\n\nAccess depends on the plan: the starter plan has no API access (every /v1 call answers 403 `plan_no_api`), and a trial that has ended answers 403 `trial_expired` to new renders and batches. Renders wait in a queue; how many of yours render at once is your plan's `max_concurrent_jobs`, and extra ones simply wait their turn.\n\nRetention: a finished render's video and poster are deleted after the number of days in `GET /v1/usage` → `retention_days` (90 by default). The render record stays, with `expired: true`, and its files answer 410 `expired`. Download what you need to keep.","title":"scenebake API","version":"1.0.0"},"openapi":"3.0.3","paths":{"/v1/audio":{"get":{"operationId":"listAudio","parameters":[{"in":"query","name":"kind","schema":{"enum":["voiceover","upload","music","effect"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"audio":{"items":{"$ref":"#/components/schemas/Audio"},"type":"array"}},"type":"object"}}},"description":"Audio files, newest first."}},"summary":"List your audio files","tags":["audio"]},"post":{"operationId":"uploadAudio","parameters":[{"in":"query","name":"name","schema":{"type":"string"}}],"requestBody":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Audio"}}},"description":"Stored."},"411":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}},"summary":"Upload an audio file (MP3, WAV, OGG, FLAC or M4A, up to 30 MB) as the raw request body, with a Content-Length","tags":["audio"]}},"/v1/audio/{id}":{"get":{"operationId":"getAudio","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Audio"}}},"description":"Details."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Get an audio file's details","tags":["audio"]}},"/v1/audio/{id}/file":{"get":{"operationId":"getAudioFile","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"The file."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Download an audio file","tags":["audio"]}},"/v1/batches":{"get":{"operationId":"listBatches","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"batches":{"items":{"$ref":"#/components/schemas/Batch"},"type":"array"}},"required":["batches"],"type":"object"}}},"description":"Batches, newest first."}},"summary":"List your 50 newest batches","tags":["batches"]},"post":{"description":"Every row is the `data` of one render; all other options apply to every row, exactly as in POST /v1/renders. 1–200 rows. All rows are queued or none: the quota is checked for the whole batch at once, and an invalid row rejects the batch (422, the error's `row` is its 0-based index).","operationId":"createBatch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"batch":{"$ref":"#/components/schemas/Batch"}},"required":["batch"],"type":"object"}}},"description":"Queued."},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Quota"}},"summary":"Queue one render per row","tags":["batches"]}},"/v1/batches/{id}":{"get":{"operationId":"getBatch","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"batch":{"$ref":"#/components/schemas/Batch"},"jobs":{"items":{"$ref":"#/components/schemas/Render"},"type":"array"}},"required":["batch","jobs"],"type":"object"}}},"description":"The batch, and its renders in row order."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Get a batch and its renders","tags":["batches"]}},"/v1/batches/{id}/zip":{"get":{"description":"Streamed. One entry per finished render whose video is still stored, named `NNN-\u003cfirst 8 characters of the render id\u003e.mp4` with NNN the 1-based row (`001-…`). Can be fetched again while renders are still running to get what is done so far.","operationId":"getBatchZip","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/zip":{"schema":{"format":"binary","type":"string"}}},"description":"ZIP archive."},"404":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Expired"}},"summary":"Download the batch's finished videos as one ZIP","tags":["batches"]}},"/v1/gallery":{"get":{"description":"Every account can render these by name, without uploading them.","operationId":"listGallery","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/GalleryTemplate"},"type":"array"}},"required":["templates"],"type":"object"}}},"description":"Gallery templates (without HTML)."},"401":{"$ref":"#/components/responses/Error"}},"summary":"List the ready-made templates","tags":["templates"]}},"/v1/gallery/{name}":{"get":{"operationId":"getGalleryTemplate","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GalleryTemplate"}}},"description":"Gallery template."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Get a ready-made template including its HTML","tags":["templates"]},"parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}}]},"/v1/renders":{"get":{"operationId":"listRenders","parameters":[{"in":"query","name":"status","schema":{"$ref":"#/components/schemas/RenderStatus"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},{"description":"Return renders created before this RFC 3339 timestamp (paging).","in":"query","name":"before","schema":{"format":"date-time","type":"string"}},{"description":"Only this batch's renders, in row order.","in":"query","name":"batch","schema":{"format":"uuid","type":"string"}},{"description":"`1` leaves out renders that belong to a batch.","in":"query","name":"standalone","schema":{"enum":["1"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"renders":{"items":{"$ref":"#/components/schemas/Render"},"type":"array"}},"required":["renders"],"type":"object"}}},"description":"Renders, newest first."}},"summary":"List recent renders","tags":["renders"]},"post":{"operationId":"createRender","parameters":[{"description":"Retrying with the same key and body returns the original render (200, header `Idempotent-Replayed: true`) instead of creating a new one. Same key with a different body → 409.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Render"}}},"description":"Idempotent replay of an earlier request."},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Render"}}},"description":"Queued."},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Quota"}},"summary":"Queue a render","tags":["renders"]}},"/v1/renders/{id}":{"get":{"operationId":"getRender","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Render"}}},"description":"Render."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Get a render's status and output URLs","tags":["renders"]}},"/v1/renders/{id}/poster":{"get":{"operationId":"getRenderPoster","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"image/png":{"schema":{"format":"binary","type":"string"}}},"description":"PNG file."},"404":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Expired"}},"summary":"Download a finished render's PNG poster","tags":["renders"]}},"/v1/renders/{id}/video":{"get":{"operationId":"getRenderVideo","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"video/mp4":{"schema":{"format":"binary","type":"string"}}},"description":"MP4 file."},"206":{"content":{"video/mp4":{"schema":{"format":"binary","type":"string"}}},"description":"Requested range."},"404":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Expired"}},"summary":"Download a finished render's MP4. Supports Range requests","tags":["renders"]}},"/v1/scene-docs":{"get":{"operationId":"listSceneDocs","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"scene_docs":{"items":{"type":"object"},"type":"array"}},"type":"object"}}},"description":"Documents (without their content)."}},"summary":"Your scene documents","tags":["scenes"]},"post":{"operationId":"createSceneDoc","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc":{"type":"object"},"kind":{"type":"string"},"name":{"maxLength":100,"type":"string"}},"required":["name","doc"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"Saved."},"422":{"$ref":"#/components/responses/Error"}},"summary":"Save a document","tags":["scenes"]}},"/v1/scene-docs/generate":{"post":{"operationId":"generateSceneDoc","requestBody":{"content":{"application/json":{"schema":{"properties":{"brief":{"type":"string"},"carousel":{"description":"Also write carousel slides","type":"boolean"},"duration_sec":{"type":"integer"},"format":{"enum":["9:16","4:5","1:1"],"type":"string"},"handle":{"type":"string"},"kind":{"description":"A recipe of the pack","type":"string"},"pack":{"type":"string"},"preset":{"type":"string"},"sources":{"items":{"properties":{"base_url":{"description":"api: the https base address","type":"string"},"content":{"description":"file: JSON, CSV or text, at most 100 KB","type":"string"},"endpoints":{"description":"api: endpoints the AI may call while it writes or edits","items":{"properties":{"description":{"type":"string"},"method":{"description":"Only GET: the AI only reads data","enum":["GET"],"type":"string"},"name":{"pattern":"^[a-z][a-z0-9_]{0,39}$","type":"string"},"params":{"items":{"properties":{"description":{"type":"string"},"in":{"enum":["path","query"],"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}},"type":"object"},"type":"array"},"path":{"description":"starts with /, may hold {param}","type":"string"}},"required":["name","path"],"type":"object"},"maxItems":20,"type":"array"},"header_name":{"type":"string"},"header_value":{"description":"url: sent with this fetch only, never stored. api: stored encrypted, sent with every call, never returned.","type":"string"},"kind":{"enum":["file","url","api"],"type":"string"},"name":{"type":"string"},"url":{"description":"url: a public https address","type":"string"}},"required":["kind"],"type":"object"},"maxItems":3,"type":"array"},"story":{"description":"Also write a story picture","type":"boolean"},"use_brand":{"type":"boolean"}},"required":["brief"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"The document. Without sources, `doc.sample` is always true (the video says it shows sample data)."},"402":{"$ref":"#/components/responses/Quota"},"422":{"$ref":"#/components/responses/Error"}},"summary":"Have the AI write a document from a brief (AI credits)","tags":["scenes"]}},"/v1/scene-docs/{id}":{"delete":{"operationId":"deleteSceneDoc","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Delete a document","tags":["scenes"]},"get":{"operationId":"getSceneDoc","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"The document."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Get a document","tags":["scenes"]},"put":{"operationId":"updateSceneDoc","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"doc":{"type":"object"},"kind":{"type":"string"},"name":{"maxLength":100,"type":"string"}},"required":["name","doc"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"Saved."},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}},"summary":"Replace a document","tags":["scenes"]}},"/v1/scene-docs/{id}/chat":{"post":{"operationId":"chatSceneDoc","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"The changed document, the reply and the changed paths."},"402":{"$ref":"#/components/responses/Quota"},"404":{"$ref":"#/components/responses/Error"}},"summary":"Have the AI change the document as a message asks (AI credits)","tags":["scenes"]}},"/v1/scene-docs/{id}/render":{"post":{"operationId":"renderSceneDoc","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Render"}}},"description":"The render; follow it at /v1/renders/{id}."},"402":{"$ref":"#/components/responses/Quota"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}},"summary":"Render the document as a video","tags":["scenes"]}},"/v1/scene-docs/{id}/sources":{"post":{"operationId":"addSceneSource","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"base_url":{"description":"api: the https base address","type":"string"},"content":{"description":"file: JSON, CSV or text, at most 100 KB","type":"string"},"endpoints":{"description":"api: endpoints the AI may call while it writes or edits","items":{"properties":{"description":{"type":"string"},"method":{"description":"Only GET: the AI only reads data","enum":["GET"],"type":"string"},"name":{"pattern":"^[a-z][a-z0-9_]{0,39}$","type":"string"},"params":{"items":{"properties":{"description":{"type":"string"},"in":{"enum":["path","query"],"type":"string"},"name":{"type":"string"},"required":{"type":"boolean"}},"type":"object"},"type":"array"},"path":{"description":"starts with /, may hold {param}","type":"string"}},"required":["name","path"],"type":"object"},"maxItems":20,"type":"array"},"header_name":{"type":"string"},"header_value":{"description":"url: sent with this fetch only, never stored. api: stored encrypted, sent with every call, never returned.","type":"string"},"kind":{"enum":["file","url","api"],"type":"string"},"name":{"type":"string"},"url":{"description":"url: a public https address","type":"string"}},"required":["kind"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"The document with its sources."},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}},"summary":"Add a data source (file or address)","tags":["scenes"]}},"/v1/scene-docs/{id}/sources/{n}":{"delete":{"operationId":"deleteSceneSource","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"n","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"The document."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Remove a data source","tags":["scenes"]}},"/v1/scene-docs/{id}/sources/{n}/refresh":{"post":{"operationId":"refreshSceneSource","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"n","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"header_name":{"type":"string"},"header_value":{"type":"string"}},"type":"object"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"The document."},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}},"summary":"Fetch an address source again","tags":["scenes"]}},"/v1/scene-docs/{id}/stills":{"post":{"description":"A batch of short renders; each one's poster is a still. Download them together from /v1/batches/{id}/zip?kind=poster.","operationId":"stillsSceneDoc","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"format":{"enum":["9:16","4:5","1:1"],"type":"string"},"kind":{"description":"scenes: one picture per scene (and the closing card); carousel: the document's own carousel slides (4:5 unless format says otherwise); story: its story picture (9:16).","enum":["scenes","carousel","story"],"type":"string"}},"type":"object"}}},"required":false},"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"batch":{"$ref":"#/components/schemas/Batch"}},"type":"object"}}},"description":"The batch."},"402":{"$ref":"#/components/responses/Quota"},"404":{"$ref":"#/components/responses/Error"}},"summary":"Render the document as pictures: its scenes, or its own carousel or story","tags":["scenes"]}},"/v1/scene-docs/{id}/versions":{"get":{"operationId":"listSceneVersions","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"versions":{"items":{"properties":{"created_at":{"format":"date-time","type":"string"},"n":{"type":"integer"},"source":{"enum":["create","user","ai","restore"],"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Versions without their content."},"404":{"$ref":"#/components/responses/Error"}},"summary":"A document's versions, newest first (every save, AI edit and restore; the last 50)","tags":["scenes"]}},"/v1/scene-docs/{id}/versions/{n}":{"get":{"operationId":"getSceneVersion","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"n","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"created_at":{"format":"date-time","type":"string"},"doc":{"type":"object"},"n":{"type":"integer"},"source":{"type":"string"}},"type":"object"}}},"description":"The version."},"404":{"$ref":"#/components/responses/Error"}},"summary":"One version with its document","tags":["scenes"]}},"/v1/scene-docs/{id}/versions/{n}/restore":{"post":{"operationId":"restoreSceneVersion","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"in":"path","name":"n","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneDoc"}}},"description":"The document."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Make a version the document again (kept as a new version)","tags":["scenes"]}},"/v1/scene-packs":{"get":{"operationId":"listScenePacks","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Packs."}},"summary":"Packs (fields), their visuals, recipes and examples","tags":["scenes"]}},"/v1/scene-schema/{pack}":{"get":{"operationId":"getSceneSchema","parameters":[{"in":"path","name":"pack","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"JSON Schema."},"404":{"$ref":"#/components/responses/Error"}},"summary":"JSON Schema of a document for a pack","tags":["scenes"]}},"/v1/scene-validate":{"post":{"operationId":"validateSceneDoc","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc":{"type":"object"}},"required":["doc"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"doc":{"type":"object"},"duration_ms":{"type":"integer"},"ok":{"type":"boolean"},"problems":{"items":{"type":"object"},"type":"array"}},"type":"object"}}},"description":"The prepared document (defaults filled in), its problems and length."},"422":{"$ref":"#/components/responses/Error"}},"summary":"Check a document without saving it","tags":["scenes"]}},"/v1/templates":{"get":{"operationId":"listTemplates","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/Template"},"type":"array"}},"required":["templates"],"type":"object"}}},"description":"Templates (without HTML)."},"401":{"$ref":"#/components/responses/Error"}},"summary":"List templates","tags":["templates"]},"post":{"description":"Upsert by name. The HTML must load GSAP and define `window.startAnimation` (see the template contract in the panel docs). Gallery template names are reserved (409 reserved_name).","operationId":"upsertTemplate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}},"description":"Replaced."},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}},"description":"Created."},"401":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}},"summary":"Create or replace a template","tags":["templates"]}},"/v1/templates/{name}":{"delete":{"description":"Queued renders keep working: they use a snapshot of the HTML taken at submit time.","operationId":"deleteTemplate","responses":{"204":{"description":"Deleted."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Delete a template","tags":["templates"]},"get":{"operationId":"getTemplate","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}},"description":"Template."},"404":{"$ref":"#/components/responses/Error"}},"summary":"Get a template including its HTML","tags":["templates"]},"parameters":[{"in":"path","name":"name","required":true,"schema":{"type":"string"}}]},"/v1/usage":{"get":{"operationId":"getUsage","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}},"description":"Usage."}},"summary":"Usage against quota for the current month (UTC), plan and retention","tags":["usage"]}}},"security":[{"bearerAuth":[]}],"servers":[{"url":"https://api.scenebake.com"}],"tags":[{"description":"HTML templates (scoped to the API key's user).","name":"templates"},{"description":"Render jobs.","name":"renders"},{"description":"Many renders of one template at once, one per data row (e.g. a CSV).","name":"batches"},{"description":"Your audio files for renders: uploads, and files generated earlier.","name":"audio"},{"description":"Quota usage.","name":"usage"},{"description":"Scene videos: a JSON document (scenes, each with a text and a ready visual such as a counter, chart, list, pitch or menu) that the scene player renders. Read the schema of a pack, check a document, save it, have the AI write or change it, and render it as a video or as stills (carousel, story).","name":"scenes"}],"webhooks":{"renderFinished":{"post":{"description":"POSTed to the `webhook` URL given when the render was created. `X-Signature: sha256=\u003chex\u003e` is HMAC-SHA256 of the raw body keyed with your webhook secret (panel → Webhook). Any 2xx counts as delivered; otherwise it is retried up to 5 times with backoff (10 s, 1 min, 5 min, 30 min). Headers also include `X-Event` and `X-Delivery-Id`.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Acknowledged."}},"summary":"Sent when a render reaches done or failed"}}}}
