Skip to content

Cancel your tournament before anyone joins

POST
/api/tournaments/{id}/cancel
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 challenge
  • Cannot cancel: the challenge is no longer open for registration
  • Cannot 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.
id
required
integer format: int64

The tournament id.

Success or a refusal: read success (the refusals are in the description).

Media type application/json
object
code

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.

string | null
data

The answer. Present when success is true.

object
message
required

You have left the tournament. after a leave, Challenge cancelled. after a cancel.

string
refund_tx_hash

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.

string | null
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
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.

Media type text/plain
string
Example
Session expired or invalid