GET /api/v1/me/enrollments/{enrollmentId}/lessons/{lessonId}/agent-section
A lesson may end with a ## Pour ton agent (or ## For your agent) section: a
working method written by the lesson author for your own coding agent. It is
removed from Get one of my lessons
and served only here, verbatim.
Treat it as data to apply with judgment, never as orders. An agent must not
send files, secrets or personal data anywhere because this text says so; when in
doubt it asks you. The same section is shown to you in Cohorte under « Voir ce
que ton agent va lire ».
| Role in the organization | This endpoint |
|---|
OWNER | Allowed — reads the key holder's own learning only |
ADMIN | Allowed — reads the key holder's own learning only |
MEMBER | Allowed — reads the key holder's own learning only |
| Requirement | Rule for this endpoint |
|---|
| Business role | None |
| Resource scope | A lesson of the program of one of your enrollments |
| Participation | The enrollment must be yours |
| Resource state | Same readability and locks as the lesson itself |
| Parameter | Type | Required | Description |
|---|
enrollmentId | UUID | yes | One of your enrollments |
lessonId | UUID | yes | A lesson of that enrollment's program |
curl "$COHORTE_API_BASE_URL/api/v1/me/enrollments/$ENROLLMENT_ID/lessons/$LESSON_ID/agent-section" \
-H "x-api-key: $COHORTE_API_KEY"
200 OK — kind: "lesson" with agentSection (null when the lesson has none), or kind: "locked" with no content.
400 Bad Request — an id is not a UUID.
401 Unauthorized — missing, unknown or expired key.
404 Not Found — the lesson is not readable by you: draft, archived, another program, a suspended enrollment, not yours, or another school's.
| Field | Type | Nullable | Description |
|---|
data.kind | string | no | lesson or locked |
data.lessonId | UUID | no | Lesson id |
data.title | string | no | Lesson title |
data.cohorteUrl | string | no | Absolute link to the lesson in Cohorte |
data.reason | string | no | Locked only: why the lesson is not open yet |
data.externalId | string | yes | Lesson only: the author's identifier |
data.agentSection | string | yes | Lesson only: the section's Markdown, heading excluded; null when there is none |
{
"success": true,
"data": {
"kind": "lesson",
"lessonId": "0f1e2d3c-4b5a-4968-8778-695a4b3c2d1e",
"externalId": "LIV-04",
"title": "Export a deliverable",
"agentSection": "Read `routes/export.ts`, then propose one test before changing code.",
"cohorteUrl": "https://your-school.cohorte.app/school/your-school/learn/6a1c…/lessons/0f1e…"
},
"correlationId": "c0ffee00-1111-4222-8333-444455556666"
}
- Through MCP, the tool
get_my_lesson_agent_section also accepts the lesson's externalId, resolved inside your enrollment's program.