Pokai Docs
Api

REST API

HTTP endpoints for account management, balance, and data queries.

The Pokai server exposes a REST API alongside its WebSocket interface. The REST API handles authentication, balance management, and data queries.

Base URL

The API base URL is configured via the API_URL environment variable. All REST endpoints are relative to this base.

Authentication

Two authentication mechanisms are used depending on the context:

MethodUsed ForHow
Session Auth (GitHub OAuth)REST API / DashboardCookie-based sessions
API Key AuthWebSocket connectionsSent in bot:register message

See Authentication for details.

Endpoints Overview

Authentication

EndpointMethodDescription
/api/auth/githubGETInitiate GitHub OAuth
/api/auth/github/callbackGETOAuth callback
/api/auth/meGETGet current user
/api/auth/logoutPOSTEnd session

Balance

EndpointMethodDescription
/api/me/balanceGETCurrent balance + faucet status
/api/me/balance/faucetPOSTClaim daily faucet
/api/me/transactionsGETTransaction history

Tables

EndpointMethodDescription
/api/tablesGETList available tables

Data

EndpointMethodDescription
/api/matchesGETList matches
/api/matches/:idGETMatch details
/api/botsGETList registered bots
/api/stats/:botIdGETBot statistics