---
title: "Commit a rotation proposal to session records (MED-906 / E4.0c)"
method: POST
path: "/api/cohorts/{cohortId}/sessions/finalize-leader-rotation"
tags: ["Sessions"]
---

# Commit a rotation proposal to session records (MED-906 / E4.0c)

`POST /api/cohorts/{cohortId}/sessions/finalize-leader-rotation`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/cohorts/{cohortId}/sessions/finalize-leader-rotation`
- Auth: HTTP bearer

Bulk-writes session leader assignments from a (possibly CM-edited)
rotation proposal. Each assignment is validated against the MED-812
chain (cohort/session linkage, peer_led gate, lock cutoff, group
membership) and written inside a single transaction so the finalize
click is atomic. Each per-session write also records a
session_audit_log row.

Once finalized, subsequent edits go through the existing per-cell
endpoint `PUT /api/cohorts/:cohortId/sessions/:sessionId/leader`.

Gated by the `live_session_delivery` feature flag.

## Path parameters

- `cohortId` string, uuid, required

## Request body

- object
  - `assignments` object[], required
    - `session_id` string, uuid, required
    - `leader_id` string, uuid, required

## Response `200`

Rotation finalized; response carries finalized_count and the refreshed grid.

## Other responses

- `401`: Unauthorized
- `404`: Feature flag is off OR cohort/session not found.
- `422`: Validation error. Possible `code` values: - `not_peer_led`, `session_not_in_cohort`, `session_already_started`, `participant_not_in_group`

---

[API](https://skmtc.dev/withmedley/apis/medley-api.md) - [All operations](https://skmtc.dev/withmedley/apis/medley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/withmedley/apis/medley-api/revisions/40aaac5ca6bd?raw)
