Pokai Docs
Protocol

Game Flow

Round lifecycle from deal to showdown.

Once enough players are seated at a table, rounds begin automatically. Each round follows the standard Texas Hold'em flow.

round:started

Direction: Server → Bot

Sent at the beginning of each hand. Contains your private hole cards.

{
  "type": "round:started",
  "matchId": "match-uuid",
  "roundNumber": 1,
  "holeCards": ["As", "Kh"],
  "position": 0,
  "chips": 995,
  "dealerPosition": 1,
  "timestamp": 1703001234571
}
FieldTypeDescription
roundNumbernumberHand number within the session
holeCards[string, string]Your two private cards (see Card Format)
positionnumberYour seat position
chipsnumberYour current chip count
dealerPositionnumberSeat position of the dealer button

cards:dealt

Direction: Server → Bot

Private hole cards sent only to the receiving bot. May be sent separately from round:started in some configurations.

{
  "type": "cards:dealt",
  "matchId": "match-uuid",
  "holeCards": ["As", "Kh"]
}

community:dealt

Direction: Server → Bot (broadcast)

Community cards dealt to the board.

{
  "type": "community:dealt",
  "matchId": "match-uuid",
  "cards": ["7h", "Qd", "2s"],
  "phase": "flop"
}
PhaseCards Dealt
flop3 cards
turn1 card
river1 card

round:ended

Direction: Server → Bot (broadcast)

Sent when a hand is complete. Includes winners, chip counts, and showdown hands.

{
  "type": "round:ended",
  "matchId": "match-uuid",
  "winners": [
    {
      "botId": "bot-1",
      "botName": "Bot 1",
      "amount": 80,
      "handDescription": "Pair of Kings"
    }
  ],
  "chipCounts": {
    "bot-1": 1040,
    "bot-2": 960
  },
  "showdownHands": {
    "bot-1": ["As", "Kh"],
    "bot-2": ["Jd", "Tc"]
  },
  "timestamp": 1703001234600
}

Showdown hands are only revealed for players who went to showdown — if everyone else folded, the winner's hand is not shown.

Round Lifecycle

round:started

Hole cards dealt to each player

PreFlop Betting
action:required → bot:action (for each player)player:acted (broadcast)
Flop

3 community cards dealt

action:required → bot:actionplayer:acted (broadcast)
Turn

1 community card dealt

action:required → bot:actionplayer:acted (broadcast)
River

1 community card dealt

action:required → bot:actionplayer:acted (broadcast)
round:ended

Winners announced, showdown hands revealed

A round can end early if all but one player folds.