PATCH /api/v1/live-sessions/{liveSessionId}/attendance/{enrollmentId}
Records or corrects one enrollment's attendance at a live session that targets
the enrollment's cohort. A correction replaces the current value and needs a
reason; the previous value, the actor and the reason stay in the audit history.
| Role in the organization | This endpoint |
|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
| Requirement | Rule for this endpoint |
|---|
| Business role | None — a coach who is only MEMBER of the organization cannot record attendance |
| Resource scope | Live session and enrollment of the key's organization |
| Participation | The enrollment belongs to the cohort the live session targets |
| Resource state | The live session targets a cohort |
| Parameter | Type | Required | Description |
|---|
liveSessionId | UUID | yes | Live session of the key's organization |
enrollmentId | UUID | yes | Enrollment in the cohort targeted by that session |
| Header | Required | Description |
|---|
x-api-key | yes | API key created for this organization |
Idempotency-Key | yes | Stable key for this attendance intention |
X-Correlation-Id | no | Caller correlation id, returned or generated |
Request body
| Field | Type | Required | Nullable | Description |
|---|
status | string | yes | no | attended, absent, excused or unknown |
reason | string | conditional | yes | Up to 1000 characters, trimmed. Required for excused and to change a recorded status |
{ "status": "absent", "reason": "No show" }
curl -X PATCH "$COHORTE_API_BASE_URL/api/v1/live-sessions/$LIVE_SESSION_ID/attendance/$ENROLLMENT_ID" \
-H "x-api-key: $COHORTE_API_KEY" \
-H "Idempotency-Key: attendance-live-42-enrollment-7" \
-H 'Content-Type: application/json' \
-d '{"status":"absent","reason":"No show"}'
200 OK — the recorded attendance. replayed: true when the Idempotency-Key was already used.
400 Bad Request — missing Idempotency-Key, invalid JSON, an id that is not a UUID, an unknown status, excused without a reason, a status change without a reason, or a live session that does not target a cohort; code is invalid_request.
401 Unauthorized — missing, unknown or expired key; code is unauthorized.
403 Forbidden — the bearer is not OWNER or ADMIN; code is forbidden.
404 Not Found — the live session is unknown or belongs to another organization, or the enrollment is not in the cohort the live targets; code is not_found.
| Field | Type | Nullable | Description |
|---|
success | boolean | no | true for a successful request |
replayed | boolean | no | true when the idempotency key replayed a recording |
data.enrollmentId | UUID | no | Enrollment |
data.liveSessionId | UUID | no | Live session |
data.status | string | no | attended, absent, excused or unknown |
data.reason | string | yes | Reason recorded with the current value |
data.recordedByUserId | UUID | no | Account that recorded the current value |
data.updatedAt | ISO 8601 string | no | When the current value was recorded, in UTC |
correlationId | UUID | no | Correlation id for support |
{
"success": true,
"replayed": false,
"data": {
"enrollmentId": "4af4cd8d-0000-4000-8000-000000000000",
"liveSessionId": "b27c6e05-0000-4000-8000-000000000000",
"status": "absent",
"reason": "No show",
"recordedByUserId": "6d41ab55-0000-4000-8000-000000000000",
"updatedAt": "2026-09-25T18:02:11.000Z"
},
"correlationId": "2e9d4c70-0000-4000-8000-000000000000"
}
- Retrying with the same
Idempotency-Key returns the original result with
replayed: true and writes no second audit entry or event.
- Sending the status already recorded needs no reason; changing it does.
- The
live.attendance_recorded event is emitted after the transactional write.
No notification or intervention is created by this endpoint.
Keep one idempotency key for one normalized intention. Current authorization is checked again on retry. A different payload or resource with that key, or an older key whose intention cannot be verified, returns 409 conflict without another mutation. Inspect the original outcome before creating a new command. Identical retries do not resend notifications.