DELETE /api/v1/sections/{sectionId}/lessons/{lessonId}
Takes a lesson out of its section. Nothing is deleted: the lesson stays in its course and reads before the sections. A lesson without a section is a legal state, not an accident.
| 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 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 | The section you are taking the lesson out of |
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 DELETE "$COHORTE_API_BASE_URL/api/v1/sections/$SECTION_ID/lessons/$LESSON_ID" \
-H "x-api-key: $COHORTE_API_KEY"200 OK — the lesson has no section any more; data.sectionId is null.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.| Field | Type | Nullable | Description |
|---|---|---|---|
success | boolean | no | true for a successful request |
data.lessonId | UUID | no | The lesson that moved |
data.sectionId | null | yes | Always null here |
data.moved | boolean | no | true |
correlationId | UUID | no | Correlation id for support |
{
"success": true,
"data": {
"lessonId": "5d9f3a60-1c2b-4e7d-8f4a-6b7c8d9e0f1a",
"sectionId": null,
"moved": true
},
"correlationId": "0f6b1d92-5c3e-4a8b-9d71-3e2f4a6b8c10"
}sectionId in the path names
the section you are taking it out of; it is not a second condition.