---
title: "Upsert one leader-notes entry for a specific agenda step (AC9)"
method: PUT
path: "/api/coach/sessions/{sessionId}/leader-notes"
tags: ["Coach Session Prep"]
---

# Upsert one leader-notes entry for a specific agenda step (AC9)

`PUT /api/coach/sessions/{sessionId}/leader-notes`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/coach/sessions/{sessionId}/leader-notes`
- Auth: none declared

Upserts the (coach, session, block_key, scope[, group_id]) row.
Passing an empty `content_html` soft-deletes the row.
Per AC8: scope='all_groups' shares the note across all of the coach's
groups for this session; scope='group' creates a per-group overlay.

## Path parameters

- `sessionId` string, uuid, required

## Request body

- object
  - `block_key` string, required
  - `scope` 'all_groups' | 'group', required: Whether a leader-notes row applies to all the coach's groups (shared) or a specific group overlay.
  - `group_id` string, uuid, nullable
  - `content_html` string, required: Sanitized HTML from the RichTextEditor. Empty string soft-deletes.

## Response `200`

Saved (or null if soft-deleted)

- object
  - `success` boolean
  - `data` CoachSessionLeaderNote
    - `id` string, uuid
    - `coach_user_id` string, uuid
    - `session_id` string, uuid
    - `block_key` string: Stable identifier of the agenda step the note belongs to (v1 form `section_idx:block_idx`).
    - `scope` 'all_groups' | 'group': Whether a leader-notes row applies to all the coach's groups (shared) or a specific group overlay.
    - `group_id` string, uuid, nullable: Required when scope=group; must be null when scope=all_groups.
    - `content_html` string: Sanitized HTML from the RichTextEditor.
    - `content_plain` string: Plain-text rendering used for AC13 prep-sheet PDF.
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `400`: Invalid body / scope-group_id mismatch
- `401`: Unauthorized
- `403`: Not assigned / not coach-led
- `404`: Session not found
- `410`: Session is live

---

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