Docs API reference

Sections, lessons & blocks

The content tree inside a draft course.

Courses contain sections (modules), sections contain lessons, and lessons contain ordered content blocks. All of these are editable only while they belong to a draft version. See Content blocks.

13 endpoints · base path /api/v1

PUT/api/v1/blocks/{id}#

Update a block

AccessAdmin, or an API key with the write scope.

Replaces a block's content, assetId and assessmentId. The block's type can't change; delete it and add a new one instead. The new content is validated against the block's type.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Request body application/json · BlockUpdate

FieldTypeNotes
assessmentIdstring (uuid)—
assetIdstring (uuid)—
contentJsonNode—
Example request body
{
  "content": {
    "markdown": "## Welcome\n\nUpdated text."
  }
}

Responses

204No Content

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

BLOCK_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X PUT "$LMS_URL/api/v1/blocks/$BLOCK_ID" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "content": {
    "markdown": "## Welcome\n\nUpdated text."
  }
}'
DELETE/api/v1/blocks/{id}#

Delete a block

AccessAdmin, or an API key with the write scope.

Deletes the block. Remaining blocks are renumbered.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Responses

204No Content

Errors

StatusWhen
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

BLOCK_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X DELETE "$LMS_URL/api/v1/blocks/$BLOCK_ID" \
  -H "X-API-Key: $LMS_KEY"
POST/api/v1/courses/{id}/draft/modules#

Add a section

AccessAdmin, or an API key with the write scope.

Adds a section (module) to the draft. position is zero-based; omit it to append. Returns the new id.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Request body application/json · ModuleInput

FieldTypeNotes
descriptionstring—
positioninteger (int32)min 0
titlerequiredstringmin length 1
Example request body
{
  "description": "A short description.",
  "position": 0,
  "title": "Workplace Safety Essentials"
}

Responses

201Created· IdResponse
Example response
{
  "id": "37386ae0-0ea5-44e0-a02e-161f807af560"
}

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).
409The course has no draft. Start one first.

Errors use RFC 9457 problem details.

COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X POST "$LMS_URL/api/v1/courses/$COURSE_ID/draft/modules" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "A short description.",
  "position": 0,
  "title": "Workplace Safety Essentials"
}'
POST/api/v1/courses/{id}/draft/modules/order#

Reorder sections

AccessAdmin, or an API key with the write scope.

Sets the order of the draft's sections. ids must list every section exactly once, in the new order.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Request body application/json · Order

FieldTypeNotes
idsrequiredstring (uuid)[]min 1 item
Example request body
{
  "ids": [
    "37386ae0-0ea5-44e0-a02e-161f807af560"
  ]
}

Responses

204No Content

Errors

StatusWhen
400ids is missing a section, repeats one, or includes one that isn't in this draft.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X POST "$LMS_URL/api/v1/courses/$COURSE_ID/draft/modules/order" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    "37386ae0-0ea5-44e0-a02e-161f807af560"
  ]
}'
PUT/api/v1/lessons/{id}#

Update a lesson

AccessAdmin, or an API key with the write scope.

Replaces the lesson's title, required flag, completion mode, unlock mode and estimated time.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Request body application/json · LessonUpdate

FieldTypeNotes
completionModestringmatches MANUAL|VIEWED|ASSESSMENT_PASSED
estimatedMinutesinteger (int32)min 0
isRequiredboolean—
titlerequiredstringmin length 1
unlockModestringmatches OPEN|AFTER_PREVIOUS
Example request body
{
  "completionMode": "MANUAL",
  "estimatedMinutes": 30,
  "isRequired": true,
  "title": "Workplace Safety Essentials",
  "unlockMode": "OPEN"
}

Responses

204No Content

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

LESSON_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X PUT "$LMS_URL/api/v1/lessons/$LESSON_ID" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "completionMode": "MANUAL",
  "estimatedMinutes": 30,
  "isRequired": true,
  "title": "Workplace Safety Essentials",
  "unlockMode": "OPEN"
}'
DELETE/api/v1/lessons/{id}#

Delete a lesson

AccessAdmin, or an API key with the write scope.

Deletes the lesson and its blocks. The remaining lessons in the section are renumbered.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Responses

204No Content

Errors

StatusWhen
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

LESSON_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X DELETE "$LMS_URL/api/v1/lessons/$LESSON_ID" \
  -H "X-API-Key: $LMS_KEY"
POST/api/v1/lessons/{id}/move#

Move a lesson

AccessAdmin, or an API key with the write scope.

Moves a lesson to another section of the same draft, or to a new position within its own section. position omitted means the end.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Request body application/json · MoveLesson

FieldTypeNotes
moduleIdrequiredstring (uuid)—
positioninteger (int32)min 0
Example request body
{
  "moduleId": "311f9b08-25d8-4888-adb1-f2078c368d68",
  "position": 0
}

Responses

204No Content

Errors

StatusWhen
400The target section isn't in the same draft.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

LESSON_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X POST "$LMS_URL/api/v1/lessons/$LESSON_ID/move" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "moduleId": "311f9b08-25d8-4888-adb1-f2078c368d68",
  "position": 0
}'
POST/api/v1/lessons/{lessonId}/blocks#

Add a content block

AccessAdmin, or an API key with the write scope.

A lesson is an ordered list of typed blocks. The shape depends on type:

type what to send
TEXT content: { "markdown": "…" }
VIDEO either assetId (an uploaded file) or content: { "url": "https://…" }
IMAGE assetId, and optionally content: { "alt": "…" }
FILE assetId (a downloadable file)
EMBED content: { "url": "https://…", "height": 480 }
ASSESSMENT assessmentId of a quiz in this same draft

