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

# Record Task Event

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

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.net/sipyourdrink-ltd/apis/bernstein-task-server.md) · [All operations](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sipyourdrink-ltd/bernstein-task-server/versions/86f514b4e920/schema)
