---
title: "Get read-only state for the Active Session Preview screen (MED-873, MED-965)"
method: GET
path: "/api/coach/sessions/{sessionId}/preview-state"
tags: ["Coach Active Session"]
---

# Get read-only state for the Active Session Preview screen (MED-873, MED-965)

`GET /api/coach/sessions/{sessionId}/preview-state`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/coach/sessions/{sessionId}/preview-state`
- Auth: HTTP bearer

Returns the same composite payload as `/active-state` but is the canonical
read endpoint for the Preview screen. It works for sessions in any status
(scheduled / in_progress / completed / etc.) and performs no state
transitions or domain-event emissions.

**Authorized callers:**
- Coaches assigned to the session's group (or co-coaches via
  `cohort_coaches`) — full payload as in MED-873.
- Internal staff (`internal_admin` / `internal_user`) — added in MED-965 so
  cohort managers can preview from the Session Content page. The
  coach-ownership check is skipped; structural guards still apply (must be
  a group session, modality must be coach-led). Per AC4 of MED-965,
  coach-specific fields are blanked for these callers:
  `coach_session_notes_html` → empty string,
  `coach_session_notes_updated_at` → null,
  `leader_notes` → empty array,
  `participants` → empty array,
  `coach_present` → false.

IV1 contract: calling this endpoint MUST NOT mutate session state,
advance section index, or notify participants.

## Path parameters

- `sessionId` string, uuid, required

## Response `200`

Preview state (same shape as ActiveSessionState)

- object
  - `success` boolean
  - `data` ActiveSessionState: Composite payload for the Active Session screen (one fetch per page load).
    - `session_id` string, uuid
    - `title` string
    - `session_number` integer, nullable
    - `status` 'scheduled' | 'in_progress' | 'completed' | 'cancelled' | 'rescheduled'
    - `duration_minutes` integer, nullable
    - `scheduled_start` string, date-time, nullable
    - `scheduled_end` string, date-time, nullable
    - `actual_start` string, date-time, nullable
    - `actual_end` string, date-time, nullable
    - `group_id` string, uuid, nullable
    - `group_index` integer, nullable
    - `group_name` string, nullable
    - `cohort_id` string, uuid
    - `cohort_name` string
    - `organization_name` string, nullable
    - `meeting_link` string, nullable: MED-1112 — resolved meeting link (Join video call), null for in-person
    - `modality_id` string, uuid, nullable
    - `coaching_sub_type` 'coach_led' | 'peer_led', nullable
    - `ai_features_enabled` boolean: AC7 gating signal — frontend renders the AI disclosure modal when true.
    - `sections` object[]: MED-976 (E1.3h) — authored sections from the e1.3d/e/f model (session_agenda_sections + visuals + leader_prompts). Replaces the legacy parsed_outline from MED-784. Each item carries section_name, duration_minutes, sort_order, participant_prompt, leader_prompts[] (intro_text + discussion_prompt HTML), and visuals[] (slide_page associations).
    - `slide_deck` ActiveSessionSlideDeck, nullable
      - `id` string, uuid
      - `converted_pdf_s3_key` string, nullable
      - `processing_state` 'pending' | 'processing' | 'ready' | 'failed'
      - `original_filename` string
    - `leader_notes` object[]
    - `current_section_index` integer, nullable
    - `current_section_entered_at` string, date-time, nullable
    - `section_time_seconds` object: Cumulative seconds per section, keyed by section index as string (AC5).
    - `coach_session_notes_html` string
    - `coach_session_notes_updated_at` string, date-time, nullable
    - `coach_present` boolean: MED-952 — true when any assigned coach has been seen within the presence freshness window. Drives the participant "coach stepped away" notice (false ⇒ shown). On the coach's own view this is effectively always true while polling.
    - `participants` ActiveSessionParticipant[]
      - `user_id` string, uuid
      - `display_name` string
      - `initials` string
      - `is_connected` boolean: Presence stub — full realtime presence ships with MED-804 (always false in this story).

## Other responses

- `401`: Unauthorized
- `403`: Caller is neither the assigned coach nor an internal_admin/internal_user
- `404`: Session not found OR live_session_delivery flag off

---

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