DELETE /api/v1/milestones/{milestoneId}/contributions/{lessonId}
Removes the link that said "this lesson prepares this milestone".
Nothing is deleted: the lesson stays in its course, the milestone stays on the path. Only the link goes.
Detaching a resource contribution is not exposed yet — see Notes.
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused |
| Requirement | Rule for this endpoint |
|---|---|
| Business role | None — a contribution is composition, and follows the program |
| Resource scope | Milestone of the school attached to the API key |
| Resource state | An archived milestone, or a milestone of an archived program, answers 403 |
| Parameter | Type | Required | Description |
|---|---|---|---|
milestoneId | UUID | yes | Milestone visible from the key's school |
lessonId | UUID | yes | The lesson that no longer prepares it |
| Header | Required | Description |
|---|---|---|
x-api-key | yes | API key created for this school |
Idempotency-Key | yes | Stable key for this detachment |
X-Correlation-Id | no | Caller correlation id, returned or generated |
No request body.
curl -X DELETE "$COHORTE_API_BASE_URL/api/v1/milestones/$MILESTONE_ID/contributions/$LESSON_ID" \
-H "x-api-key: $COHORTE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"200 OK — the link is gone.400 Bad Request — missing Idempotency-Key.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 milestone is archived.404 Not Found — the milestone is unknown, belongs to another school, or that lesson does not contribute to it.| Field | Type | Nullable | Description |
|---|---|---|---|
success | boolean | no | true for a successful request |
data.milestoneId | UUID | no | The milestone |
data.lessonId | UUID | no | The lesson that was detached |
data.detached | boolean | no | true |
correlationId | UUID | no | Correlation id for support |
{
"success": true,
"data": {
"milestoneId": "2e6a9c14-8b7d-4f3e-a5c2-0f1a2b3c4d5e",
"lessonId": "5d9f3a60-1c2b-4e7d-8f4a-6b7c8d9e0f1a",
"detached": true
},
"correlationId": "0f6b1d92-5c3e-4a8b-9d71-3e2f4a6b8c10"
}With Idempotency-Key, retries of the identical target and payload do not write another mutation, audit or event. A different intention under that key returns 409. Results describe the currently authorized resource state.