POST /api/v1/sections/{sectionId}/lessons/{lessonId}
Files a lesson under a section. The section must belong to the same course as the lesson: the platform refuses otherwise rather than moving the lesson from one course to another as a side effect. Changing the course of a lesson is its own command.
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused |
| Requirement | Rule for this endpoint |
|---|---|
| Business role | None — sections carry the permission of their course |
| Resource scope | Lesson and section of the school attached to the API key |
| Resource state | An archived course, or a course of an archived program, answers 403 |
| Parameter | Type | Required | Description |
|---|---|---|---|
sectionId | UUID | yes | Target section, in the lesson's own course |
lessonId | UUID | yes | Lesson visible from the key's school |
| Header | Required | Description |
|---|---|---|
x-api-key | yes | API key created for this school |
Idempotency-Key | no | Optional: suppresses repeated effects for the same target and payload |
X-Correlation-Id | no | Caller correlation id, returned or generated |
No request body.
curl -X POST "$COHORTE_API_BASE_URL/api/v1/sections/$SECTION_ID/lessons/$LESSON_ID" \
-H "x-api-key: $COHORTE_API_KEY"200 OK — the lesson now belongs to the section.400 Bad Request — the section belongs to another course.401 Unauthorized — the key is missing, invalid, or no longer attached to a member.403 Forbidden — the bearer is not OWNER or ADMIN, or the course is archived.404 Not Found — the lesson is unknown, belongs to another school, or belongs to no course at all — there is nothing to file.| Field | Type | Nullable | Description |
|---|---|---|---|
success | boolean | no | true for a successful request |
data.lessonId | UUID | no | The lesson that moved |
data.sectionId | UUID | no | Its section |
data.moved | boolean | no | true |
correlationId | UUID | no | Correlation id for support |
{
"success": true,
"data": {
"lessonId": "5d9f3a60-1c2b-4e7d-8f4a-6b7c8d9e0f1a",
"sectionId": "c41e7b03-9d2a-4e6f-b1c8-5a6b7c8d9e0f",
"moved": true
},
"correlationId": "0f6b1d92-5c3e-4a8b-9d71-3e2f4a6b8c10"
}