---
title: "Record Task Event"
method: POST
path: "/graduation/{session_id}/record-event"
tags: ["graduation"]
---

# Record Task Event

`POST /graduation/{session_id}/record-event`

## Request

- Base URL: `http://127.0.0.1:8052`
- URL: `http://127.0.0.1:8052/graduation/{session_id}/record-event`
- Auth: none declared

Record a task completion or failure for graduation metric tracking.

The orchestrator or CLI calls this after each task completes/fails so
the graduation framework can accumulate per-stage metrics and determine
when the session qualifies for the next stage.

Args:
    session_id: The session that executed the task.
    body: Task event details.

Returns:
    JSON with updated stage, metrics, and graduation readiness.

Raises:
    HTTPException: 422 when *initial_stage* is not a valid stage name.

## Path parameters

- `session_id` string, required

## Request body

- RecordEventRequest: Body for recording a task completion/failure event. Attributes: task_id: Task identifier. success: Whether the task succeeded. duration_s: Task wall-clock duration in seconds. cost_usd: Estimated cost of the task in USD. initial_stage: Stage to initialise the record at when no record exists yet.
  - `task_id` string, required
  - `success` boolean, required
  - `duration_s` number
  - `cost_usd` number
  - `initial_stage` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Invalid graduation stage

---

[API](https://skmtc.dev/bernstein/apis/bernstein-task-server.md) · [All operations](https://skmtc.dev/bernstein/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc.dev/bernstein/apis/bernstein-task-server/revisions/2a20a34ad2eb?raw)
