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

# User Realtime Access

`POST /internal/user-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/user-realtime-access`
- Auth: none declared

Authorize a WebSocket subscription to a `user:{user_id}` Y.Doc.

Used by Hocuspocus to gate the user-scoped notifications channel.
Allowed iff the Stytch token resolves to the same internal user as
the requested document — i.e. user A can only subscribe to user:A.

## Request body

- UserRealtimeAccessRequest
  - `token` string, required
  - `user_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)
