{"ok":true,"service":"nexushub-api","openapi":"/openapi.json","endpoints":[{"method":"GET","path":"/health","auth":"none","summary":"Liveness probe.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"service":{"type":"string"}}},"example":"{\u0022ok\u0022:true,\u0022service\u0022:\u0022nexushub-api\u0022}"},{"method":"POST","path":"/v1/account/resolve","auth":"none","summary":"Resolve the account behind an install id.","request":{"type":"object","properties":{"installId":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022}"},{"method":"GET","path":"/v1/balance","auth":"session cookie (signed nh_session); optional unless stated","summary":"Coin balance of the caller (query installId when no session).","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"balanceCoins":{"type":"number"}}},"example":"GET /v1/balance?installId=\u003Cinstall-id\u003E"},{"method":"POST","path":"/v1/coins/credit","auth":"session cookie (signed nh_session); optional unless stated","summary":"Credit coins (idempotent by key).","request":{"type":"object","properties":{"installId":{"type":"string"},"coins":{"type":"number"},"key":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"balanceAfterCoins":{"type":"number"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022,\u0022coins\u0022:10,\u0022key\u0022:\u0022\u003Cidem-key\u003E\u0022}"},{"method":"POST","path":"/v1/coins/purchase","auth":"session cookie (signed nh_session); optional unless stated","summary":"Record a coin purchase.","request":{"type":"object","properties":{"installId":{"type":"string"},"coins":{"type":"number"},"key":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"balanceAfterCoins":{"type":"number"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022,\u0022coins\u0022:100,\u0022key\u0022:\u0022\u003Cidem-key\u003E\u0022}"},{"method":"POST","path":"/v1/coins/debit","auth":"session cookie (signed nh_session); optional unless stated","summary":"Spend coins (idempotent by key).","request":{"type":"object","properties":{"installId":{"type":"string"},"coins":{"type":"number"},"key":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"balanceAfterCoins":{"type":"number"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022,\u0022coins\u0022:5,\u0022key\u0022:\u0022\u003Cidem-key\u003E\u0022}"},{"method":"GET","path":"/v1/highscores/{game}","auth":"none","summary":"Top 10 scores of a game.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"game":{"type":"string"},"top":{"type":"array"}}},"example":"GET /v1/highscores/atomarium"},{"method":"POST","path":"/v1/highscores/{game}","auth":"session cookie (signed nh_session); optional unless stated","summary":"Submit a score.","request":{"type":"object","properties":{"installId":{"type":"string"},"score":{"type":"number"},"name":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"rank":{"type":"number"},"personalBest":{"type":"boolean"},"top":{"type":"array"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022,\u0022score\u0022:1200,\u0022name\u0022:\u0022Player\u0022}"},{"method":"GET","path":"/v1/catalogue","auth":"none","summary":"Apps in the portfolio (aliases /v1/apps, /v1/lobby/catalogue).","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"apps":{"type":"array"},"count":{"type":"number"}}},"example":"GET /v1/catalogue"},{"method":"POST","path":"/v1/pair/new","auth":"none","summary":"Website asks for a QR pairing token.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"token":{"type":"string"}}},"example":"{}"},{"method":"POST","path":"/v1/pair/claim","auth":"none","summary":"App claims a pairing token.","request":{"type":"object","properties":{"token":{"type":"string"},"installId":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022token\u0022:\u0022\u003Ctoken\u003E\u0022,\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022}"},{"method":"GET","path":"/v1/pair/status","auth":"none","summary":"Website polls a pairing token.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"string"}}},"example":"GET /v1/pair/status?token=\u003Ctoken\u003E"},{"method":"POST","path":"/v1/rooms","auth":"session cookie (signed nh_session); optional unless stated","summary":"Create a game room; /v1/rooms/{code}/{action} joins/starts.","request":{"type":"object","properties":{"installId":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"room":{"type":"object"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022}"},{"method":"GET","path":"/v1/rooms/{code}","auth":"none","summary":"Read a room\u0027s public state.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"room":{"type":"object"}}},"example":"GET /v1/rooms/ABCD"},{"method":"POST","path":"/v1/login","auth":"none","summary":"Sign in (also /login on the site host).","request":{"type":"object","properties":{"installId":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022}"},{"method":"POST","path":"/v1/logout","auth":"session cookie (signed nh_session); optional unless stated","summary":"Sign out.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{}"},{"method":"GET","path":"/v1/session","auth":"session cookie (signed nh_session); optional unless stated","summary":"Who am I.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"authenticated":{"type":"boolean"}}},"example":"GET /v1/session"},{"method":"GET","path":"/v1/subscription","auth":"session cookie (signed nh_session); optional unless stated","summary":"Subscriber flag of the caller.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"subscribed":{"type":"boolean"}}},"example":"GET /v1/subscription"},{"method":"POST","path":"/v1/subscription/report","auth":"session cookie (signed nh_session); optional unless stated","summary":"App reports its subscription state.","request":{"type":"object","properties":{"installId":{"type":"string"},"subscribed":{"type":"boolean"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022,\u0022subscribed\u0022:true}"},{"method":"GET","path":"/v1/coins/history","auth":"session cookie required","summary":"Coin history of the caller.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"entries":{"type":"array"}}},"example":"GET /v1/coins/history"},{"method":"GET","path":"/v1/entitlement","auth":"session cookie (signed nh_session); optional unless stated","summary":"Entitlement decision of the caller.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"state":{"type":"string"}}},"example":"GET /v1/entitlement"},{"method":"POST","path":"/v1/entitlement/first-run","auth":"session cookie (signed nh_session); optional unless stated","summary":"Record first run of an app.","request":{"type":"object","properties":{"installId":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022installId\u0022:\u0022\u003Cinstall-id\u003E\u0022}"},{"method":"POST","path":"/v1/subscription/purchase","auth":"session cookie (signed nh_session); optional unless stated","summary":"Record a subscription purchase.","request":{"type":"object","properties":{"purchaseToken":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022purchaseToken\u0022:\u0022\u003Ctoken\u003E\u0022}"},{"method":"POST","path":"/v1/trial/touch","auth":"none","summary":"Start or touch this device\u0027s trial.","request":{"type":"object","properties":{"deviceId":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022deviceId\u0022:\u0022\u003Cdevice-id\u003E\u0022}"},{"method":"GET","path":"/v1/trial/status","auth":"none","summary":"Trial status of this device.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"active":{"type":"boolean"}}},"example":"GET /v1/trial/status"},{"method":"POST","path":"/v1/trial/link","auth":"session cookie required","summary":"Link this device\u0027s trial to the signed-in account.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{}"},{"method":"POST","path":"/v1/account/play-provision","auth":"none","summary":"Provision an account from a Play sign-in.","request":{"type":"object","properties":{"token":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022token\u0022:\u0022\u003Cplay-token\u003E\u0022}"},{"method":"GET","path":"/v1/account/play-install/nonce","auth":"none","summary":"Nonce for a Play Integrity install proof.","request":{"type":"object","properties":{}},"response":{"type":"object","properties":{"ok":{"type":"boolean"},"nonce":{"type":"string"}}},"example":"GET /v1/account/play-install/nonce"},{"method":"POST","path":"/v1/account/play-install","auth":"none","summary":"Prove a Play install (Integrity token).","request":{"type":"object","properties":{"nonce":{"type":"string"},"integrityToken":{"type":"string"}}},"response":{"type":"object","properties":{"ok":{"type":"boolean"}}},"example":"{\u0022nonce\u0022:\u0022\u003Cnonce\u003E\u0022,\u0022integrityToken\u0022:\u0022\u003Ctoken\u003E\u0022}"}]}