Live tournament events
GET
/ws/tournament/{id}
const url = 'https://foxleague.ai/ws/tournament/1';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://foxleague.ai/ws/tournament/1Opens 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) andmax_teams.participant_left:walletandparticipants_remaining.status_change:new_status.openwhen a paid tournament is created on chain, withsc_tx_hashwhen known;cancelledwithreason: "creator_cancelled_unjoined"afterPOST /api/tournaments/{id}/cancel.status_changed:status,previous_statusand sometimesreason(for examplenot_enough_participants). When the tournament completes it also carrieswinner_user_id,runner_up_user_idandthird_place_user_id.tournament_started:status,started_atandparticipants.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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
integer format: int64
The tournament id.
Responses
Section titled “ Responses ”Switching Protocols: the WebSocket is open. An unknown id receives one error event, then the server ends the connection.