{"openapi":"3.1.0","info":{"title":"clubsandwich auth","description":"Authentication and token issuance for clubsandwich, a private-server reimplementation\nof the Rec Room backend.","version":"1.0.0"},"servers":[{"url":"https://auth.clubsandwich.dev","description":"Production"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"An `access_token` from `POST /connect/token`."}}},"paths":{"/eac/challenge":{"get":{"operationId":"getEacChallenge","tags":["EAC"],"summary":"Easy Anti-Cheat challenge","description":"Returns a constant JSON-quoted string (`\"AA==\"`) as `text/plain`. Anti-cheat is not implemented; this exists so the client's EAC handshake succeeds.","responses":{"200":{"description":"The challenge, JSON-quoted, as text/plain","content":{"text/plain":{"schema":{"type":"string","example":"\"AA==\""}}}}}}},"/cachedlogin/forplatformid/{platform}/{id}":{"get":{"operationId":"getCachedloginForplatformidByPlatformById","tags":["Cached login"],"summary":"Accounts linked to a platform id","description":"Accounts the client may offer on its login screen for this platform identity — the links this identity has, so an entry here is always redeemable by a `cached_login` grant (both read the same table). An account linked to several platforms appears in each of their pickers. An unknown id yields `[]` (not a 404) and the client falls back to a fresh login or create_account. EXCEPT the exact identity `1/1` (Oculus, id `1`), which is stubbed for SIDELOADED APKs: with no Meta SDK they have no real identity to ask about and stall on an empty picker. It consults nothing and returns one canned, non-redeemable entry with `requirePassword: true`, sending the build to username/password login. Older clients GET this; the 20250424.01 build POSTs it with a `deviceId` / `platformAuth` / `time` form body attesting the platform session. That body is accepted and ignored — both methods answer identically from the path params.","parameters":[{"name":"platform","in":"path","required":true,"description":"PlatformType integer. A non-numeric value matches the id on any platform.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Platform-native id — a SteamID64 for Steam, a user id for Meta.","schema":{"type":"string"}}],"responses":{"200":{"description":"Matching accounts; `[]` if none. The canned entry for `1/1`.","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"platform":{"anyOf":[{"type":"number","const":-1},{"type":"integer","minimum":0,"maximum":101}],"description":"-1 All, 0 Steam, 1 Oculus, 2 PlayStation, 3 Xbox, 4 RecNet, 5 IOS, 6 GooglePlay, 7 Standalone, 8 Pico, 101 Discord"},"platformId":{"type":"string","description":"The linked platform-native id — a SteamID64 for Steam, a user id for Meta"},"accountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Post this back as `account_id` on a cached_login grant","example":12345},"lastLoginTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Falls back to the account's createdAt"},"requirePassword":{"type":"boolean","const":false,"description":"Always false — platform ownership is the credential for a cached login"}},"required":["platform","platformId","accountId","lastLoginTime","requirePassword"]},{"type":"object","properties":{"platform":{"anyOf":[{"type":"number","const":-1},{"type":"integer","minimum":0,"maximum":101}],"description":"-1 All, 0 Steam, 1 Oculus, 2 PlayStation, 3 Xbox, 4 RecNet, 5 IOS, 6 GooglePlay, 7 Standalone, 8 Pico, 101 Discord"},"platformId":{"type":"string","description":"The linked platform-native id — a SteamID64 for Steam, a user id for Meta"},"accountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Post this back as `account_id` on a cached_login grant","example":12345},"lastLoginTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Falls back to the account's createdAt"},"requirePassword":{"type":"boolean","const":true,"description":"Always true — the entry is not platform-backed"}},"required":["platform","platformId","accountId","lastLoginTime","requirePassword"]}]}}}}}}},"post":{"operationId":"postCachedloginForplatformidByPlatformById","tags":["Cached login"],"summary":"Accounts linked to a platform id","description":"Accounts the client may offer on its login screen for this platform identity — the links this identity has, so an entry here is always redeemable by a `cached_login` grant (both read the same table). An account linked to several platforms appears in each of their pickers. An unknown id yields `[]` (not a 404) and the client falls back to a fresh login or create_account. EXCEPT the exact identity `1/1` (Oculus, id `1`), which is stubbed for SIDELOADED APKs: with no Meta SDK they have no real identity to ask about and stall on an empty picker. It consults nothing and returns one canned, non-redeemable entry with `requirePassword: true`, sending the build to username/password login. Older clients GET this; the 20250424.01 build POSTs it with a `deviceId` / `platformAuth` / `time` form body attesting the platform session. That body is accepted and ignored — both methods answer identically from the path params.","parameters":[{"name":"platform","in":"path","required":true,"description":"PlatformType integer. A non-numeric value matches the id on any platform.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Platform-native id — a SteamID64 for Steam, a user id for Meta.","schema":{"type":"string"}}],"responses":{"200":{"description":"Matching accounts; `[]` if none. The canned entry for `1/1`.","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"platform":{"anyOf":[{"type":"number","const":-1},{"type":"integer","minimum":0,"maximum":101}],"description":"-1 All, 0 Steam, 1 Oculus, 2 PlayStation, 3 Xbox, 4 RecNet, 5 IOS, 6 GooglePlay, 7 Standalone, 8 Pico, 101 Discord"},"platformId":{"type":"string","description":"The linked platform-native id — a SteamID64 for Steam, a user id for Meta"},"accountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Post this back as `account_id` on a cached_login grant","example":12345},"lastLoginTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Falls back to the account's createdAt"},"requirePassword":{"type":"boolean","const":false,"description":"Always false — platform ownership is the credential for a cached login"}},"required":["platform","platformId","accountId","lastLoginTime","requirePassword"]},{"type":"object","properties":{"platform":{"anyOf":[{"type":"number","const":-1},{"type":"integer","minimum":0,"maximum":101}],"description":"-1 All, 0 Steam, 1 Oculus, 2 PlayStation, 3 Xbox, 4 RecNet, 5 IOS, 6 GooglePlay, 7 Standalone, 8 Pico, 101 Discord"},"platformId":{"type":"string","description":"The linked platform-native id — a SteamID64 for Steam, a user id for Meta"},"accountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Post this back as `account_id` on a cached_login grant","example":12345},"lastLoginTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Falls back to the account's createdAt"},"requirePassword":{"type":"boolean","const":true,"description":"Always true — the entry is not platform-backed"}},"required":["platform","platformId","accountId","lastLoginTime","requirePassword"]}]}}}}}}}},"/cachedlogin/forplatformids":{"post":{"operationId":"postCachedloginForplatformids","tags":["Cached login"],"summary":"Bulk cached-login lookup (friends resolution)","description":"Resolves many platform ids at once. Results are flattened across all ids, so the response cannot be mapped back to a specific input id — the client uses each entry’s own `platformId`. No platform accompanies these ids, so each matches on any platform. Unknown ids contribute nothing; a body with no `id` yields `[]`.","requestBody":{"description":"Repeated `id=` form fields","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Repeated `id=` form fields"}},"required":["id"]}}}},"responses":{"200":{"description":"Flattened accounts across every id","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"platform":{"anyOf":[{"type":"number","const":-1},{"type":"integer","minimum":0,"maximum":101}],"description":"-1 All, 0 Steam, 1 Oculus, 2 PlayStation, 3 Xbox, 4 RecNet, 5 IOS, 6 GooglePlay, 7 Standalone, 8 Pico, 101 Discord"},"platformId":{"type":"string","description":"The linked platform-native id — a SteamID64 for Steam, a user id for Meta"},"accountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Post this back as `account_id` on a cached_login grant","example":12345},"lastLoginTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"Falls back to the account's createdAt"},"requirePassword":{"type":"boolean","const":false,"description":"Always false — platform ownership is the credential for a cached login"}},"required":["platform","platformId","accountId","lastLoginTime","requirePassword"]}}}}}}}},"/.well-known/openid-configuration":{"get":{"operationId":"getWellKnownOpenidConfiguration","tags":["OIDC"],"summary":"OpenID Provider configuration","description":"Minimal discovery document for the website OIDC flow (authorization code + PKCE S256).","responses":{"200":{"description":"OpenID Provider Metadata","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/connect/authorize":{"get":{"operationId":"getConnectAuthorize","tags":["OIDC"],"summary":"OIDC authorize — login page or error","description":"Authorization Code + PKCE (S256) entry point for the website. Validates `client_id` / `redirect_uri` / `response_type=code` / PKCE, then serves an HTML username/password form. Successful login POSTs to `/connect/authorize/login` and redirects to `redirect_uri` with `code` and `state`.","responses":{"200":{"description":"Login HTML"},"302":{"description":"Error redirect to redirect_uri when safe"},"400":{"description":"Invalid redirect_uri or request (HTML)"}}}},"/connect/authorize/login":{"post":{"operationId":"postConnectAuthorizeLogin","tags":["OIDC"],"summary":"OIDC authorize — submit login","description":"Form POST from the authorize login page. Verifies username/password, mints a single-use authorization code bound to the PKCE challenge and redirect_uri, then 302s to redirect_uri with code and state.","responses":{"200":{"description":"Login HTML re-shown on credential error"},"302":{"description":"Redirect to redirect_uri with code or error"},"400":{"description":"Invalid redirect_uri (HTML)"}}}},"/connect/userinfo":{"get":{"operationId":"getConnectUserinfo","tags":["OIDC"],"summary":"OIDC UserInfo","description":"Returns the subject and username for a valid bearer access token.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"UserInfo claims","content":{"application/json":{"schema":{"type":"object","properties":{"sub":{"type":"string","description":"Account id"},"preferred_username":{"type":"string"},"name":{"type":"string"}},"required":["sub"]}}}},"401":{"description":"Missing or invalid bearer token"}}}},"/connect/deviceauthorization":{"post":{"operationId":"postConnectDeviceauthorization","tags":["Token"],"summary":"Start a Rec Room Studio device login","description":"RFC 8628 device authorization, called by Rec Room Studio (not the game). The editor POSTs `client_id=recroom.studio` and its embedded client secret to the Auth host. The response `verification_uri` is the website (`WWW /device`); `verification_uri_complete` is that page with `?user_code=` and is what Studio opens in the browser. Studio then polls `POST /connect/token` with `grant_type=urn:ietf:params:oauth:grant-type:device_code`.","requestBody":{"description":"`client_id` and `client_secret`","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"`recroom.studio`"},"client_secret":{"type":"string","description":"The secret compiled into Rec Room Studio"}},"required":["client_id","client_secret"]}}}},"responses":{"200":{"description":"Codes and the WWW page to open","content":{"application/json":{"schema":{"type":"object","properties":{"device_code":{"type":"string"},"user_code":{"type":"string","description":"Shown in the editor; also on verification_uri_complete"},"verification_uri":{"type":"string","description":"WWW `/device`, without the code"},"verification_uri_complete":{"type":"string","description":"The URL Studio opens in the browser, `verification_uri?user_code=`"},"expires_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Seconds until the code dies. Studio treats this as seconds","example":12345},"interval":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Seconds Studio waits between polls","example":12345}},"required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"]}}}},"400":{"description":"client_id or client_secret was not the Studio editor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_grant","invalid_request","invalid_client","server_error","authorization_pending","expired_token","access_denied"]},"error_description":{"type":"string"}},"required":["error","error_description"]}}}}}}},"/connect/device/approve":{"post":{"operationId":"postConnectDeviceApprove","tags":["Token"],"summary":"Approve a Studio device code","description":"Called by the website (`WWW /device`) with the signed-in player’s bearer token and the `user_code` Studio is showing. The editor’s next poll of `/connect/token` then receives that account’s token.","security":[{"bearerAuth":[]}],"requestBody":{"description":"The user_code from the editor","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"user_code":{"type":"string","description":"The code Studio is showing, spaces and hyphens ignored"}},"required":["user_code"]}}}},"responses":{"200":{"description":"The code is approved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"description":"Unknown, expired, or already used code","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_grant","invalid_request","invalid_client","server_error","authorization_pending","expired_token","access_denied"]},"error_description":{"type":"string"}},"required":["error","error_description"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/connect/device/deny":{"post":{"operationId":"postConnectDeviceDeny","tags":["Token"],"summary":"Deny a Studio device code","description":"Same caller as approve. Studio’s next poll fails with `access_denied` instead of signing in.","security":[{"bearerAuth":[]}],"requestBody":{"description":"The user_code from the editor","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"user_code":{"type":"string","description":"The code Studio is showing, spaces and hyphens ignored"}},"required":["user_code"]}}}},"responses":{"200":{"description":"The code is denied","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"]}}}},"400":{"description":"Unknown, expired, or already used code","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_grant","invalid_request","invalid_client","server_error","authorization_pending","expired_token","access_denied"]},"error_description":{"type":"string"}},"required":["error","error_description"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/connect/token":{"post":{"operationId":"postConnectToken","tags":["Token"],"summary":"OAuth token endpoint — issues a JWT","description":"Issues an access token (plus a single-use refresh token) for one of five grants,\nselected by `grant_type`. Every grant returns the same body on success.\n\n**`create_account`** — mints a new account with an auto-assigned random username\n(players do not pick one initially) and places it in the Orientation room. A posted\n`password` becomes the login credential. Without a `platform` this is a PASSWORD\naccount (what the website makes), accepted only while `PASSWORD_SIGNUP` is on —\noff by default, refused as `invalid_grant` \"password signup is disabled\". Subject\nto three independent signup caps,\nper verified platform id, per signup IP and per client `device_id`\n(`MAX_ACCOUNTS_PER_PLATFORM_ID` / `MAX_ACCOUNTS_PER_IP` / `MAX_ACCOUNTS_PER_DEVICE_ID`;\nany disabled by setting it to 0). If it asserts a\n`platform`, that platform must be verifiable (Steam or Meta) and its `platform_auth`\nmust verify.\n\n**`cached_login`** — logs into an already-linked account using platform ownership as\nthe credential; no password. Requires a verifying `platform_auth`, and the posted\n`account_id` must be LINKED to exactly the identity it proves. An account with no\nlink for that identity cannot be cached-logged-into.\n\n**`refresh_token`** — redeems a stored single-use refresh token, rotating it. The\nplatform and platform id come from what was stored at issue time, not the body.\n\n**`authorization_code`** — website OIDC exchange. Redeems a single-use code from\n`/connect/authorize` with PKCE S256 (`code_verifier`), matching `redirect_uri` and\n`client_id`. Tokens are stamped as platform RecNet (4).\n\n**`password`** (the fallback for any unrecognised or absent `grant_type`) —\nidentifies the account by `username` or numeric `account_id` and requires the\nmatching `password`. An account with no stored hash cannot be logged into at all,\nwhich is what closes id/username-only takeover. When it also posts a `platform_auth`\nthat verifies, that identity is LINKED to the account — this is how a player who\nsigned up on one platform gets a cached login on a second device. The login is\nnever failed over the link: an unverifiable proof (or one over the per-identity\ncap) just leaves the account without a cached login there.\n\n**Platform identity.** An account can be reached from several platform identities;\nthe links are the one thing both the picker and `cached_login` consult, and only a\nVERIFIED identity is ever linked. Two platforms can be verified. Steam (`0`) posts a\nSteam-signed `platform_auth` ticket, checked offline; the SteamID64 it carries\nreplaces the client-supplied `platform_id`. Meta/Oculus (`1`) posts `platform_auth`\nas `{\"Nonce\":…,\"AppId\":…}`, which clubsandwich sends to Meta together with the posted\n`platform_id` — validation is what binds the nonce to that user id, so a spoofed id\nfails. Meta logins therefore need the app secret (`META_APP_SECRET`) and answer 500\nwhen it is unset. The first identity linked also becomes the account’s primary\n(what the account DTO and a refreshed token report); later ones only link.\n\nThe one platform id that is never verified and never linked is `1` on platform `1`\n— what a SIDELOADED Oculus APK reports, having no Meta SDK to ask. Every such\nbuild reports it, so it identifies nobody. A password login that carries it still\nsucceeds; it simply links nothing, and the player types their password each launch.\n\n**Roles.** The token embeds a `role` claim from the account, so developer/moderator\npowers refresh on every login and every refresh grant. `junior` rides along for an\naccount flagged `isJunior`, and `screenshare` is on every token — it is a feature\ngate the client reads, not a privilege anyone is granted. `betastudio` is stamped\nfrom the account’s `hasStudio` flag (staff set it on the website). RecFlare Studio\ntreats that claim as permission to upload; `developer` does not confer it. A junior\nalso carries\nthe `rn.privilege` CLAIM (`BanVChat`, `BanRmChat`) — scope-shaped name, but the\nclient reads it as a claim beside `role`, and it is absent for everyone else.\n\n**Bans.** A BLOCKED account still gets a token — every grant, including a refresh,\nand whether the ban is its own or reaches it through the evasion arms.\nA ban is a `report` row with `banned` set (the `api` worker owns that table); it\nlifts on its own when `ban_expires` passes, and never if that is null. The token\nis what lets the client reach `api`’s `/api/PlayerReporting/v1/moderationBlockDetails`\nand show the player the block screen that explains the ban; the ban itself is\nenforced by `match`, which refuses every matchmake but the caller’s own dorm, so a\ntoken gets them as far as that screen and no further.\n\nBan EVASION — an account sharing a PROVEN platform identity (a `platform_account`\nlink) or an IP (`signupIp`/`lastLoginIp`, or the address this request came from)\nwith a banned one — signs in the same way, and is stopped at matchmaking like any\nother blocked account. Those two arms are the operator’s `BAN_EVASION_MATCH` knob\n(`ip`, `platform`, or `off`).\n\nWhat IS refused here (`invalid_grant`) is a `create_account` carrying either link,\nrefused BEFORE it mints anything: making a NEW account to evade with is a different\nact from signing into one. The description is deliberately vague — the signup\nrefused may belong to a housemate of the banned player rather than to them.\n\n**Rollout gate.** A grant whose `ver` names a build under staged rollout\n(`ROLLOUT_GAME_VERSIONS`, currently `20260323` — every point release of it) is refused as `invalid_grant` \"this build is limited to\nDiscord supporters\" when the operator’s `DISCORD_ROLLOUT_ROLE_IDS` names at least\none role and the account’s Discord link (made by the website’s benefits claim)\nholds none of them. With none configured the gate is off — anyone may sign in,\nand the build still gets the rollout voice pool from `match`. `create_account` on\nan armed gate is refused before it mints anything, since a new account has no\nDiscord link. Grants posting no `ver` (a refresh, the website) and every other\nbuild are untouched.","requestBody":{"description":"Union of all grants; see the description for per-grant requirements","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","enum":["create_account","cached_login","refresh_token","password","authorization_code","urn:ietf:params:oauth:grant-type:device_code"],"description":"Anything unrecognised (including absent) is treated as a password grant, except the Studio device-code URN, which polls a code from POST /connect/deviceauthorization. `authorization_code` is the website OIDC exchange (PKCE S256)."},"account_id":{"description":"Numeric account id, as a string","type":"string"},"username":{"description":"Password grant alternative to account_id; case-insensitive, trimmed","type":"string"},"password":{"description":"Required on a password grant. On create_account, sets the initial password","type":"string"},"platform":{"description":"PlatformType as an integer string","type":"string"},"platform_id":{"description":"On Steam, unverified and ignored in favour of the id the ticket carries. On Meta it is the id the nonce is validated against, so it must be the real (numeric) user id","type":"string"},"platform_auth":{"description":"Platform proof, required for cached_login and platform create_account, and used to link the identity on a password grant. Steam: `{\"Ticket\":\"<hex>\",\"AppId\":…}`. Meta: `{\"Nonce\":…,\"AppId\":…,\"Source\":…}`","type":"string"},"login_context":{"description":"Opaque, client-chosen; echoed on every retry of a sign-in held for a second factor, so the retries are counted against the same pending sign-in","type":"string"},"2fa_code":{"description":"Password grant retry after `continue_2fa`: the authenticator app's 6 digits","type":"string"},"security_code":{"description":"Password grant retry after `security_code required`: the emailed 6 digits","type":"string"},"require_password":{"description":"`true` when the client insists on a password grant; accepted and unused","type":"string"},"refresh_token":{"description":"Required on a refresh_token grant","type":"string"},"code":{"description":"Required on an authorization_code grant","type":"string"},"redirect_uri":{"description":"Must match the redirect_uri used at authorize (authorization_code grant)","type":"string"},"code_verifier":{"description":"PKCE verifier (authorization_code grant)","type":"string"},"client_id":{"description":"OIDC client id (authorization_code grant); `recroom.studio` on a device grant","type":"string"},"client_secret":{"description":"Studio device grant: the secret embedded in the editor","type":"string"},"device_code":{"description":"Studio device-code grant: the device_code from /connect/deviceauthorization","type":"string"},"device_id":{"description":"Client-chosen, unverified. Recorded on the account, never trusted","type":"string"},"device_class":{"description":"Integer string; defaults to 0","type":"string"},"ver":{"description":"The client’s build, e.g. `20250718.01`. Stamped into the token’s `rn.ver` claim and read back by `match` when it writes presence, so a player reports the build they are running. Absent (or empty) falls back to the server’s GAME_VERSION","type":"string"}},"required":["grant_type"]}}}},"responses":{"200":{"description":"Access token, refresh token and granted scopes","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","description":"Signed JWT; `sub` is the account id"},"expires_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Access-token lifetime in seconds (TOKEN_TTL_SECONDS)","example":12345},"token_type":{"type":"string","const":"Bearer"},"refresh_token":{"type":"string","description":"Single-use; redeem via grant_type=refresh_token, which rotates it"},"scope":{"type":"string","description":"Space-separated granted scopes"},"key":{"type":"string","description":"@kludge Constant the client appears to require. Purpose unknown."}},"required":["access_token","expires_in","token_type","refresh_token","scope","key"]}}}},"400":{"description":"Unusable grant: bad credentials, an unverifiable platform or platform_auth, an invalid/expired refresh token, a missing account identifier, a signup cap reached, or an account sharing a banned one’s device or network","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_grant","invalid_request","invalid_client","server_error","authorization_pending","expired_token","access_denied"]},"error_description":{"type":"string"}},"required":["error","error_description"]}}}},"500":{"description":"The server is missing a secret it cannot proceed without: JWT_SECRET (a token is refused rather than signed with an empty key) or, on a Meta login, META_APP_SECRET (no nonce can be validated without it).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_grant","invalid_request","invalid_client","server_error","authorization_pending","expired_token","access_denied"]},"error_description":{"type":"string"}},"required":["error","error_description"]}}}}}}},"/account/me/2fa":{"get":{"operationId":"getAccountMe2fa","tags":["Account"],"summary":"The caller's two-factor sign-in settings","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Which second factor, if any, the password grant asks for","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["none","totp","email"],"description":"The second factor the password grant asks for; `none` when it asks for none"},"totpPending":{"type":"boolean","description":"An authenticator is being set up and waits on a code to confirm it"},"hasEmail":{"type":"boolean","description":"The account has a confirmed address, which `email` needs"},"hasPassword":{"type":"boolean","description":"Two-factor guards the password grant, so it needs one"}},"required":["method","totpPending","hasEmail","hasPassword"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/account/me/2fa/totp":{"post":{"operationId":"postAccountMe2faTotp","tags":["Account"],"summary":"Start setting up an authenticator app","description":"Generates a secret and returns it with its `otpauth://` URI. Nothing changes about sign-in until `POST /account/me/2fa/totp/confirm` posts a code from it. Refused while any second factor is on. Calling again replaces the pending secret.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The secret to load into the app","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"secret":{"type":"string","description":"Base32 secret, for typing in by hand"},"uri":{"type":"string","description":"`otpauth://totp/…` — render as a QR code for the app to scan"}},"required":["success","secret","uri"]}}}},"400":{"description":"A second factor is already on","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/account/me/2fa/totp/confirm":{"post":{"operationId":"postAccountMe2faTotpConfirm","tags":["Account"],"summary":"Turn on authenticator-app sign-in","description":"Confirms the pending secret with a `code` from the app and the account `password`; from then on the password grant answers `continue_2fa` until it is re-posted with a `2fa_code`.","security":[{"bearerAuth":[]}],"requestBody":{"description":"Password and a code from the app","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"The account's current password"},"code":{"description":"Confirming an authenticator: a code from it. Turning off an authenticator: a current code","type":"string"}},"required":["password"]}}}},"responses":{"200":{"description":"Authenticator sign-in is on","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"400":{"description":"Wrong password or code, or nothing pending","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/account/me/2fa/email":{"post":{"operationId":"postAccountMe2faEmail","tags":["Account"],"summary":"Turn on emailed security codes at sign-in","description":"Needs a confirmed address on the account and its `password`. From then on the password grant emails a code and answers `security_code required` until it is re-posted with a `security_code`.","security":[{"bearerAuth":[]}],"requestBody":{"description":"The account password","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"The account's current password"},"code":{"description":"Confirming an authenticator: a code from it. Turning off an authenticator: a current code","type":"string"}},"required":["password"]}}}},"responses":{"200":{"description":"Emailed codes are on","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"400":{"description":"Wrong password, no address, or a factor is already on","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/account/me/2fa/disable":{"post":{"operationId":"postAccountMe2faDisable","tags":["Account"],"summary":"Turn two-factor sign-in off","description":"Needs the account `password`, and with an authenticator on, a current `code` from it. Forgets the authenticator secret.","security":[{"bearerAuth":[]}],"requestBody":{"description":"Password, plus an authenticator code if one is on","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"The account's current password"},"code":{"description":"Confirming an authenticator: a code from it. Turning off an authenticator: a current code","type":"string"}},"required":["password"]}}}},"responses":{"200":{"description":"Two-factor sign-in is off","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"400":{"description":"Wrong password or code","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/account/me/changepassword":{"post":{"operationId":"postAccountMeChangepassword","tags":["Account"],"summary":"Change the caller's password","description":"Stores a PBKDF2 hash on the account row; the raw password is never persisted. When the account already has a password, `oldPassword` must match. The first time a password is set, `oldPassword` is empty — which is what the client sends.","security":[{"bearerAuth":[]}],"requestBody":{"description":"New password, plus the old one when one is set","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"newPassword":{"type":"string","description":"Required; empty is rejected"},"oldPassword":{"description":"Must match when the account already has a password; empty when first setting it","type":"string"}},"required":["newPassword"]}}}},"responses":{"200":{"description":"Password changed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"400":{"description":"`newPassword` was empty, or `oldPassword` was wrong","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]}}}},"401":{"description":"Missing or invalid bearer token (empty body)"},"404":{"description":"The account no longer exists (empty body)"}}}},"/privileges/me/restrictions":{"get":{"operationId":"getPrivilegesMeRestrictions","tags":["Account"],"summary":"The caller’s moderation restrictions","description":"The restrictions in force on the caller’s account (a chat mute, say), as a bare array. Always EMPTY here — nothing on this server issues restrictions — and an empty array is the normal unrestricted answer, not null. The client refills its list from this and acts on a record being present and its `EndDate`; the `Name`/`Description`/ `DisplayReason` strings are display text it matches nothing against.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The caller’s restrictions — always empty","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"AccountId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The restricted account","example":12345},"Name":{"type":"string","description":"Display name of the restriction, e.g. `Chat Mute`. Free text"},"Description":{"type":"string","description":"What the player may no longer do. Free text"},"EndDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When it lifts (ISO 8601 UTC); null for one that never does"},"AssociatedAccountId":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"example":12345},{"type":"null"}],"description":"The other account involved, when there is one"},"AssociatedAccountUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"ReportCategory":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"ReportCategory: -1 Moderator · 0 Unknown · 1 DEPRECATED_MicrophoneAbuse · 2 Harassment · 3 Cheating · 4 DEPRECATED_ImmatureBehavior · 5 AFK · 6 Misc · 7 Underage · 10 VoteKick · 11 MisleadingPurchases · 100 CoC_Underage · 101 CoC_Sexual · 102 CoC_Discrimination · 103 CoC_Trolling · 104 CoC_NameOrProfile · 200 InappropriateClothing · 1000 IssuingInaccurateReports · 1100 RoomInventoryItems · 1101 InappropriateRooms · 1102 InappropriateInventions · 1103 RoomOffers · 1200 Spam","example":12345},{"type":"null"}],"description":"The category it was issued under"},"DisplayReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reason shown to the player. Free text"}},"required":["AccountId","Name","Description","EndDate","AssociatedAccountId","AssociatedAccountUsername","ReportCategory","DisplayReason"]}}}}},"401":{"description":"Missing or invalid bearer token (empty body)"}}}},"/role/developer/{id}":{"get":{"operationId":"getRoleDeveloperById","tags":["Roles"],"summary":"Whether a player has the developer role","description":"Returns a bare JSON boolean (`true`/`false`), not an object. Off by default and granted only by an operator via `runx admin grant-developer`. The same flag also rides in the access token's `role` claim, so the client rarely needs this route.\n\nThis is the ONE-player form. `/role/developer?id=` is a different question with a different answer shape — which of several players hold the role, as an array.","parameters":[{"name":"id","in":"path","required":true,"description":"Account id. A non-numeric value is treated as unknown (404).","schema":{"type":"string"}}],"responses":{"200":{"description":"`true` if the player has the developer role","content":{"application/json":{"schema":{"type":"boolean"}}}},"404":{"description":"No such player (empty body)"}}}},"/role/developer":{"get":{"operationId":"getRoleDeveloper","tags":["Roles"],"summary":"Which of these players have the developer role","description":"The subset of the accounts named by `?id=` that hold the developer role, as an ARRAY OF INTS — not a boolean, and not an object. Ids are repeated (`?id=1&id=2`), not comma-joined.\n\nIt is a FILTER, so a player who does not hold the role is simply absent from the answer, as is an id matching no account — neither is an error, and a query naming no ids answers `[]`. Results keep the order the query asked in, and a repeated id yields at most one entry.\n\nThe role is off by default and granted only by an operator via `runx admin grant-developer`.","parameters":[{"name":"id","in":"query","required":false,"description":"An account id to test, repeated once per player. Ids that are non-numeric, unknown or lack the role are left out of the answer rather than erroring.","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}},"example":["2","42"]}],"responses":{"200":{"description":"The ids, of those asked for, that hold the developer role","content":{"application/json":{"schema":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"example":12345}}}}}}}},"/role/moderator/{id}":{"get":{"operationId":"getRoleModeratorById","tags":["Roles"],"summary":"Whether a player has the moderator role","description":"Returns a bare JSON boolean (`true`/`false`), not an object. Off by default and granted only by an operator via `runx admin grant-moderator`. The same flag also rides in the access token's `role` claim, so the client rarely needs this route.\n\nThis is the ONE-player form. `/role/moderator?id=` is a different question with a different answer shape — which of several players hold the role, as an array.","parameters":[{"name":"id","in":"path","required":true,"description":"Account id. A non-numeric value is treated as unknown (404).","schema":{"type":"string"}}],"responses":{"200":{"description":"`true` if the player has the moderator role","content":{"application/json":{"schema":{"type":"boolean"}}}},"404":{"description":"No such player (empty body)"}}}},"/role/moderator":{"get":{"operationId":"getRoleModerator","tags":["Roles"],"summary":"Which of these players have the moderator role","description":"The subset of the accounts named by `?id=` that hold the moderator role, as an ARRAY OF INTS — not a boolean, and not an object. Ids are repeated (`?id=1&id=2`), not comma-joined.\n\nIt is a FILTER, so a player who does not hold the role is simply absent from the answer, as is an id matching no account — neither is an error, and a query naming no ids answers `[]`. Results keep the order the query asked in, and a repeated id yields at most one entry.\n\nThe role is off by default and granted only by an operator via `runx admin grant-moderator`.","parameters":[{"name":"id","in":"query","required":false,"description":"An account id to test, repeated once per player. Ids that are non-numeric, unknown or lack the role are left out of the answer rather than erroring.","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}},"example":["2","42"]}],"responses":{"200":{"description":"The ids, of those asked for, that hold the moderator role","content":{"application/json":{"schema":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"example":12345}}}}}}}},"/role/screenshare/{id}":{"get":{"operationId":"getRoleScreenshareById","tags":["Roles"],"summary":"Whether a player may screenshare","description":"Returns a bare JSON `true` for any existing player: `screenshare` is a feature gate on every access token, not a grant. Rec Room Studio asks it before uploading a room with a VideoPlayer.","responses":{"200":{"description":"`true`"},"404":{"description":"No such player (empty body)"}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/oculus/nonce":{"get":{"operationId":"getOculusNonce","tags":["Account"],"summary":"A fresh nonce for the Oculus login flow","description":"Mints a random 64-char hex nonce and returns it as a bare JSON string. Not stored and not verified later — a best guess at the shape the client wants.","responses":{"200":{"description":"The nonce","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}