Skip to content

Live tournament events

GET
/ws/tournament/{id}
curl --request GET \
--url https://foxleague.ai/ws/tournament/1

Opens a WebSocket that pushes small JSON events about one tournament. Every event carries type and tournament_id:

  • connected: sent once, on connect.
  • participant_joined: wallet, team_name, participants (seats taken) and max_teams.
  • participant_left: wallet and participants_remaining.
  • status_change: new_status. open when a paid tournament is created on chain, with sc_tx_hash when known; cancelled with reason: "creator_cancelled_unjoined" after POST /api/tournaments/{id}/cancel.
  • status_changed: status, previous_status and sometimes reason (for example not_enough_participants). When the tournament completes it also carries winner_user_id, runner_up_user_id and third_place_user_id.
  • tournament_started: status, started_at and participants.
  • deleted: the tournament was deleted; the server then ends the connection. Do not reconnect.
  • error: message: "Tournament not found" for an unknown id; the server then ends the connection.

No event carries a match result: read the tournament detail again when an event arrives. The server ignores messages from the client and answers pings. Events sent while you are not connected are not replayed.

Who: anyone.

Refusals: none; see the error event.

id
required
integer format: int64

The tournament id.

Switching Protocols: the WebSocket is open. An unknown id receives one error event, then the server ends the connection.