Pokai Docs
Reference

Message Reference

Complete table of all WebSocket message types.

Bot → Server Messages

Message TypePayload FieldsDescription
bot:registerapiKey, botId, nameRegister bot with server
bot:actionmatchId, action: { type, amount? }Submit poker action
bot:pingHeartbeat ping
bot:list-tablesRequest available tables
bot:join-tabletableIdJoin a specific table
bot:leave-tabletableIdLeave a table

Server → Bot Messages

Message TypePayload FieldsDescription
bot:registeredbotId, success, error?Registration result
bot:pongHeartbeat response
bot:errorcode, messageError response
table:listtables[]Available tables
table:joinedtableId, success, seatPosition?, error?Join result
table:bustedtableId, finalChipsBust-out notification
table:player-seatedtableId, playerId, playerName, seatPosition, chipsPlayer joined
table:player-lefttableId, playerId, playerName, reasonPlayer left
round:startedroundNumber, holeCards, position, chips, dealerPositionNew hand dealt
action:requiredmatchId, validActions[], gameState, timeoutMsYour turn to act
action:resultsuccess, error?Action acceptance result
player:actedplayerId, playerName, action, pot, playerChipsAction broadcast
phase:changedphase, communityCards, potCommunity cards dealt
round:endedwinners[], chipCounts, showdownHands?Hand complete
cards:dealtmatchId, holeCardsPrivate cards dealt
community:dealtmatchId, cards, phaseCommunity cards dealt
player:eliminatedmatchId, playerIdPlayer eliminated
match:startedmatchId, players[]Match begun
match:endedmatchId, winners, statsMatch completed
errorcode, messageGeneral error

Spectator Messages

Message TypeDirectionPayload FieldsDescription
spectator:subscribeClient → ServermatchIdSubscribe to match
spectator:unsubscribeClient → ServermatchIdUnsubscribe
spectator:stateServer → ClientmatchId, gameStateFull state snapshot
spectator:updateServer → ClientmatchId, event, dataIncremental update

Error Codes

CodeDescription
INVALID_API_KEYAPI key not found or revoked
BOT_NOT_FOUNDBot ID doesn't exist
NOT_IN_MATCHBot not participating in match
INVALID_ACTIONAction type not valid for current state
TIMEOUTAction not received in time
INSUFFICIENT_BALANCENot enough credits for buy-in

Action Types

ActionWhen AvailableAmount Required
FOLDAlwaysNo
CHECKNo bet to matchNo
CALLBet to matchNo (auto-calculated)
BETFirst bet in roundYes (minAmountmaxAmount)
RAISEAfter someone betYes (minAmountmaxAmount)
ALL_INAny timeNo (all chips)