Restyle a video lesson

Repaints a built lesson in a design and saves it, keeping every slide's layout: use it for a colour or logo change. Synchronous, with no model call. A font or template change lays text out again, so it goes through …/lesson/rebuild.

The body is the build's templateId and design, checked as for a build (the same 400 and 409 codes, the logo included), and an optional slideIndexes that narrows the repaint; without it every slide is repainted. Each repainted slide takes the colours, and the logo or no logo, a build in the design gives its layout, whatever colours it holds now; nothing moves. An object added in Elai's editor keeps its colours. A slide not built on a template is skipped, and so is one built on a layout the template no longer has (layout_missing in warnings) or draws with other objects since a re-import (layout_changed); only a rebuild of such a slide brings it in step. Repainted slides are marked for render; the others keep their render status, and so does a slide that already wears the design, so a repeated restyle writes and re-renders nothing.

Refused with 400: a chosen slide built on another template (code: template_changed), a lesson no slide of which was built on a template (not_a_template_lesson), and fonts other than the ones the slides were built in (fonts_changed, naming those slides in slideIndexes). The template's own fonts sent by name are the same as none; leaving design.fonts out on a lesson built in brand fonts is a change back to the template's. Restyle changes no font, so one changed by hand in Elai's editor stays. Refused with 409 while the video renders (code: video_rendering), while a build or rebuild runs on it (code: lesson_task_running), or when the video changed while it was restyled (code: video_changed): nothing is saved then, and the restyle can be sent again. Each repainted slide records the design's hash, which …/lesson/design answers.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
curl -X POST 'https://apis.elai.io/api/v1/videos/66a1f0c2b7cd13032a9c6002/assistant/lesson/restyle' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "templateId": "6ab669a59baed24c0ea808a6",
  "design": {
    "version": 1,
    "templateRevision": "b58d1b8c7d738b22b7d7596bd0cff4a48595351de150ac7b4fffc00d6d98a5ba",
    "colours": {
      "#000000": "#13235b",
      "#f7f7f7": "#fff4dc",
      "#ffffff": "#fff4dd"
    },
    "logo": {
      "url": "https://d3u63mhbhkevz8.cloudfront.net/production/uploads/6911f6e185c28284b7d3d807/brand-logo.png"
    }
  },
  "slideIndexes": [
    0,
    1,
    2
  ]
}'
{
  "restyled": 6,
  "skipped": 0,
  "warnings": []
}
Path Params
string
required

Video id (24-char hex ObjectId).

Body Params
string
length ≥ 1
design
object
required
slideIndexes
array of integers
length between 1 and 50
slideIndexes
Responses

code says how.

code: video_rendering), a build or rebuild runs on it (code: lesson_task_running), it changed while it was restyled (code: video_changed, nothing saved), or the design was computed for a revision of the template this environment does not hold (code: template_revision_changed).

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