4.4 KiB
Tournament Management API Additions
This document covers tournament API additions that are not specific to timers, team action lists, or match metadata.
Related docs:
Tournament Metadata Fields
Tournaments support optional public metadata:
location: venue, city, stream label, or other display locationstarts_at: tournament start timestampends_at: tournament end timestampwebsite_url: public URL for the tournament or event
These fields are included in:
GET /tournamentsGET /tournaments/:id?simple=trueGET /tournaments/:idPOST /tournamentsPATCH /tournaments/:id- leader/follower sync snapshots
Full and simple tournament responses include:
{
"id": 11,
"name": "Summer Cup",
"code": "a1b2c3",
"public": true,
"location": "Main Hall",
"starts_at": "2030-06-01T08:00:00Z",
"ends_at": "2030-06-01T16:00:00Z",
"website_url": "https://example.com/summer-cup"
}
Create With Metadata
Endpoint:
POST /tournaments
{
"name": "Summer Cup",
"description": "Annual summer tournament",
"public": true,
"location": "Main Hall",
"starts_at": "2030-06-01T10:00:00+02:00",
"ends_at": "2030-06-01T18:00:00+02:00",
"website_url": "https://example.com/summer-cup",
"teams": [
{
"name": "Team Alpha"
},
{
"name": "Team Beta"
},
{
"name": "Team Gamma"
},
{
"name": "Team Delta"
}
]
}
Authentication:
- authenticated user required
- created tournament owner is the authenticated user
Update Metadata
Endpoint:
PATCH /tournaments/:id
{
"location": "Updated Arena",
"starts_at": "2030-07-01T10:00:00+02:00",
"ends_at": "2030-07-01T18:00:00+02:00",
"website_url": "https://example.com/updated"
}
Authentication:
- tournament owner required
- read-only follower tournaments reject normal updates with
423
Validation:
website_urlmust be blank or anhttp/httpsURLends_atmust be afterstarts_atwhen both are presentlocationandwebsite_urlare stripped and stored asnullwhen blank- timestamp responses are serialized as ISO 8601 strings
Expected errors:
401unauthenticated403authenticated but not owner422invalid metadata values423follower tournament is read-only
Delete Generated Group-Stage Playoffs
Use this endpoint when a tournament owner needs to reopen a finished group stage, change group-stage results, and regenerate playoffs.
Endpoint:
DELETE /tournaments/:id/playoffs
Authentication:
- tournament owner required
- read-only follower tournaments reject with
423
Success response:
{
"id": 11,
"stages": [
{
"id": 21,
"level": -1,
"state": "in_progress"
}
]
}
Success behavior:
- deletes all playoff stages for the group-stage tournament
- keeps the group stage
- changes the group stage back to
in_progress - enqueues tournament sync when configured
- broadcasts the normal tournament live update
Deletion is allowed only when:
- tournament has a group stage
- generated playoff stages exist
- every playoff match is still effectively unplayed
- playoff match states are
not_started,not_ready, orsingle_team - all playoff match scores and hidden scores are zero
Deletion is rejected after playoff play has started or scores have changed.
Expected statuses:
200playoffs deleted401unauthenticated403authenticated but not tournament owner404tournament not found422no group stage, no generated playoffs, or playoffs no longer deletable423follower tournament is read-only
Common 422 errors:
Only group-stage playoffs can be deletedPlayoffs have not been generatedPlayoffs cannot be deleted after matches have started or scores changed
Existing Related Endpoints
Match scheduling/display metadata lives in match_metadata_api.md:
PATCH /matches/:idPATCH /tournaments/:tournament_id/matches/metadata
Player account profile and team ownership APIs live in account_profiles_api.md:
GET /accounts/:idGET /teams/:idPATCH /teams/:idPUT /teams/:idPOST /tournamentsteamplayer_email/player_emailsfields