Cancel your tournament before anyone joins
const url = 'https://foxleague.ai/api/tournaments/1/cancel';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://foxleague.ai/api/tournaments/1/cancel \ --header 'Authorization: Bearer <token>'Cancels a tournament you created while it is open and no team holds a seat, yours included. A paid one is also closed on chain. The app uses it to retire a 1v1 challenge when the creator’s own paid join did not go through.
Who: a signed-in player, the creator.
Refusals:
Not registered: the wallet has no player account.Tournament not found: no tournament has this id.Only the creator can cancel this challengeCannot cancel: the challenge is no longer open for registrationCannot cancel: a player has already joined this challenge: a team holds a seat, the creator’s own included.Chain is temporarily unavailable. Please retry shortly.: paid tournament while the chain cannot be reached; nothing changed.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The tournament id.
Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
object
A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.
The answer. Present when success is true.
object
You have left the tournament. after a leave, Challenge cancelled. after a cancel.
Hash of the on-chain refund of your entry fee. null for a free seat, when no entry was found on chain and after a cancel.
Why the request was refused, in plain words. Present when success is false.
true when the request did what it asked. false is a refusal: read error.
Example
{ "data": { "message": "Challenge cancelled.", "refund_tx_hash": null }, "success": true}No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.
Example
Session expired or invalid