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

# User Realtime Access

`POST /internal/user-realtime-access`

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/fastapi.md) · [All operations](https://skmtc.dev/stardrift/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/stardrift/fastapi/revisions/00746572572a/schema)
