Skip to content

Leave a tournament before its deadline

POST
/api/tournaments/{id}/leave
curl --request POST \
--url https://foxleague.ai/api/tournaments/1/leave \
--header 'Authorization: Bearer <token>'

Removes your seat from an open tournament before its registration deadline. For a paid seat the entry fee is refunded on chain first and the answer carries the refund transaction hash. Leaving never cancels the tournament, even when it becomes empty. The creator may leave too. In a League + Knockout tournament an accepted team may leave until its third invitation wave starts; leaving closes the invitation and its seat goes to the next wave.

Who: a signed-in player.

Refusals:

  • Not registered: the wallet has no player account.
  • Tournament not found: no tournament has this id.
  • Cannot leave: tournament is no longer open
  • Cannot leave: registration deadline has passed
  • Cannot leave: the seats of this tournament are locked since <time>, when its last invitation wave started.: a League + Knockout tournament from its third invitation wave on.
  • Chain is temporarily unavailable. Please retry shortly.: paid seat while the chain cannot be reached; your seat is kept.
  • Your leave could not be confirmed on chain yet. Press Leave again in a moment to finish: a refund already sent is never sent twice.: your seat is kept until the refund is confirmed.
  • Refunds are unavailable right now: your seat and entry fee are untouched. Please retry shortly.
  • You are not in this tournament: you hold no seat.
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": "You have left the tournament.",
"refund_tx_hash": "e210471948d33296c87009e8a7f770d9106fd287db7f1adbc60926f6967e7893"
},
"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