{ "openapi": "3.1.0", "info": { "title": "Gambling API", "version": "2.0.0", "description": "Virtual chips. Account balances exclude active-hand escrow. See docs/PROTOCOL.md and docs/RULES.md." }, "servers": [ { "url": "/" } ], "paths": { "/register": { "post": { "summary": "Create a 200-chip account and session", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "username": { "type": "string" }, "token": { "type": "string" } }, "required": [ "username", "token" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "username", "password" ], "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 40, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "password": { "type": "string", "minLength": 1, "maxLength": 72 } }, "additionalProperties": false } } } } } }, "/login": { "post": { "summary": "Replace the current session", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "username": { "type": "string" }, "token": { "type": "string" } }, "required": [ "username", "token" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "username", "password" ], "properties": { "username": { "type": "string", "minLength": 1, "maxLength": 40, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "password": { "type": "string", "minLength": 1, "maxLength": 72 } }, "additionalProperties": false } } } } } }, "/verify": { "post": { "summary": "Verify a cookie or bearer session", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "valid": { "const": true }, "user": { "type": "object", "properties": { "username": { "type": "string" }, "exp": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "username", "exp" ], "additionalProperties": false } }, "required": [ "valid", "user" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ] } }, "/logout": { "delete": { "summary": "Fold/leave the lobby, revoke the session, and clear the cookie", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ] } }, "/balance": { "get": { "summary": "Current spendable chips (excludes escrow)", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "balance": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "balance" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ] } }, "/leaderboard": { "get": { "summary": "Rank spendable balances; username breaks ties", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "leaderboard": { "type": "array", "items": { "type": "object", "properties": { "username": { "type": "string" }, "money": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "username", "money" ], "additionalProperties": false } }, "self": { "type": "object", "properties": { "username": { "type": "string" }, "money": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "position": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "username", "money", "position" ], "additionalProperties": false } }, "required": [ "leaderboard", "self" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ] } }, "/lobby/create": { "post": { "summary": "lobby:create; retry the identical body/requestId after a lost response", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "lobbyId": { "type": "string" }, "username": { "type": "string" }, "type": { "type": "string" }, "requestId": { "type": "string" } }, "required": [ "lobbyId", "username", "type", "requestId" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "requestId" ], "properties": { "requestId": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{8,128}$" }, "private": { "type": "boolean" } }, "additionalProperties": false } } } } }, "get": { "summary": "Deprecated mutation method", "responses": { "405": { "description": "Use POST", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } } } }, "/lobby/join": { "post": { "summary": "lobby:join; retry the identical body/requestId after a lost response", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "lobbyId": { "type": "string" }, "username": { "type": "string" }, "type": { "type": "string" }, "requestId": { "type": "string" } }, "required": [ "lobbyId", "username", "type", "requestId" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "lobbyId", "requestId" ], "properties": { "lobbyId": { "type": "string", "pattern": "^[a-f0-9]{16}$" }, "requestId": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{8,128}$" } }, "additionalProperties": false } } } } }, "get": { "summary": "Deprecated mutation method", "responses": { "405": { "description": "Use POST", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } } } }, "/lobby/leave": { "post": { "summary": "lobby:leave; retry the identical body/requestId after a lost response", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "lobbyId": { "type": "string" }, "username": { "type": "string" }, "type": { "type": "string" }, "requestId": { "type": "string" } }, "required": [ "lobbyId", "username", "type", "requestId" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "lobbyId", "requestId" ], "properties": { "lobbyId": { "type": "string", "pattern": "^[a-f0-9]{16}$" }, "requestId": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{8,128}$" } }, "additionalProperties": false } } } } }, "get": { "summary": "Deprecated mutation method", "responses": { "405": { "description": "Use POST", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } } } }, "/poker/start": { "post": { "summary": "poker:start; retry the identical body/requestId after a lost response", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "lobbyId": { "type": "string" }, "username": { "type": "string" }, "type": { "type": "string" }, "requestId": { "type": "string" } }, "required": [ "lobbyId", "username", "type", "requestId" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "lobbyId", "requestId" ], "properties": { "lobbyId": { "type": "string", "pattern": "^[a-f0-9]{16}$" }, "requestId": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{8,128}$" } }, "additionalProperties": false } } } } }, "get": { "summary": "Deprecated mutation method", "responses": { "405": { "description": "Use POST", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } } } }, "/poker/action": { "post": { "summary": "poker:action; retry the identical body/requestId after a lost response", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "lobbyId": { "type": "string" }, "username": { "type": "string" }, "type": { "type": "string" }, "requestId": { "type": "string" } }, "required": [ "lobbyId", "username", "type", "requestId" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "lobbyId", "requestId", "action" ], "properties": { "lobbyId": { "type": "string", "pattern": "^[a-f0-9]{16}$" }, "requestId": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{8,128}$" }, "action": { "enum": [ "hit", "fold", "bet" ] }, "payload": { "type": "object", "properties": { "amount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "additionalProperties": false } }, "additionalProperties": false } } } } }, "get": { "summary": "Deprecated mutation method", "responses": { "405": { "description": "Use POST", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } } } }, "/lobby/public": { "get": { "summary": "List public lobbies", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "lobbies": { "type": "array", "items": { "type": "object", "properties": { "lobbyId": { "type": "string" }, "host": { "type": [ "string", "null" ] }, "players": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "gameStarted": { "type": "boolean" } }, "required": [ "lobbyId", "host", "players", "gameStarted" ], "additionalProperties": false } } }, "required": [ "lobbies" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ] } }, "/lobby/players": { "get": { "summary": "List members of your lobby", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "players": { "type": "array", "items": { "type": "string" } } }, "required": [ "players" ], "additionalProperties": false } } } }, "400": { "description": "Error 400", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "401": { "description": "Error 401", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "403": { "description": "Error 403", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "404": { "description": "Error 404", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "409": { "description": "Error 409", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "429": { "description": "Error 429", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } }, "500": { "description": "Error 500", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "code", "error" ], "additionalProperties": false } } } } }, "security": [ { "bearerAuth": [] }, { "cookieAuth": [] } ], "parameters": [ { "in": "query", "name": "lobbyId", "required": true, "schema": { "type": "string", "pattern": "^[a-f0-9]{16}$" } } ] } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" }, "cookieAuth": { "type": "apiKey", "in": "cookie", "name": "authorization" } } } }