Skip to content

Units

A unit is a section within a program, sorted by ordinal.

List the units of a program, ordered by ordinal. RLS-scoped.

Inputs:

ArgTypeNotes
program_iduuidrequired

Result: { "units": [ { "id", "program_id", "ordinal", "title_i18n" }, … ] }

Add a unit to a program. Author-role only.

Inputs:

ArgTypeNotes
program_iduuidParent program.
ordinal?int ≥ 0Sort position (default 0).
title_i18n?string | mapi18n map or bare string.

Result: { "success": true, "unit": { "id", "program_id", "ordinal", "title_i18n" } }

Update a unit’s ordinal and/or title_i18n. Author-role only. Only provided fields change.

Inputs:

ArgTypeNotes
unit_iduuidrequired
ordinal?int ≥ 0
title_i18n?string | map

Result: { "success": true, "unit": {…} }

Delete a unit. Cascades to its lessons and activities. Author-role only.

Inputs:

ArgTypeNotes
unit_iduuidrequired

Result: { "success": true, "deleted": "<unit_id>" }