---
title: "Upsert one per-agenda-section Leader Note for the peer leader (MED-1046 AC1-AC4)"
method: PUT
path: "/api/participant/sessions/{sessionId}/peer-leader-prep/leader-notes"
tags: ["Peer Leader Session Prep"]
---

# Upsert one per-agenda-section Leader Note for the peer leader (MED-1046 AC1-AC4)

`PUT /api/participant/sessions/{sessionId}/peer-leader-prep/leader-notes`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/participant/sessions/{sessionId}/peer-leader-prep/leader-notes`
- Auth: HTTP bearer

MED-1046 (E4.2a) — peer leaders inherit the coach per-section Leader
Notes ability (a non-AI self-notes field). Upserts the
(peer_leader_user_id, session, block_key) row in the shared
`coach_session_leader_notes` store. Because a peer leader facilitates
exactly one group (AC4), the note is always written with
scope='all_groups' / group_id=null — the request carries no scope or
group_id. An empty `content_html` soft-deletes the note.

The note is owned by the peer leader's own user id, which is what lets
it surface unchanged in the active-session guide panel (AC6) — that
read filters by the authenticated user id, and on `/participant/.../active`
the authenticated user IS the peer leader. No separate display path is
added (AC7).

Authorization: the caller must be the assigned `session_leader_id` for a
peer-led session. Returns 410 once the session is live (notes are a prep
surface). Independent of AI being on or off (AC5).

## Path parameters

- `sessionId` string, uuid, required

## Request body

- PeerLeaderSaveLeaderNoteRequest
  - `block_key` string, required: Agenda section key in the coach `${sectionIndex}:0` scheme. Must match so the note also renders in the active-session guide panel (MED-1046 AC6).
  - `content_html` string, required: Sanitized rich-text HTML. An empty string (or `<p></p>`) soft-deletes the note, mirroring the coach leader-notes convention.

## Response `200`

The saved note row, or `null` when an empty body soft-deleted it.

- object
  - `success` boolean
  - `data` object, nullable: The upserted coach_session_leader_notes row (null on soft-delete).

## Other responses

- `400`: Validation error (missing block_key or content_html)
- `401`: Unauthenticated
- `403`: Caller is not the assigned session leader / not peer-led
- `404`: Session not found
- `410`: Session is live — leader notes can no longer be edited

---

[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)
