Lays the video out on a lesson template, one slide per chapter, and delivers the built slides on a signed webhook. The video must already hold one slide per chapter, each carrying that chapter's speech exactly; the build keeps every speech and writes nothing to the video itself.
The call answers 202 with a task id at once. The outcome is POSTed to callbackUrl as lesson.built (with templateId, the built slides and warnings) or lesson.failed (with a reason), each carrying videoId and taskId. The body is signed with HMAC-SHA256 over the raw bytes using the workspace API token, in the X-Elai-Signature header, with a unix-seconds X-Elai-Timestamp. Delivery is retried, so a receiver should be idempotent on taskId, which the 202 answers and every retry repeats: a later build or rebuild of the same video is a new task.
With templateId the lesson is built on that template; without one, a template is chosen for this lesson alone. It is built on the template's current revision unless the body names another, as templateRevision or design.templateRevision: a lesson stays on the revision it was built on while each later build, rebuild and restyle names it. A revision this environment does not hold answers 409 with code: template_revision_changed and the current revision. templateRevision needs templateId (else 400 with code: revision_template_required), and sent with a design it must be the design's (else 400 with code: template_revision_mismatch). A body naming slideIndexes is refused with 400: rebuilding chosen slides is …/lesson/rebuild. Requires LLM features on the workspace and an API token to sign the webhook.
With a design, which needs templateId (without one it answers 400 with code: design_template_required), every template colour on the built slides becomes exactly the colour sent, and no contrast correction runs. design.templateRevision is the revision of the template detail the colours were computed for, and the one the lesson is built on. design.colours gives a colour for every colour of the detail's reading.palette, keyed by its hex, and design.textOnSurface, when sent, one for every pair of reading.textOnSurface at the size it lists (large or small); anything else answers 400 with codedesign_colours_mismatch or design_pairs_mismatch, naming what is missing and unknown. A colour the reading does not hold stays as the template has it, and warnings names it as colour_unbound. design.fonts, when sent, names a heading and a body family from the systemFonts list of GET /public/systemFonts (served outside the /api/v1 base), in any case, and the slides spell it as the list does: every text the template draws in its heading font (the detail's fonts.heading) takes the heading family, and every text in its body font the body family. Only the first family of a text's font stack changes; its fallbacks, weight, style and size stay. Any other family answers 400 with code: unknown_font, its role and family, the heading checked first; without fonts, the template's own stay.
design.logo, when sent as { url }, is the organisation's logo: a PNG or JPEG on Elai's own storage, uploaded through POST /api/v1/uploads first. It goes in the logo slot of every slide whose layout has one, the slot's id and its place among the objects kept, fitted inside the slot's box without distortion, centred vertically and against the slot's outer edge; a layout without a slot carries no logo, by design. Without logo, or with logo: null, every slot is removed. A logo on any other host answers 400 with code: logo_not_hosted; one Elai cannot read as a PNG or JPEG within 4 seconds, a deleted upload included, answers 400 with code: logo_unreadable. Both are checked before the 202, after every other check. The URL may be sent without its signature and kept for later builds.
The body is invalid, or the design does not fit the template: code says how.
403
The video belongs to another workspace, or the caller's role cannot edit videos.
404
No video with that id in this workspace.
409
The video is rendering, the revision named, templateRevision or the design's, is not one of the template's this environment holds (code: template_revision_changed), or LLM features are not available to this workspace.
Updated about 1 hour ago
Did this page help you?
Yes
No
Language
ShellNodeRubyPHPPython
Credentials
Header
Header
Loading…
Response
Click Try It! to start a request and see the response here! Or choose an example: