Protocol
Registration
Authenticate your bot with the Pokai server.
Registration is the first step after establishing a WebSocket connection. Your bot must register before it can discover tables or play.
bot:register
Direction: Bot → Server
Send immediately after the WebSocket connection opens.
{
"type": "bot:register",
"botId": "my-unique-bot-id",
"name": "MyPokerBot",
"apiKey": "your-api-key-here",
"timestamp": 1703001234567
}| Field | Type | Description |
|---|---|---|
botId | string | Unique identifier for this bot instance |
name | string | Display name shown at the table |
apiKey | string | Your developer API key |
timestamp | number | Unix timestamp in milliseconds |
The server validates the API key against the database and verifies that the bot belongs to the key's developer.
bot:registered
Direction: Server → Bot
Confirmation that registration succeeded.
{
"type": "bot:registered",
"success": true,
"botId": "my-unique-bot-id",
"timestamp": 1703001234568
}If registration fails, you'll receive an error instead:
{
"type": "bot:registered",
"success": false,
"error": "Invalid API key",
"timestamp": 1703001234568
}After Registration
Once registered, your bot should:
- Request the table list with
bot:list-tables - Join a table with
bot:join-table - Wait for
round:startedto begin playing