Anything else for a type is rejected. URLs must be https. See Content blocks.

Parameters

NameInTypeNotes
lessonIdrequiredpathstring (uuid)The id from a previous response.

Request body application/json · BlockCreate

FieldTypeNotes
assessmentIdstring (uuid)—
assetIdstring (uuid)—
contentJsonNode—
positioninteger (int32)min 0
typerequiredstringmatches TEXT|VIDEO|FILE|IMAGE|EMBED|ASSESSMENT
Example request body
{
  "type": "TEXT",
  "content": {
    "markdown": "## Welcome\n\nThis lesson covers what to do when the alarm sounds."
  }
}

Responses

201Created· IdResponse
Example response
{
  "id": "37386ae0-0ea5-44e0-a02e-161f807af560"
}

Errors

StatusWhen
400The content doesn't match the block type, a URL isn't https, or an asset or assessment doesn't exist.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

LESSON_ID=3d477cf4-98e8-48b4-a056-a98b308b7364
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\nThis lesson covers what to do when the alarm sounds."
  }
}'
POST/api/v1/lessons/{lessonId}/blocks/order#

Reorder blocks

AccessAdmin, or an API key with the write scope.

Sets the order of a lesson's blocks. ids must list every block exactly once.

Parameters

NameInTypeNotes
lessonIdrequiredpathstring (uuid)The id from a previous response.

Request body application/json · Order

FieldTypeNotes
idsrequiredstring (uuid)[]min 1 item
Example request body
{
  "ids": [
    "37386ae0-0ea5-44e0-a02e-161f807af560"
  ]
}

Responses

204No Content

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

LESSON_ID=3d477cf4-98e8-48b4-a056-a98b308b7364
curl -X POST "$LMS_URL/api/v1/lessons/$LESSON_ID/blocks/order" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    "37386ae0-0ea5-44e0-a02e-161f807af560"
  ]
}'
PUT/api/v1/modules/{id}#

Rename a section

AccessAdmin, or an API key with the write scope.

Updates the section's title and description. Only sections of a draft can be changed; a published section returns 409.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Request body application/json · ModuleUpdate

FieldTypeNotes
descriptionstring—
titlerequiredstringmin length 1
Example request body
{
  "description": "A short description.",
  "title": "Workplace Safety Essentials"
}

Responses

204No Content

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).
409The section belongs to a published or retired version, which is frozen.

Errors use RFC 9457 problem details.

MODULE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X PUT "$LMS_URL/api/v1/modules/$MODULE_ID" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "A short description.",
  "title": "Workplace Safety Essentials"
}'
DELETE/api/v1/modules/{id}#

Delete a section

AccessAdmin, or an API key with the write scope.

Deletes the section and all of its lessons and blocks. Remaining sections are renumbered.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Responses

204No Content

Errors

StatusWhen
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).
409The section belongs to a published or retired version.

Errors use RFC 9457 problem details.

MODULE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X DELETE "$LMS_URL/api/v1/modules/$MODULE_ID" \
  -H "X-API-Key: $LMS_KEY"
POST/api/v1/modules/{moduleId}/lessons#

Add a lesson

AccessAdmin, or an API key with the write scope.

Adds a lesson to a section of a draft.

  • isRequired (default true) controls whether it counts towards completion.
  • completionMode: MANUAL (the learner marks it done), VIEWED (opening it is enough) or ASSESSMENT_PASSED (passing its quiz completes it).
  • unlockMode: OPEN, or AFTER_PREVIOUS (locked until the nearest earlier required lesson is complete).

Parameters

NameInTypeNotes
moduleIdrequiredpathstring (uuid)The id from a previous response.

Request body application/json · LessonCreate

FieldTypeNotes
completionModestringmatches MANUAL|VIEWED|ASSESSMENT_PASSED
estimatedMinutesinteger (int32)min 0
isRequiredboolean—
positioninteger (int32)min 0
titlerequiredstringmin length 1
unlockModestringmatches OPEN|AFTER_PREVIOUS
Example request body
{
  "completionMode": "MANUAL",
  "estimatedMinutes": 30,
  "isRequired": true,
  "position": 0,
  "title": "Workplace Safety Essentials",
  "unlockMode": "OPEN"
}

Responses

201Created· IdResponse
Example response
{
  "id": "37386ae0-0ea5-44e0-a02e-161f807af560"
}

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).
409The section belongs to a published or retired version.

Errors use RFC 9457 problem details.

MODULE_ID=311f9b08-25d8-4888-adb1-f2078c368d68
curl -X POST "$LMS_URL/api/v1/modules/$MODULE_ID/lessons" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "completionMode": "MANUAL",
  "estimatedMinutes": 30,
  "isRequired": true,
  "position": 0,
  "title": "Workplace Safety Essentials",
  "unlockMode": "OPEN"
}'
POST/api/v1/modules/{moduleId}/lessons/order#

Reorder lessons

AccessAdmin, or an API key with the write scope.

Sets the order of a section's lessons. ids must list every lesson in the section exactly once.

Parameters

NameInTypeNotes
moduleIdrequiredpathstring (uuid)The id from a previous response.

Request body application/json · Order

FieldTypeNotes
idsrequiredstring (uuid)[]min 1 item
Example request body
{
  "ids": [
    "37386ae0-0ea5-44e0-a02e-161f807af560"
  ]
}

Responses

204No Content

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

MODULE_ID=311f9b08-25d8-4888-adb1-f2078c368d68
curl -X POST "$LMS_URL/api/v1/modules/$MODULE_ID/lessons/order" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    "37386ae0-0ea5-44e0-a02e-161f807af560"
  ]
}'

Type to search guides and every endpoint.