# Group stats ## `GET /api/groups/sessions` **List group sessions** Returns open and closed group sessions, newest first. An officer must be signed in. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `limit` | query | integer | no | The maximum number of sessions to return. | | `before` | query | string (date-time) \| null | no | Only return sessions that started before this timestamp. | **Response `200` — The group sessions.** Model: array of {ref}`GroupSessionSummary ` Type: array of {ref}`GroupSessionSummary ` ## `GET /api/groups/sessions/{session_id}` **Get a group session's detail** Returns one session with who was in it and its chat, if still kept. `transcript` is null once purged or past the retention window. An officer must be signed in. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `session_id` | path | string (uuid) | yes | The session's ID. | **Response `200` — The group session's detail.** Model: {ref}`GroupSessionDetail ` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | yes | | | `kind` | {ref}`EventKind ` | yes | | | `name` | string \| null | yes | | | `channel_name` | string | yes | | | `creator` | {ref}`GroupPerson ` | yes | | | `event_id` | string (uuid) \| null | yes | | | `started_at` | string (date-time) | yes | | | `ended_at` | string (date-time) \| null | yes | | | `end_reason` | {ref}`GroupEndReason ` \| null | yes | | | `peak_size` | integer | yes | | | `grouped_minutes` | integer | yes | | | `counted` | boolean | yes | | | `has_transcript` | boolean | yes | | | `note` | string \| null | yes | | | `needs` | array of {ref}`SignupRole ` | yes | | | `members` | array of {ref}`GroupPersonStat ` | yes | | | `transcript` | array of {ref}`GroupTranscriptMessage ` \| null | yes | | | `transcript_expires_at` | string (date-time) \| null | yes | | ## `GET /api/groups/stats` **Get group stats** Returns who groups, with whom, and what, over the last `days` days. An officer must be signed in. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `days` | query | integer | no | The size of the window, in days. | **Response `200` — The group stats for the window.** Model: {ref}`GroupStats ` | Field | Type | Required | Description | |---|---|---|---| | `days` | integer | yes | | | `sessions_total` | integer | yes | | | `sessions_counted` | integer | yes | | | `grouped_minutes` | integer | yes | | | `by_kind` | array of {ref}`GroupKindStat ` | yes | | | `top_instances` | array of {ref}`GroupInstanceStat ` | yes | | | `most_grouped` | array of {ref}`GroupPersonStat ` | yes | | | `most_social` | array of {ref}`GroupPersonStat ` | yes | | | `best_duos` | array of {ref}`GroupDuoStat ` | yes | | | `most_led` | array of {ref}`GroupPersonStat ` | yes | | | `busy_hours` | array of {ref}`GroupHourStat ` | yes | |