---
title: "Aggregate sessions grouped by session number (MED-702)"
method: GET
path: "/cohorts/{cohortId}/sessions/by-session-number"
tags: ["Sessions"]
---

# Aggregate sessions grouped by session number (MED-702)

`GET /cohorts/{cohortId}/sessions/by-session-number`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/cohorts/{cohortId}/sessions/by-session-number`
- Auth: none declared

Returns the cohort's sessions re-shaped for the "View by Session" toggle.
For `modality=group_coaching`, yields one entry per session number with the
session-number-level topic, aggregated attendance/engagement, and the list
of groups whose session with that number feeds into the roll-up. For
`modality=one_on_one`, yields one entry per session number with the
propagated session type, scheduled/completed counts, and the participant
row list. When `coachUserId` is supplied, the result is scoped to that
coach's assigned groups (group coaching) or assigned participants (1:1).

## Path parameters

- `cohortId` string, uuid, required

## Query parameters

- `modality` 'group_coaching' | 'one_on_one', required
- `coachUserId` string, uuid

## Response `200`

Sessions aggregated by session_number for the requested modality

## Other responses

- `400`: Missing or invalid modality
- `401`: Unauthorized
- `404`: Cohort 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)
