Skip to content

Mint a short-lived resume token to reconnect to a live session (TASK-S21-003)

POST
/api/sessions/{session_id}/ws-token/resume
curl --request POST \
--url 'https://example.com/api/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/ws-token/resume?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--header 'Authorization: Bearer <token>'

Mint a 30-second single-use resume token so the browser can reconnect.

The caller must be the original session owner. The session must still be ACTIVE with ended_at IS NULL. The gateway must have a live grace context for the session (checked by the gateway when the token is used).

Authz: org member + must be the session’s user_id.

Errors

403 — caller is not the session owner. 404 — session not found in this org. 409 — session already ended. 502 — gateway error.

Audit

Appends EVT_SESSION_RESUMED with hash chain intact.

session_id
required
Session Id
string format: uuid
organization_id
required
Organization Id
string format: uuid

Successful Response

Media type application/json
ResumeTokenResponse

Response body for POST /sessions/{id}/ws-token/resume.

object
expires_at
required
Expires At
string format: date-time
resume_token
required
Resume Token
string
ws_resume_path
required
Ws Resume Path
string
Example generated
{
"expires_at": "2026-04-15T12:00:00Z",
"resume_token": "example",
"ws_resume_path": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}