---
title: "Heartbeat — mark the coach present on the active session (MED-952)"
method: POST
path: "/api/coach/sessions/{sessionId}/presence"
tags: ["Coach Active Session"]
---

# Heartbeat — mark the coach present on the active session (MED-952)

`POST /api/coach/sessions/{sessionId}/presence`

## Request

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

Lightweight presence heartbeat polled by the coach Active Session screen
(~4s cadence) while the session is `in_progress`. Refreshes the coach's
last-seen timestamp in `sessions.coach_presence` and, if the coach is
returning after the session was unattended, closes the open
`coach_absence_log` interval (AC9/AC11).

Drives the participant "coach has temporarily stepped away" notice: when
every assigned coach stops heartbeating (tab/window closed, crash, or a
deliberate Leave), the freshness window lapses and participants see the
notice within one poll. No-op when the session is not `in_progress`.

## Path parameters

- `sessionId` string, uuid, required

## Response `200`

Presence recorded

- object
  - `success` boolean
  - `data` object
    - `status` 'scheduled' | 'in_progress' | 'completed' | 'cancelled' | 'rescheduled'
    - `coach_present` boolean: True once this heartbeat is recorded (always true for an in_progress session).

## Other responses

- `401`: Unauthorized
- `403`: Coach not authorized for this session/group
- `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)
