Docs Guides

Content blocks

The six block types and the exact payload each one takes.

A lesson is an ordered list of typed blocks. The payload is validated against the type, and anything extra is rejected.

Type Send
TEXT content: { "markdown": "…" }
VIDEO assetId or content: { "url": "https://…" }
IMAGE assetId, optional content: { "alt": "…" }
FILE assetId (a downloadable file)
EMBED content: { "url": "https://…", "height": 480 }
ASSESSMENT assessmentId of a quiz in the same draft

URLs must be https.

Text#

LESSON_ID=3d477cf4-98e8-48b4-997a-a370054d706c
curl -X POST "$LMS_URL/api/v1/lessons/$LESSON_ID/blocks" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "TEXT",
  "content": {
    "markdown": "## Welcome\n\nStart here."
  }
}'

Uploaded media#

Upload once, then reference the asset:

First upload the file. The response has its id.

curl -X POST "$LMS_URL/api/v1/assets" \
  -H "X-API-Key: $LMS_KEY" \
  -F "file=@intro.mp4"

Then add it to the lesson.

LESSON_ID=3d477cf4-98e8-48b4-997a-a370054d706c
curl -X POST "$LMS_URL/api/v1/lessons/$LESSON_ID/blocks" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "VIDEO",
  "assetId": "5b7e1d20-9c4f-4a38-8e16-2f0a6d9c3b47"
}'

Learners fetch files through the course, and only files their course version actually uses are served. See Files.

Quizzes in lessons#

Create the quiz first (Quizzes and questions), then add an ASSESSMENT block pointing at it. Set the lesson’s completionMode to ASSESSMENT_PASSED if passing should complete the lesson.

Changing a block#

PUT /blocks/{id} replaces its content. The type can’t change; delete the block and add another.

Type to search guides and every endpoint.