Skip to main content

Lessons

List Lessons

Retrieve all lessons in a classroom or facility.
GET /api/lessons/lesson
curl "http://localhost:8080/api/lessons/lesson?collection=classroom-uuid"

Query Parameters

collection
string
Filter by collection (classroom) UUID
id
string
Filter by specific lesson ID

Response Fields

id
string
Lesson unique identifier
title
string
Lesson title
description
string
Lesson description
resources
array
Array of resource objects with contentnode_id, content_id, channel_id
is_active
boolean
Whether the lesson is currently active
collection
string
UUID of the classroom/collection
classroom
object
Classroom object with id, name, and parent
created_by
string
UUID of the user who created the lesson
date_created
string
ISO 8601 timestamp of creation
assignments
array
Array of collection UUIDs (groups) assigned to
learner_ids
array
Array of individual learner UUIDs assigned to

Get Lesson

Retrieve details of a specific lesson.
GET /api/lessons/lesson/:id
curl http://localhost:8080/api/lessons/lesson/lesson-uuid-here

Create Lesson

Create a new lesson.
POST /api/lessons/lesson
curl -X POST http://localhost:8080/api/lessons/lesson \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Introduction to Mathematics",
    "description": "Basic math concepts",
    "resources": [
      {
        "contentnode_id": "node-uuid",
        "content_id": "content-uuid",
        "channel_id": "channel-uuid"
      }
    ],
    "is_active": true,
    "collection": "classroom-uuid",
    "assignments": ["group-uuid-1", "group-uuid-2"],
    "learner_ids": ["learner-uuid-1"]
  }'

Request Parameters

title
string
required
Lesson title
description
string
Lesson description
resources
array
required
Array of resource objects, each containing contentnode_id, content_id, and channel_id
is_active
boolean
Whether lesson is active (default: true)
collection
string
required
UUID of the classroom this lesson belongs to
assignments
array
Array of collection (group) UUIDs to assign this lesson to
learner_ids
array
Array of individual learner UUIDs to assign this lesson to

Update Lesson

Update an existing lesson.
PATCH /api/lessons/lesson/:id
curl -X PATCH http://localhost:8080/api/lessons/lesson/lesson-uuid-here \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Lesson Title",
    "is_active": false
  }'

Delete Lesson

Delete a lesson.
DELETE /api/lessons/lesson/:id
curl -X DELETE http://localhost:8080/api/lessons/lesson/lesson-uuid-here

Get Lesson Size

Calculate the total size of all resources in lessons.
GET /api/lessons/lesson/size
curl "http://localhost:8080/api/lessons/lesson/size?collection=classroom-uuid"

Response

Returns an array of objects with lesson IDs as keys and sizes in bytes as values:
[
  {
    "lesson-uuid-1": 52428800
  },
  {
    "lesson-uuid-2": 104857600
  }
]

Lesson Resources

Resources are embedded in the lesson object. Each resource contains:
contentnode_id
string
UUID of the content node
content_id
string
Content identifier
channel_id
string
Channel UUID

Lesson Assignments

Lesson assignments determine which learners or groups can access a lesson. They are managed through the assignments and learner_ids fields on the Lesson object:
  • assignments: Array of collection (group) UUIDs - assigns the lesson to all members of these groups
  • learner_ids: Array of individual learner UUIDs - assigns the lesson to specific learners directly
When you create or update a lesson with these fields, Kolibri automatically creates the appropriate LessonAssignment records in the database.

Build docs developers (and LLMs) love