---
title: "Realtime Access"
method: POST
path: "/internal/realtime-access"
tags: ["internal"]
---

# Realtime Access

`POST /internal/realtime-access`

## Request

- Base URL: `https://stardrift.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://stardrift.ai/internal/realtime-access`
- Auth: none declared

Resolve a Stytch session token + trip_id into our internal user_id.

Called by Hocuspocus's `onAuthenticate` to gate WebSocket handshakes.
Returns 401 on bad token, 404 on no/insufficient trip access (the latter
delegated to `verify_trip_access` so we share rules with HTTP routes).

## Request body

- RealtimeAccessRequest
  - `token` string, required
  - `trip_id` string, required

## Response `200`

Successful Response

- RealtimeAccessResponse
  - `user_id` string, required

## Other responses

- `422`: Validation Error

---

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