Auth & Session
These endpoints require a user session (a signed-in browser or its JWT). Room API tokens cannot call
them; a personal API key may call only GET /api/users/me.
Exchange the session for a JWT
Section titled “Exchange the session for a JWT”GET /api/auth/tokenExchanges the OIDC session cookie for a short-lived bearer JWT.
{ "token": "<jwt>" }Refresh the session
Section titled “Refresh the session”POST /api/auth/refreshRefreshes the OAuth session. The app calls this automatically.
Current session
Section titled “Current session”GET /api/sessionReturns information about the current session (user, expiry).
Register / update the current user
Section titled “Register / update the current user”POST /api/auth/userAuthorization: Bearer <jwt>Creates or updates the user profile from the JWT. Side effect: accepts any pending room invitations matching the user’s email and adds them to those rooms.
Current user & rooms
Section titled “Current user & rooms”GET /api/users/meGET /api/users/me/roomsGET /api/users/me returns the profile plus a rooms array; GET /api/users/me/rooms returns the
rooms the user belongs to with userRole and counts.
{ "user": { "userId": "auth0|123456", "email": "user@example.com", "name": "John Doe", "createdAt": 1700000000000, "lastLogin": 1700000000000 }, "rooms": [{ "roomId": "aB3dEfGhIj", "name": "Survey 2026", "memberRole": "owner" }]}With a personal API key (read), GET /api/users/me answers
{ "user": { "userId", "username", "plan" }, "rooms": [...] } — never your email — and lists only the
rooms on the key’s list if it has one. GET /api/users/me/rooms stays session-only.