---
title: "Mark the prep sequence as completed (AC13)"
method: POST
path: "/api/participant/sessions/{sessionId}/peer-leader-prep/mark-completed"
tags: ["Peer Leader Session Prep"]
---

# Mark the prep sequence as completed (AC13)

`POST /api/participant/sessions/{sessionId}/peer-leader-prep/mark-completed`

## Request

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

Persists `marked_completed_at = NOW()` on the user's
`peer_leader_session_prep` row. On the user's first ever Mark
as Completed, also sets `first_prep_completed_at = NOW()` so the
AC12 first-time strong-prompt banner is suppressed on future loads.

The AC13 RSVP-intercept modal is enforced client-side (the FE
routes through `/peer-leader-rsvp` BEFORE calling this endpoint when
the rsvp_status is unconfirmed) — this endpoint does NOT inspect
rsvp state.

Forbidden once the session is live (AC4).

## Path parameters

- `sessionId` string, uuid, required

## Response `200`

Marked complete; returns refreshed prep payload.

- object
  - `success` boolean
  - `data` PeerLeaderPrepPayload
    - `session` object
      - `id` string, uuid
      - `title` string, nullable
      - `session_number` integer, nullable
      - `scheduled_start` string, date-time, nullable
      - `scheduled_end` string, date-time, nullable
      - `duration_minutes` integer, nullable
      - `timezone` string, nullable
      - `cohort_id` string, uuid
      - `cohort_name` string, nullable
      - `program_name` string, nullable
      - `organization_name` string, nullable
      - `group_id` string, uuid, nullable
      - `group_name` string, nullable
      - `status` string
      - `ai_features_enabled` boolean: MED-816/MED-909 — cohort modality AI gate. When false all AI prep surfaces are absent.
      - `ai_listening_enabled` boolean: MED-909 AC4 — current AI Listening state for this session (read-only to the peer leader).
      - `ai_listening_locked` boolean: MED-909 AC4 — true once within 15 min of scheduled_start; the listening value is frozen.
    - `prep_status` 'unlocked' | 'locked' | 'live' | 'declined': `unlocked` happy path · `locked` preceding session not complete (AC3) · `live` session already launched (AC4) · `declined` leader declined RSVP (AC1).
    - `prep_locked_reason` string, nullable
    - `rsvp_status` 'unconfirmed' | 'confirmed' | 'declined'
    - `agenda` object, nullable: AuthoredAgendaForCoach payload from MED-976. Same shape coach prep uses.
    - `reflection_status` object, nullable: Reserved — currently always null; the FE derives Step 1 status from the existing reflection endpoint instead.
    - `prep_state` object
      - `marked_completed_at` string, date-time, nullable
      - `step2_reviewed_at` string, date-time, nullable
      - `step3_visited_at` string, date-time, nullable
      - `ai_prompt_selections` object: MED-909 AC1-AC2 — peer leader's In Use prompt selections JSONB, keyed by agenda block_key. Drives the AI suggestions banner count and per-step In Use badges. Empty object when none selected yet.
    - `is_first_time_leader` boolean
    - `cm_name` string, nullable

## Other responses

- `401`: Unauthenticated
- `403`: Caller is not the assigned session leader / session already live
- `404`: Session not found

---

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