POST /api/v1/lessons/{lessonId}/publish
Puts a lesson online. Two different rules decide whether this succeeds, and they are worth keeping apart:
draft → published and archived → published, and a lesson needs a title plus a body or a video to be
publishable at all.| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused |
| Requirement | Rule for this endpoint |
|---|---|
| Business role | None — publishing is the same write as editing the content |
| Resource scope | Lesson of the school attached to the API key |
| Resource state | The lesson must carry a title and either a body or a video |
| Parameter | Type | Required | Description |
|---|---|---|---|
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 | yes | Stable key for this publication |
X-Correlation-Id | no | Caller correlation id, returned or generated |
No request body.
curl -X POST "$COHORTE_API_BASE_URL/api/v1/lessons/$LESSON_ID/publish" \
-H "x-api-key: $COHORTE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"200 OK — the lesson is published. replayed is true when it already was.400 Bad Request — missing Idempotency-Key, or a lesson with nothing to show.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 program is archived.404 Not Found — the lesson is unknown or belongs to another school.{
"success": true,
"replayed": false,
"data": {
"id": "5d9f3a60-1c2b-4e7d-8f4a-6b7c8d9e0f1a",
"programId": "9f2c0a1e-4b7d-4c1a-9e3f-2a6b8c0d1e2f",
"courseId": "3b8e2d41-7a6c-4f1e-8b25-9c0d1e2f3a4b",
"sectionId": "c41e7b03-9d2a-4e6f-b1c8-5a6b7c8d9e0f",
"title": "Structure a discovery call",
"content": "## Why it matters\n\nA discovery call decides the rest of the sale.",
"videoUrl": "https://vimeo.com/912440188",
"status": "published",
"position": 1,
"createdAt": "2026-09-01T09:00:00.000Z",
"updatedAt": "2026-09-04T17:12:00.000Z"
},
"correlationId": "0f6b1d92-5c3e-4a8b-9d71-3e2f4a6b8c10"
}lesson.published event are
written in one transaction.