---
title: "Post Turn Latency"
method: POST
path: "/sessions/{session_id}/turn-latency"
tags: ["sessions"]
---

# Post Turn Latency

`POST /sessions/{session_id}/turn-latency`

## Request

- Base URL: `https://dev.whispa.net` (the document declares no server; this is the origin it was published from)
- URL: `https://dev.whispa.net/sessions/{session_id}/turn-latency`
- Auth: one of:
  - OAuth 2
    - Password
    - Token URL: `auth/bearer/login`
  - API key in cookie `access_token`

Record Leg 4 (SSE delivery) for a turn's VAQI-L sample.

The frontend posts this once per (session, turn, producer) after the
first streaming envelope for the turn arrives.  The write is an
upsert — the beacon typically races *ahead* of the orchestrator's
write of legs 1-3 (it fires on first token, the orchestrator writes
after the full analyzer pipeline), so we can't require the row to
already exist.  Silently no-ops when telemetry is disabled.

## Path parameters

- `session_id` string, uuid, required

## Request body

- TurnLatencyBeacon: Frontend beacon payload for the Leg 4 (SSE delivery) VAQI-L sample.
  - `turn_id` string, required
  - `producer` string, required
  - `delivery_ms` integer, required: Milliseconds between backend SessionEvent.created_at and the client's SSE onmessage timestamp for the first suggested-responses envelope of the turn.
  - `client_received_at_wall` integer, nullable: Client Date.now() when the envelope was received (ms since epoch).

## Response `204`

Successful Response

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/whispa/apis/whispa-api.md) - [All operations](https://skmtc.dev/whispa/apis/whispa-api/llms.txt) - [OpenAPI document](https://skmtc.dev/whispa/apis/whispa-api/revisions/12c2e4aca43c?raw)
