Skip to content

Delete your open tournament

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

Permanently deletes a tournament you created while its status is open, whatever the number of seats taken. Every paid entry is refunded on chain and the tournament is closed there first. When entry fees are still settling on chain, the tournament is set to cancelled instead and the answer reads deleted: false; call again later to finish the delete. A delete still running on chain after 20 seconds answers deleted: false with still_processing: true and finishes in the background. Refusals on this route answer with an HTTP error status and the envelope success: false with error.

Who: a signed-in player, the creator.

Refusals:

  • 403 Not registered: the wallet has no player account.
  • 404 Tournament not found: no tournament has this id.
  • 400 A completed tournament cannot be deleted
  • 400 This has already started, so it can't be deleted while its match is running. Wait for it to finish.: the tournament is under way.
  • 403 Only the organizer or an admin can delete this tournament: you did not create it.
  • 400 You can only delete a tournament while it is still open (before its registration deadline): the tournament is not open.
  • 400 This tournament has a prize from FoxLeague, so it is cancelled, not deleted: cancel it at Admin > Tournaments. The prize goes back to its depositor once the contract reads it cancelled.: a League + Knockout tournament with a prize; nothing changed.
  • 503 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
deferred

Delete put off: true.

boolean
deleted
required

true when the tournament is deleted. false when it was set to cancelled because entry fees are still settling on chain; call the route again later. Also false while the delete is still running (still_processing).

boolean
matches_deleted

Finished delete: matches that were linked to the tournament; they stay in match history. 0 for a tournament that never started.

integer format: int64
message

Delete put off: a sentence saying the tournament is cancelled and the delete can be run again once the remaining entry fees have settled.

string
pool_remaining

Delete put off: entry fees the contract still holds for the tournament, as <n> atomic in the token’s smallest unit; unknown (pool read failed) when it cannot be read.

string
reason

Delete put off: escrow_not_drained.

string
refund_failed_addrs

Finished delete: always an empty list.

Array<string>
refund_failures

Delete put off: refunds that did not go through.

integer format: int64
refund_txs

Hashes of the entry refunds sent on chain; empty for a free tournament. Absent while the delete is still running (still_processing).

Array<string>
status

Delete put off: cancelled, the tournament’s new status.

string
still_processing

true when the delete was still running on chain as the answer left: a paid tournament refunds every entry first, which can take longer than the 20 seconds the answer waits. The delete goes on in the background; read the tournament again in a minute to see the result. Absent otherwise.

boolean
tournament_id

Finished delete: the id of the deleted tournament.

integer format: int64
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": {
"deleted": true,
"matches_deleted": 0,
"refund_failed_addrs": [],
"refund_txs": [
"f57fd14c1604d115cea325a65e19cbae530282bd36cb9d21f6be6abf0d7c1c1e"
],
"tournament_id": 419
},
"success": true
}

Refused: the tournament has completed, has started, is no longer open or has a prize from FoxLeague. error says which.

Media type application/json

The answer of a request that returns no data. POST /api/tournaments/{id}/delete answers its refusals with it: success is false and error says why.

object
code

A machine-readable reason next to error, set only where the caller must act differently.

string
data

Always null on success: the route returns no data.

error

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

string
success
required

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

boolean
Example generated
{
"code": "example",
"data": "example",
"error": "example",
"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

Refused: the wallet has no player account or you did not create this tournament. error says which.

Media type application/json

The answer of a request that returns no data. POST /api/tournaments/{id}/delete answers its refusals with it: success is false and error says why.

object
code

A machine-readable reason next to error, set only where the caller must act differently.

string
data

Always null on success: the route returns no data.

error

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

string
success
required

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

boolean
Example generated
{
"code": "example",
"data": "example",
"error": "example",
"success": true
}

No tournament has this id.

Media type application/json

The answer of a request that returns no data. POST /api/tournaments/{id}/delete answers its refusals with it: success is false and error says why.

object
code

A machine-readable reason next to error, set only where the caller must act differently.

string
data

Always null on success: the route returns no data.

error

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

string
success
required

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

boolean
Example generated
{
"code": "example",
"data": "example",
"error": "example",
"success": true
}

A failure on our side. The body is the usual JSON refusal.

Media type application/json

The answer of a request that returns no data. POST /api/tournaments/{id}/delete answers its refusals with it: success is false and error says why.

object
code

A machine-readable reason next to error, set only where the caller must act differently.

string
data

Always null on success: the route returns no data.

error

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

string
success
required

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

boolean
Example generated
{
"code": "example",
"data": "example",
"error": "example",
"success": true
}

The chain cannot be reached for a paid tournament; nothing changed. The body is the usual JSON refusal.

Media type application/json

The answer of a request that returns no data. POST /api/tournaments/{id}/delete answers its refusals with it: success is false and error says why.

object
code

A machine-readable reason next to error, set only where the caller must act differently.

string
data

Always null on success: the route returns no data.

error

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

string
success
required

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

boolean
Example generated
{
"code": "example",
"data": "example",
"error": "example",
"success": true
}