Whistle.day
Whistle.day API
The HTTP API the Whistle.day screens are built on.
Everything the web app does goes through this API, so anything it can do, a script can do too. It is PocketBase underneath: tournaments, teams, matches and tables are collections read and written through the standard records API, and the operations a collection rule cannot express (drawing a stage, taking a team out, handing a tournament over) are the custom routes listed here.
Requests and responses are JSON. A published tournament is readable by anybody; a draft, and every write, needs a token from somebody who owns the tournament or is on its crew.
This page is served by the API itself at /api/docs, and the same reference is available as an OpenAPI 3.1 document at /api/openapi.json. An agent is better served by the MCP server at /api/mcp, which wraps the same engine in 25 tools.
Getting started
The base address is https://whistle.day. Two requests that need nothing at all, to see the shape of things:
curl -X POST https://whistle.day/api/preview \
-H 'Content-Type: application/json' \
-d '{"format": "round_robin", "teams": 4}'
curl 'https://whistle.day/api/collections/tournaments/records?perPage=5'
Everything that writes needs a token. Sign in for one, then send it on every request:
curl -X POST https://whistle.day/api/collections/users/auth-with-password \
-H 'Content-Type: application/json' \
-d '{"identity": "you@example.com", "password": "…"}'
curl -X POST https://whistle.day/api/stages/STAGE_ID/generate?dry_run=1 \
-H 'Authorization: Bearer TOKEN'
A refusal is always the same object, with a message written to be shown to a person:
{
"status": 404,
"message": "Stage not found.",
"data": {}
}
There is no general rate limit, because a sports hall is two hundred people behind one IP address. The endpoints that do have one say so.
Combat events
A day of judo, BJJ, wrestling, taekwondo or boxing: an event with mats, and divisions that are tournaments of their own. Made, weighed, merged and drawn here, then fought through the mat queue. Writes need a token from the event's owner or crew on any of its divisions.
GET
/api/combat/presets
no token
Combat sports and weight templates
The combat sports an event can be run as, with their default rest time and scoring, and every federation weight template a set of divisions can be made from.
Responses
| 200 |
Presets and templates.
Example{
"sports": [
{
"id": "judo",
"restSeconds": 600
}
],
"templates": [
{
"id": "csju_u14_m",
"sport": "judo",
"age": "U14",
"sex": "m",
"limits": [
34,
38,
42
],
"open": true
}
]
}
|
GET
/api/events/{event}
no token
Read an event
An event is one day of a combat sport: many divisions (age, sex and weight categories) sharing a few mats. Each division is an ordinary tournament with event set, so its bracket and tables are read like any other, and path is its results page. Public once the event is out of draft.
Parameters
event |
path, required |
The event's id. |
Responses
| 200 |
The event and its divisions.
Example{
"id": "ev1",
"name": "Grand Prix",
"sport": "judo",
"status": "weigh_in",
"mats": [
"Tatami 1",
"Tatami 2"
],
"restSeconds": 600,
"divisions": [
{
"id": "t1",
"name": "U14 M -42 kg",
"status": "draft",
"competitors": 6,
"path": "/t/t1",
"division": {
"age": "U14",
"sex": "m",
"limitKg": 42,
"block": 1,
"mat": 0
}
}
]
}
|
| 404 |
No such event, or a draft and the caller is not its crew.
|
POST
/api/events/{event}/divisions
token required
Add divisions
Either template, which makes every category of a federation's weight list at once (see GET /api/combat/presets), or one division described by hand. block orders the day — block 1 is called before block 2 — and mat pins the divisions to one mat (0 is any). Refused once the weigh-in is closed.
Parameters
event |
path, required |
The event's id. |
Request body
{
"template": "csju_u14_m",
"block": 1,
"mat": 0
}
Responses
| 200 |
The new divisions' ids.
Example{
"divisions": [
"t1",
"t2"
]
}
|
| 400 |
No template or division, an unknown template, or the draw is already made.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such event.
|
POST
/api/divisions/{division}/mat
token required
Put a division on a mat
Moves a division to another mat, or to any mat with 0. The draw already puts every division on a mat, balancing the bouts across the mats of its block; this is the table changing its mind. Bouts already called stay where they were called; the rest are only called to this mat.
Parameters
division |
path, required |
The division (tournament) id to merge away. |
Request body
{
"mat": 2
}
Responses
| 200 |
Moved.
Example{
"division": "t1",
"mat": 2
}
|
| 400 |
No such mat, or not a division of an event.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such division.
|
POST
/api/events/{event}/table
token required
Make a table by hand
Makes one category out of competitors picked by hand, from any categories of the event not drawn yet: a group with too much between the lightest and the heaviest is cut where the desk says. It takes the age group and block of the first competitor, and is mixed when they come from categories of different sex. Nobody is placed in it or moved out of it by weight or birth year afterwards, only with POST /api/entries/{entry}/edit and division; when the last one is moved out, the table is removed. Without name it is named by the age group and the weights in it.
Parameters
event |
path, required |
The event's id. |
Request body
{
"name": "U10 Mix 30.5–32 kg",
"entries": [
"e1",
"e2"
]
}
Responses
| 200 |
The new category.
Example{
"division": "d9",
"name": "U10 Mix 30.5–32 kg"
}
|
| 400 |
Nobody picked, a competitor of another event or of a drawn category, or a name too long.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such event.
|
POST
/api/divisions/{division}/merge
token required
Merge two divisions
Moves every competitor of {division} into into and deletes {division}: one child at -34 kg fights at -38 kg. Both must be in the same event and neither drawn yet. The merged name is kept on the target's division.merged.
Parameters
division |
path, required |
The division (tournament) id to merge away. |
Request body
{
"into": "t2"
}
Responses
| 200 |
The division that remains.
Example{
"division": "t2"
}
|
| 400 |
Different events, the same division, or the draw is already made.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such division.
|
POST
/api/divisions/{division}/undraw
token required
Take a division's draw back
Deletes a drawn division's stages and bouts, puts everybody in it back to checked in without a seed, and opens it again for the roll call, a merge or a late competitor, until it is drawn anew with close-weigh-in. The division keeps its mat. Refused once any bout of it has a result: correct that result instead.
Parameters
division |
path, required |
The division (tournament) id. |
Responses
| 200 |
Open again.
Example{
"division": "t1"
}
|
| 400 |
Not drawn, a bout already has a result, or not a division of an event.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or an organiser.
|
| 404 |
No such division.
|
POST
/api/entries/{entry}/weigh
token required
Record a weigh-in
Records the scales. Within the limit the verdict is ok. Over it, without moveUp, the verdict is over and suggested names the lightest category of the same age and sex that takes the weight; with moveUp the competitor is moved there in the same call and the verdict is moved.
Parameters
entry |
path, required |
The entry's id. |
Request body
{
"weight": 43.2,
"moveUp": true
}
Responses
| 200 |
The verdict.
Example{
"entry": "e1",
"weight": 43.2,
"verdict": "moved",
"division": "t3"
}
|
| 400 |
Not in an event, no heavier category to move to, a weight of zero, or the draw is already made.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such entry.
|
POST
/api/entries/{entry}/scratch
token required
Scratch a competitor
Strikes somebody who did not turn up, or did not make weight and will not move. Closing the weigh-in scratches everyone never weighed anyway; this is for the table that knows sooner.
Parameters
entry |
path, required |
The entry's id. |
Responses
| 200 |
The entry is withdrawn.
Example{
"entry": "e1",
"weigh_in": "scratched"
}
|
| 400 |
Not in an event, or the draw is already made.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such entry.
|
POST
/api/entries/{entry}/present
token required
Mark a competitor present
Marks somebody as here without the scales: the roll call of an event whose weights came with the list (weighIn off), or a scratch taken back. The weight they have is kept.
Parameters
entry |
path, required |
The entry's id. |
Responses
| 200 |
The entry is checked in.
Example{
"entry": "e1",
"weigh_in": "ok"
}
|
| 400 |
Not in an event, or the draw is already made.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such entry.
|
POST
/api/entries/{entry}/edit
token required
Correct a competitor
Corrects one competitor at the desk. name and club can be fixed any time. birthYear, weight and division move the competitor, so neither their category nor the one they go to may be drawn yet. A new birthYear or weight without division places them where the list would have: the category of their age and sex (the category's) that the weight makes, among those not drawn; when none takes them they stay. Without scales on the day (weighIn off) the weight is the one they fight at; with scales it is what they declared. Leave out a field to keep it.
Parameters
entry |
path, required |
The entry's id. |
Request body
{
"weight": 26.5,
"club": "Judo Hranice"
}
Responses
| 200 |
Where the competitor is now; moved names the category when it changed.
Example{
"entry": "e1",
"division": "d2",
"moved": "2019 Mix -27 kg"
}
|
| 400 |
Not in an event, an empty name, a birth year or weight out of range, a category of another event, or a move in or out of a drawn category.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such entry.
|
POST
/api/events/{event}/close-weigh-in
token required
Draw divisions
Draws divisions from who made weight: all the ones not drawn yet, or only those in divisions — the morning's U8 while the afternoon's seniors are still on the scales. A drawn division takes nobody more at the scales; the others keep weighing. system picks how a division is fought, and is saved on the event for later draws: bracket6 (default) — 2 a best of three, 3 to 5 a round robin, 6 or more a bracket with IJF repechage (two bronzes), or double elimination with preferDouble; pools8 — up to 6 a round robin, 7 and 8 two pools whose first two cross into semi-finals and a final, 9 or more the bracket. Before the draw, a competitor alone in a division is moved into the next heavier undrawn division of the same age and sex that has anybody in it, unless keepAlone; the division they join lists them in joined. Every division drawn is put on a mat (mat in the response), the biggest first onto the mat with the fewest bouts in its block, unless it was pinned to one. Clubmates are drawn as far apart as the field allows. Entries never weighed are scratched unless keepUnweighed. The event goes live.
Parameters
event |
path, required |
The event's id. |
Request body
{
"preferDouble": false,
"keepUnweighed": false,
"keepAlone": false,
"divisions": [
"t1",
"t2"
],
"system": "pools8"
}
Responses
| 200 |
What every division was given.
Example{
"divisions": [
{
"division": "t1",
"name": "U14 M -42 kg",
"competitors": 6,
"format": "repechage",
"fixtures": 11
}
]
}
|
| 400 |
Nothing left to draw, an unknown system, or a division could not be drawn.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such event.
|
GET
/api/events/{event}/queue
no token
Read the mat queue
Every mat with the bout on it (current) and those called to it (onDeck), and every bout waiting for a mat in the order they are called: by block, then how far into its division, then division. A waiting bout with readyAt in the future has a competitor still resting; busy means one is on a mat now. Reading it first starts a bout on every free mat, as reading one mat does. Public once the event is.
Parameters
event |
path, required |
The event's id. |
Responses
| 200 |
The dispatch picture.
Example{
"mats": [
{
"mat": 1,
"name": "Tatami 1",
"current": null,
"onDeck": []
}
],
"waiting": [
{
"id": "f1",
"label": "U14 M -42 kg",
"code": "A1.1",
"homeName": "Adam",
"awayName": "Boris",
"busy": false
}
]
}
|
| 404 |
No such event.
|
GET
/api/events/{event}/board
no token
Read the spectators' board
Everything the parents' page shows, in one read: every division with its competitors (name, club, birth year), every bout with its result, the podium once a division is decided (place 1, 2 and 3 — two thirds after a repechage; with everyMedal, up to U10, everybody who fought and is not first or second is third), and the mats as the queue has them. Public once the event is. Each bout also carries combat — the judo scoreboard it was recorded from (home/away with ippon, wazaAri, yuko, shido; winner; method: ippon, waza_ari, yuko, hansoku, kiken or decision; golden) — its finishedAt, and for a bout still to come etaMinutes, a rough guess at the day's pace (boutMinutes). A division has tables, its pools as standings (won, lost, scoreFor: ippon 100, waza-ari 10, yuko 1), and once decided finishedAt, so results can be listed in the order categories finished.
Parameters
event |
path, required |
The event's id. |
Responses
| 200 |
The board.
Example{
"id": "ev1",
"name": "Halloween cup",
"sport": "judo",
"status": "live",
"mats": [
{
"mat": 1,
"name": "Tatami 1",
"current": null,
"onDeck": []
}
],
"divisions": [
{
"id": "t1",
"name": "2017–2018 M -27.5 kg",
"division": {
"age": "2017–2018",
"sex": "m",
"limitKg": 27.5,
"open": false,
"bornFrom": 2017,
"bornTo": 2018,
"block": 1,
"mat": 0,
"format": "round_robin"
},
"status": "published",
"competitors": [
{
"id": "e1",
"name": "Novák Jan",
"club": "Sokol",
"birthYear": 2018
}
],
"bouts": [
{
"id": "f1",
"code": "A1.1",
"round": 0,
"stage": 0,
"pool": "group",
"status": "finished",
"mat": 1,
"home": "e1",
"away": "e2",
"homeScore": 10,
"awayScore": 0,
"winner": "e1"
}
],
"podium": [
{
"place": 1,
"entry": "e1"
}
]
}
]
}
|
| 404 |
No such event, or it is still a draft.
|
POST
/api/events/{event}/import
token required
Import the entry list
Enters a club list into the event in one transaction. Each row goes into the division its birth year, sex and weight make: the most specific age group that takes the year (an explicit bornFrom/bornTo, or read off the age label — U14, 2016–2017), of the same sex or mixed, then the lightest weight category that admits the weight. With autoDivisions, whoever fits none gets divisions made from the list: birth years grouped yearSpan at a time (1, 2 or 3; default 2, the federation pairs), or by the groups in yearGroups ([{from: 2019, to: 2019}, {from: 2017, to: 2018}]) for the years they cover, each group split by weight into categories of about groupSize (default 5), limits halfway between two competitors. With weighed, the list's weights count as the scales'. A name already entered for the same club is skipped, so importing the same list twice adds nobody twice. Refused once the draw is made.
Parameters
event |
path, required |
The event's id. |
Request body
{
"rows": [
{
"name": "Novák Jan",
"club": "Sokol",
"weight": 27.1,
"birthYear": 2018,
"sex": "m"
}
],
"autoDivisions": true,
"yearSpan": 2,
"yearGroups": [
{
"from": 2019,
"to": 2019
},
{
"from": 2017,
"to": 2018
}
],
"groupSize": 5,
"weighed": false
}
Responses
| 200 |
What was added and made, and what was not.
Example{
"added": 128,
"created": [
"2019–2020 M -24.5 kg",
"2019–2020 M +24.5 kg"
],
"skipped": [
{
"row": 130,
"name": "",
"reason": "name"
}
]
}
|
| 400 |
Already drawn, an empty list, or more than 2000 rows.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such event.
|
GET
/api/events/{event}/mats/{mat}
no token
Read one mat
What the screen beside one mat shows: the bout on it, its scoreboard while it is fought (combat, judo), and the next bouts (next: called there by hand first, then what the queue would call). Reading a mat first starts a bout on every free mat, the next of the categories drawn onto it once its competitors have rested. Mats are numbered from 1 in the order of the event's mats. With the bout on the mat come seconds, its regular time by the category's age (two minutes up to U12, three for U14, four from U16 or when the age does not tell), and now, the server's clock in Unix milliseconds; the scoreboard's clock (seconds, elapsedMs, running, and since, the server's Unix ms when it was last started) is read against it. A hold being counted is the scoreboard's osaekomi: side (home or away), elapsedMs, awarded (what it has put on the board so far: 1 yuko at five seconds, 2 waza-ari at ten, 3 ippon at twenty) and since, as the clock's.
Parameters
event |
path, required |
The event's id. |
mat |
path, required |
The mat number, from 1. |
Responses
| 200 |
One mat.
Example{
"mat": 1,
"name": "Tatami 1",
"current": {
"id": "f1",
"code": "QF1",
"homeName": "Adam",
"awayName": "Boris"
},
"onDeck": []
}
|
| 404 |
No such event or mat.
|
POST
/api/events/{event}/mats/{mat}/call
token required
Call a bout to a mat
Without fixture, calls the next bout the queue allows on this mat: the earliest block still waiting, nobody resting or on another mat, and a division pinned to a mat only on its own. With fixture, calls that one, still refusing a resting or busy competitor unless force.
Parameters
event |
path, required |
The event's id. |
mat |
path, required |
The mat number, from 1. |
Request body
{
"fixture": "",
"force": false
}
Responses
| 200 |
The bout called.
Example{
"fixture": "f1",
"code": "QF1",
"mat": 1
}
|
| 400 |
No such mat, nothing callable, or the named bout is resting, busy or not waiting.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such event.
|
POST
/api/events/{event}/release
token required
Take a bout off its mat
Puts a called bout that has not started back in the queue.
Parameters
event |
path, required |
The event's id. |
Request body
{
"fixture": "f1"
}
Responses
| 200 |
The bout released.
Example{
"fixture": "f1"
}
|
| 400 |
Not in this event, or already started.
|
| 401 |
No token.
|
| 403 |
The token's account is not the event's owner or crew on any of its divisions.
|
| 404 |
No such event.
|
Screens and previews
Public, read-only endpoints. No account and no token header: a screen is opened by the token in its address, and a preview reads no stored data at all.
GET
/api/display/{token}
no token
Everything one projector screen shows
One assembled payload: the tournament, its stages with their pools, tables and rounds, what is playing now, what is next, recent results, courts and sponsors. Teams are sent once in entries and referenced by id everywhere else. A side of a match that nobody has qualified for yet has an empty entry and a label to draw instead, such as Winner SF1.
The response carries an ETag. Send it back in If-None-Match and an unchanged tournament answers 304. A screen whose tournament is still a draft answers 404, the same as a token that does not exist. This endpoint has no rate limit.
Parameters
token |
path, required |
The screen's token, from the address of its /display/{token} page. |
If-None-Match |
header |
The ETag of the last response you received. |
Responses
| 200 |
The screen's payload.
Example{
"generated_at": "2026-10-03T09:41:12Z",
"tournament": {
"id": "t8w2k1m0q9x4c7z",
"name": "Autumn Cup",
"sport": "volleyball",
"location": "Sports hall B",
"logo": "",
"status": "live"
},
"display": {
"id": "d3n5p7r9t1v2x4z",
"name": "Main wall",
"mode": "auto",
"rotate_seconds": 15,
"scope": {
"stage": "",
"pool": "",
"court": ""
},
"theme": {
"mode": "dark"
},
"panels": []
},
"entries": {
"e1a2b3c4d5f6g7h": {
"id": "e1a2b3c4d5f6g7h",
"name": "Kestrels",
"short_name": "KES",
"club": "",
"logo": "",
"seed": 1
},
"e2b3c4d5f6g7h8j": {
"id": "e2b3c4d5f6g7h8j",
"name": "Otters",
"short_name": "OTT",
"club": "",
"logo": "",
"seed": 2
}
},
"courts": [
{
"id": "c9y8x7w6v5u4t3s",
"name": "Court 1",
"position": 0
}
],
"stages": [
{
"id": "s4h6j8k0m2n4p6q",
"position": 0,
"name": "Groups",
"name_kind": "groups",
"format": "round_robin",
"status": "live",
"pools": [
{
"id": "p1q2r3s4t5u6v7w",
"name": "A",
"kind": "group",
"advance_count": 2,
"standings": [
{
"position": 1,
"entry": "e1a2b3c4d5f6g7h",
"played": 1,
"won": 1,
"drawn": 0,
"lost": 0,
"score_for": 2,
"score_against": 0,
"points": 2,
"qualified": false,
"tiebreak": [
"points"
]
}
],
"rounds": [
{
"round": 0,
"fixtures": [
{
"id": "f7g8h9j0k1m2n3p",
"code": "A1",
"stage": "s4h6j8k0m2n4p6q",
"pool": "p1q2r3s4t5u6v7w",
"round": 0,
"position": 0,
"status": "finished",
"home": {
"entry": "e1a2b3c4d5f6g7h",
"label": "Kestrels",
"score": 2
},
"away": {
"entry": "e2b3c4d5f6g7h8j",
"label": "Otters",
"score": 0
},
"winner": "e1a2b3c4d5f6g7h",
"court": "c9y8x7w6v5u4t3s",
"scheduled_at": "2026-10-03 09:00:00.000Z",
"games": [
{
"number": 1,
"home": 25,
"away": 19
},
{
"number": 2,
"home": 25,
"away": 22
}
]
}
]
}
]
}
]
}
],
"now_playing": [],
"next_up": [],
"recent": [],
"sponsors": []
}
|
| 304 |
Nothing has changed since the ETag you sent.
|
| 404 |
No active screen has this token, or its tournament is still a draft.
|
GET
/api/clubs/{slug}
no token
A club and the tournaments it has run
The club's name, colour and logo, and every tournament its owner has listed on it, newest first. A draft is left out. date is when the tournament is played if that was ever set, and when it was created otherwise. screen is the token of one of the tournament's active screens, for /m/{screen} or GET /api/display/{token}, and is empty when it has none.
There is no endpoint that lists clubs: this one answers for a slug you already have.
Parameters
slug |
path, required |
The club's slug, from the address of its /c/{slug} page. |
Responses
| 200 |
The club's page.
Example{
"club": {
"id": "c4h7k2m9p1r3t5v",
"name": "TJ Sokol Brno",
"slug": "tj-sokol-brno",
"accent": "#0b7a43",
"logo": "/api/files/pbc_1219621782/c4h7k2m9p1r3t5v/crest_a1b2c3d4e5.png"
},
"tournaments": [
{
"id": "t8w2k1m0q9x4c7z",
"name": "Autumn Cup",
"sport": "volleyball",
"location": "Sports hall B",
"status": "live",
"date": "2026-10-03T08:00:00Z",
"screen": "hala-1"
}
]
}
|
| 404 |
No club has this slug.
|
POST
/api/preview
no token
Draw a stage that does not exist
A format, a field and a config in, a plan out. It runs the same generators a real stage does and touches no stored data, so it needs no account. Send either teams (a count, numbered Team 1, Team 2, …) or names; names wins when both are present.
format is one of round_robin, single_elim, double_elim or swiss. config takes the same keys a stage's config does: poolCount, advancePerPool, legs, thirdPlace, consolation and rounds. seedFrom is refused, because there is no earlier stage to read. The field is capped at 128 teams and the endpoint at 60 requests a minute per IP address. Responses may be cached for an hour.
Request body
{
"format": "single_elim",
"names": [
"Kestrels",
"Otters"
],
"config": {
"thirdPlace": false
}
}
Responses
| 200 |
The plan: pools, the slots in them, and the fixtures between those slots. Keys are positional and exist only to link the three lists together.
Example{
"format": "single_elim",
"plan": {
"pools": [
{
"key": "pool:main",
"name": "Main",
"name_kind": "main",
"position": 0,
"kind": "winners",
"advance_count": 1
}
],
"slots": [
{
"key": "slot:0:0",
"pool_key": "pool:main",
"round": 0,
"position": 0,
"label": "Kestrels",
"entry": "preview1",
"source_type": "direct",
"source_fixture_key": "",
"source_pool": "",
"source_stage": "",
"source_position": 1
},
{
"key": "slot:0:1",
"pool_key": "pool:main",
"round": 0,
"position": 1,
"label": "Otters",
"entry": "preview2",
"source_type": "direct",
"source_fixture_key": "",
"source_pool": "",
"source_stage": "",
"source_position": 2
},
{
"key": "slot:1:0",
"pool_key": "pool:main",
"round": 1,
"position": 0,
"label": "Winner F",
"label_kind": "winner_of",
"label_args": {
"code": "F"
},
"entry": "",
"source_type": "fixture_winner",
"source_fixture_key": "fixture:0:0",
"source_pool": "",
"source_stage": "",
"source_position": 0
}
],
"fixtures": [
{
"key": "fixture:0:0",
"pool_key": "pool:main",
"round": 0,
"position": 0,
"code": "F",
"home_slot_key": "slot:0:0",
"away_slot_key": "slot:0:1",
"status": "pending"
}
]
}
}
|
| 400 |
Fewer than 2 teams, more than 128, an unknown format, ladder, or a seedFrom.
|
| 429 |
More than 60 requests in a minute from this IP address.
|
Authentication
A token is a PocketBase auth token for the users collection. Send it in the Authorization header, with or without the Bearer prefix. Signing in is rate limited to 5 requests per 10 seconds per IP address.
POST
/api/collections/users/auth-with-password
no token
Sign in
PocketBase's own sign-in. identity is the email address of the account. The token in the answer is what every authenticated request sends in its Authorization header.
Request body
{
"identity": "jana@example.com",
"password": "correct horse battery"
}
Responses
| 200 |
A token and the account it belongs to.
Example{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…",
"record": {
"id": "u5k7m9p1r3t5v7x",
"collectionName": "users",
"email": "jana@example.com",
"verified": true
}
}
|
| 400 |
The address or the password is wrong.
|
| 429 |
More than 5 sign-in requests in 10 seconds from this IP address.
|
POST
/api/collections/users/auth-refresh
token required
Trade a token for a fresh one
PocketBase's own refresh. Send the token you hold; the answer has the same shape as signing in.
Responses
| 200 |
A new token and the account record.
|
| 401 |
The token is missing, expired, or was invalidated when the account was claimed or handed over.
|
Records
The PocketBase records API over the collections listed under Collections below. Reading a published tournament needs no token. Listing supports PocketBase's filter, sort, expand, fields, page and perPage parameters.
GET
/api/collections/{collection}/records
no token
List records
A page of one collection. Records of a published tournament are returned to anybody; records of a draft only to its owner and crew, and without a token they are simply absent from the list rather than refused.
displays is the exception: anonymously it returns a screen only when the request carries that screen's ?token=.
Parameters
collection |
path, required |
One of the names under Collections below. |
filter |
query |
A PocketBase filter expression, for example tournament = "t8w2k1m0q9x4c7z" && status = "live". |
sort |
query |
Comma-separated fields, - for descending: round,position. |
expand |
query |
Relations to inline, for example home_entry,away_entry. |
fields |
query |
Comma-separated fields to return instead of the whole record. |
page |
query |
1-based page number. Defaults to 1. |
perPage |
query |
Records per page. Defaults to 30. |
Responses
| 200 |
One page.
Example{
"page": 1,
"perPage": 30,
"totalItems": 1,
"totalPages": 1,
"items": [
{
"id": "c9y8x7w6v5u4t3s",
"collectionName": "courts",
"tournament": "t8w2k1m0q9x4c7z",
"name": "Court 1",
"position": 0
}
]
}
|
| 400 |
The filter or the sort does not parse.
|
| 404 |
No such collection.
|
POST
/api/collections/{collection}/records
token required
Create a record
Anybody signed in can create a tournament, and becomes its owner. Courts, entries, stages, displays and sponsors are created by the tournament's owner or crew, invites and crew rows by the owner alone. standings and fixture_events are written by the server and accept nothing.
A stage created here has no matches until POST /api/stages/{stage}/generate draws it. An entry created after the draw is not in any stage until POST /api/entries/{entry}/admit fits it in.
Parameters
collection |
path, required |
One of the names under Collections below. |
Request body
{
"tournament": "t8w2k1m0q9x4c7z",
"name": "Kestrels",
"short_name": "KES",
"seed": 1,
"status": "registered"
}
Responses
| 200 |
The record as stored.
|
| 400 |
A field failed validation, or the collection's create rule refused the request.
|
| 403 |
The collection takes no writes through the API.
|
GET
/api/collections/{collection}/records/{id}
no token
Read one record
The same access as listing. A record you may not see answers 404, not 403.
Parameters
collection |
path, required |
One of the names under Collections below. |
id |
path, required |
The record's id. |
expand |
query |
Relations to inline. |
Responses
| 200 |
The record.
|
| 404 |
No such record, or not one this request may see.
|
PATCH
/api/collections/{collection}/records/{id}
token required
Update a record
Send only the fields that change. Entering a result is a patch to a fixture: settling it is what fills the slots that were waiting on it, rebuilds the tables, draws the next Swiss round and seeds a playoff from a finished group, all before the response is sent.
A level score is refused with 400 when the tournament's scoring does not allow draws, and always in a knockout stage. A best-of series accepts only the scores a series can end on.
Parameters
collection |
path, required |
One of the names under Collections below. |
id |
path, required |
The record's id. |
Request body
{
"home_score": 2,
"away_score": 1,
"status": "finished"
}
Responses
| 200 |
The record as stored.
|
| 400 |
A field failed validation, or the result is one the format cannot end on.
|
| 404 |
No such record, or not one this token may change.
|
DELETE
/api/collections/{collection}/records/{id}
token required
Delete a record
Deleting a tournament deletes everything under it. Deleting a crew row removes that person's access immediately.
Parameters
collection |
path, required |
One of the names under Collections below. |
id |
path, required |
The record's id. |
Responses
| 204 |
Deleted.
|
| 404 |
No such record, or not one this token may delete.
|
GET
/api/realtime
no token
Be told when a tournament changes
PocketBase's server-sent event stream. The first event is PB_CONNECT and carries a clientId; post that id back with the topics you want. Whistle.day broadcasts on tournament/{id} whenever anything a screen renders is written. The message says that something changed and never what, so the thing to do on receiving one is to read GET /api/display/{token} or the records again.
Keep a slow poll underneath: a connection that looks open and has stopped delivering is the failure worth planning for.
Responses
| 200 |
An open text/event-stream.
|
POST
/api/realtime
no token
Choose what the stream delivers
Sets the subscriptions of an open stream, replacing whatever it had.
Request body
{
"clientId": "kX2bQ9…",
"subscriptions": [
"tournament/t8w2k1m0q9x4c7z"
]
}
Responses
| 204 |
Subscribed.
|
| 404 |
No open stream has this clientId.
|
Stages
Drawing a stage and repairing one. All three need a token from the tournament's owner or crew.
POST
/api/stages/{stage}/generate
token required
Draw a stage
Writes the stage's pools, slots and fixtures from its format, its config and the tournament's entries, then fills in whatever can already be resolved. With ?dry_run=1 nothing is written and the answer is the plan itself, in the shape POST /api/preview returns, so a preview and the real draw come out of the same generator.
A playoff seeded from an earlier stage sets config.seedFrom to { "stage": "<id>", "advancePerPool": 2 } and is filled from that stage's tables as its groups finish.
Parameters
stage |
path, required |
The stage's id. |
dry_run |
query |
1 or true to return the plan without writing it. |
Responses
| 200 |
How much was written. With dry_run, { "stage", "dry_run": true, "plan" } instead.
Example{
"stage": "s4h6j8k0m2n4p6q",
"pools": 2,
"slots": 8,
"fixtures": 12
}
|
| 400 |
The stage cannot be drawn as configured, or it already holds played fixtures.
|
| 401 |
No token.
|
| 403 |
The token's account is not on this tournament's crew.
|
| 404 |
No such stage.
|
POST
/api/stages/{stage}/resolve
token required
Re-resolve a stage
Recomputes who goes where from the results already entered. Results resolve themselves as they are written, so this is the repair path: after a score is corrected, or when a slot was written after the fixture it reads from. Safe to call twice.
Parameters
stage |
path, required |
The stage's id. |
Responses
| 200 |
How many slots were filled.
Example{
"stage": "s4h6j8k0m2n4p6q",
"resolved": 3
}
|
| 401 |
No token.
|
| 403 |
The token's account is not on this tournament's crew.
|
| 404 |
No such stage.
|
POST
/api/stages/{stage}/pair
token required
Draw the next Swiss round
A Swiss stage draws each round itself when the last result of the round before it is entered, so this too is a repair path. It depends only on rounds that are complete, which makes it safe to call twice.
Parameters
stage |
path, required |
The stage's id. |
Responses
| 200 |
round is the round drawn, or -1 when there was nothing to draw: the round in progress is not finished, or the stage has played out. rematch is true when the field ran out of fresh opponents and the round repeats a meeting.
Example{
"stage": "s4h6j8k0m2n4p6q",
"round": 2,
"rematch": false
}
|
| 400 |
The stage is not a Swiss stage.
|
| 401 |
No token.
|
| 403 |
The token's account is not on this tournament's crew.
|
| 404 |
No such stage.
|
Entries
Taking a team out of a running tournament, putting one back, and fitting in a team that arrived after the draw. Each is one transaction that also retallies every table it touches.
POST
/api/entries/{entry}/withdraw
token required
Take a team out
Closes every match the team had left and retallies every stage, in one transaction. policy has no default, because the two answers rank everybody else differently: forfeit lets what they played stand and gives the rest to their opponents as walkovers; void strikes every match they were in, on both sides. status is withdrawn (the default) or disqualified.
Parameters
entry |
path, required |
The entry's id. |
Request body
{
"policy": "forfeit",
"status": "withdrawn"
}
Responses
| 200 |
The entry's new state.
Example{
"entry": "e1a2b3c4d5f6g7h",
"status": "withdrawn",
"policy": "forfeit"
}
|
| 400 |
policy is missing or is neither forfeit nor void.
|
| 401 |
No token.
|
| 403 |
The token's account is not on this tournament's crew.
|
| 404 |
No such entry.
|
POST
/api/entries/{entry}/reinstate
token required
Put a team back
Undoes exactly what taking them out did, and nothing else: the matches that withdrawal closed are reopened and the tables are rebuilt.
Parameters
entry |
path, required |
The entry's id. |
Responses
| 200 |
The entry's new state.
Example{
"entry": "e1a2b3c4d5f6g7h",
"status": "active"
}
|
| 400 |
The team could not be put back.
|
| 401 |
No token.
|
| 403 |
The token's account is not on this tournament's crew.
|
| 404 |
No such entry.
|
POST
/api/entries/{entry}/admit
token required
Fit in a team that arrived after the draw
Create the entry through the records API first, then call this. What it does depends on the format: in a round robin the team joins the smallest group and gets a match against everybody in it; in a Swiss it takes a seat in the table and is paired from the next round; a knockout drawn from the entries is drawn again, and only while nobody has played in it.
Every stage is checked before anything is written, so a refusal leaves the tournament untouched. A team already in a stage is left where it is.
Parameters
entry |
path, required |
The entry's id. |
Responses
| 200 |
The stages the team was admitted to.
Example{
"entry": "e3c4d5f6g7h8j9k",
"stages": [
"s4h6j8k0m2n4p6q"
]
}
|
| 400 |
A stage cannot take them, most often because a knockout has already started. The message says which.
|
| 401 |
No token.
|
| 403 |
The token's account is not on this tournament's crew.
|
| 404 |
No such entry.
|
Crew
How a second person gets access to a tournament: the owner shows a join code, and whoever scans it becomes a referee, a scorer or an organiser.
GET
/api/staff/invite/{token}
no token
What a join code is for
The name of the tournament and the role on offer, and nothing else about the event. Public, so that a join screen can say what is being accepted before anybody accepts it. A withdrawn code answers the same 404 as one that never existed.
Parameters
token |
path, required |
The join code's token. |
Responses
| 200 |
The invitation. role is organizer, referee or scorer.
Example{
"name": "Autumn Cup",
"role": "referee"
}
|
| 404 |
This invitation is not valid.
|
POST
/api/staff/join
token required
Accept a join code
Adds the signed-in account to the tournament's crew in the role the code carries. name is what the rest of the crew sees beside the results this person enters; left empty it falls back to the role. Scanning a different role's code changes the role instead of adding a second row, and the owner scanning their own code changes nothing.
Request body
{
"token": "Zk4mP9qR2sT7vX1b",
"name": "Jana"
}
Responses
| 200 |
The tournament joined and the role held in it.
Example{
"tournament": "t8w2k1m0q9x4c7z",
"name": "Autumn Cup",
"role": "referee"
}
|
| 401 |
No token.
|
| 404 |
This invitation is not valid.
|
Clubs
A club is the one public address, /c/{slug}, that the tournaments somebody runs every month are listed at. One per account, and only on an account somebody can sign back into: a club made on the wizard's temporary account would be gone with the browser. These routes are what the account screen does, with the rules spelled out. The logo is the one thing they leave to the records API, as a multipart PATCH /api/collections/clubs/records/{id} with a logo file.
PATCH
/api/clubs/{slug}
token required
Rename a club or change its colour
Send name, accent or both; whatever is left out stays as it is. accent is #rrggbb, or an empty string for the app's own colour. The slug cannot be changed: it is printed on posters, and changing it would break every link already handed out.
Parameters
slug |
path, required |
The club's slug. |
Request body
{
"name": "TJ Sokol Brno",
"accent": "#0b7a43"
}
Responses
| 200 |
The club as it is now.
Example{
"id": "c4h7k2m9p1r3t5v",
"name": "TJ Sokol Brno",
"slug": "tj-sokol-brno",
"accent": "#0b7a43",
"logo": "",
"page_url": "https://whistle.day/c/tj-sokol-brno"
}
|
| 400 |
An empty or overlong name, or an accent that is not #rrggbb.
|
| 401 |
No token.
|
| 403 |
The club belongs to another account.
|
| 404 |
No club has this slug.
|
POST
/api/clubs
token required
Set up a club
Makes the caller's club and its public page. slug is optional and is made from the name when left out, the same way the setup screen suggests one: TJ Sokol Brno-Židenice becomes tj-sokol-brno-zidenice. It is 3 to 40 lowercase letters and digits, words joined by single dashes, and cannot be changed afterwards.
The page starts empty. Nothing is listed on it until it is listed with PUT /api/clubs/{slug}/tournaments/{tournament}.
Request body
{
"name": "TJ Sokol Brno",
"slug": "tj-sokol-brno"
}
Responses
| 201 |
The club. Location is its public page's API address.
Example{
"id": "c4h7k2m9p1r3t5v",
"name": "TJ Sokol Brno",
"slug": "tj-sokol-brno",
"accent": "",
"logo": "",
"page_url": "https://whistle.day/c/tj-sokol-brno"
}
|
| 400 |
The slug is taken or malformed, the name is missing, the account already has a club, or it is a temporary account. The message says which.
|
| 401 |
No token.
|
PUT
/api/clubs/{slug}/tournaments/{tournament}
token required
Put a tournament on a club's page
Lists one of the caller's tournaments on the caller's club. The page links to the tournament's screen, so this publishes it, and only the owner of both may: being on a tournament's crew is not enough. A draft can be listed and stays off the page until it is published. Listing a tournament that is on another of the caller's clubs moves it. Sending it twice changes nothing.
Parameters
slug |
path, required |
The club's slug. |
tournament |
path, required |
The tournament's id. |
Responses
| 200 |
Where the tournament stands now.
Example{
"tournament": "t8w2k1m0q9x4c7z",
"club": "c4h7k2m9p1r3t5v",
"listed": true,
"status": "live"
}
|
| 400 |
No tournament with this id that the caller owns.
|
| 401 |
No token.
|
| 403 |
The club belongs to another account.
|
| 404 |
No club has this slug.
|
DELETE
/api/clubs/{slug}/tournaments/{tournament}
token required
Take a tournament off a club's page
The other half of the PUT on the same address, with the same rules. Its results and screens are untouched; the page just stops listing it. A tournament that was not on this club's page is left as it is.
Parameters
slug |
path, required |
The club's slug. |
tournament |
path, required |
The tournament's id. |
Responses
| 200 |
Where the tournament stands now.
Example{
"tournament": "t8w2k1m0q9x4c7z",
"club": "c4h7k2m9p1r3t5v",
"listed": false,
"status": "live"
}
|
| 400 |
No tournament with this id that the caller owns.
|
| 401 |
No token.
|
| 403 |
The club belongs to another account.
|
| 404 |
No club has this slug.
|
GET
/api/organiser/club
token required
The caller's club
The club the caller runs, or null when there is none yet, and every tournament the caller owns with whether it is on the club's page. Everything a script needs to decide what to list.
Responses
| 200 |
The club and the caller's tournaments.
Example{
"club": {
"id": "c4h7k2m9p1r3t5v",
"name": "TJ Sokol Brno",
"slug": "tj-sokol-brno",
"accent": "#0b7a43",
"logo": "",
"page_url": "https://whistle.day/c/tj-sokol-brno"
},
"tournaments": [
{
"id": "t8w2k1m0q9x4c7z",
"name": "Autumn Cup",
"status": "live",
"listed": true
},
{
"id": "t2m4p6r8t0v2x4z",
"name": "Winter Cup",
"status": "draft",
"listed": false
}
]
}
|
| 401 |
No token.
|
Account
The wizard and the MCP server both start a tournament on a temporary account that nobody signed up for. These endpoints turn that account into a person's, hand it to somebody else, or delete it.
POST
/api/organiser/claim
token required
Put an email and a password on a temporary account
Turns the account the wizard made into one somebody can sign in with. It works only on an account that has never had an address. Every token issued before the claim stops working, so sign in again with the new address and password. A confirmation email is sent, and the account works before it is confirmed.
A refusal does not say whether the address is already in use.
Request body
{
"email": "jana@example.com",
"password": "correct horse battery"
}
Responses
| 200 |
Claimed.
Example{
"email": "jana@example.com"
}
|
| 400 |
The account already has an email, the password is shorter than 8 characters, or the address cannot be used.
|
| 401 |
No token.
|
POST
/api/organiser/merge
token required
Move a temporary account's tournaments into an existing account
For somebody who started a tournament on a temporary account and already has an account here, so the claim refuses their address. Call it signed in as the existing account, with the temporary account's token in the body as proof you hold it. Everything the temporary account owns — tournaments, clubs, events, staff places, refereeing — moves to the signed-in account, and the temporary account is deleted.
Request body
{
"device_token": "eyJhbGciOi…"
}
Responses
| 200 |
Merged.
Example{
"merged": "u3k9x2m1q8w7c4z"
}
|
| 400 |
The signed-in account is itself temporary, or the token is not a valid temporary account's.
|
| 401 |
No token.
|
POST
/api/organiser/handoff
token required
Make a link that hands a tournament to a person
For an account that cannot claim itself, which in practice is one an agent is holding. The owner mints a link, sends it to whoever is running the day, and that person sets their own email and password on it. The link is single-use and expires after 24 hours; minting another burns the one before it.
Request body
{
"tournament": "t8w2k1m0q9x4c7z"
}
Responses
| 200 |
The link.
Example{
"token": "4f9c…",
"url": "https://whistle.day/claim/4f9c…",
"expires": "2026-10-04 09:41:12.000Z"
}
|
| 400 |
The account already belongs to somebody, so there is nothing to hand over.
|
| 401 |
No token.
|
| 403 |
Only the owner can hand a tournament over.
|
| 404 |
No such tournament.
|
GET
/api/organiser/handoff/{token}
no token
What a handoff link is for
The name of the tournament on offer. Public, because the person opening the link has no account yet.
Parameters
token |
path, required |
The token from the link. |
Responses
| 200 |
The tournament's name.
Example{
"tournament": "Autumn Cup"
}
|
| 404 |
The link has been used, has expired, or never existed.
|
POST
/api/organiser/handoff/{token}/claim
no token
Take a tournament over with an email and a password
Public: the link is the credential. The account behind it gets the address and password sent here, the link is spent, and every token the previous holder had stops working. Sign in afterwards with what was just set.
Parameters
token |
path, required |
The token from the link. |
Request body
{
"email": "jana@example.com",
"password": "correct horse battery"
}
Responses
| 200 |
Claimed.
Example{
"email": "jana@example.com",
"tournament": "t8w2k1m0q9x4c7z"
}
|
| 400 |
The password is shorter than 8 characters, the address cannot be used, or the tournament already belongs to somebody.
|
| 404 |
The link has been used, has expired, or never existed.
|
POST
/api/organiser/handoff/{token}/oauth-session
no token
Start taking a tournament over with Google or Facebook
The first of two requests either side of the provider's redirect. It returns a token for the account behind the link, so that completing PocketBase's own OAuth2 sign-in with it links the provider to that account instead of creating a new one. Nothing about the account changes here and the link is not spent.
Parameters
token |
path, required |
The token from the link. |
Responses
| 200 |
A token for the account being handed over.
Example{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…"
}
|
| 400 |
The tournament already belongs to somebody.
|
| 404 |
The link has been used, has expired, or never existed.
|
POST
/api/organiser/handoff/{token}/finish
token required
Finish taking a tournament over with Google or Facebook
The second request, sent with the token from oauth-session once the provider has been linked. The link is spent, the account's old password and tokens stop working, and the answer carries the one token that still does. email is optional: send the address the provider returned to put it on the account.
Parameters
token |
path, required |
The token from the link. |
Request body
{
"email": "jana@example.com"
}
Responses
| 200 |
Claimed, with a fresh token.
Example{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…",
"email": "jana@example.com",
"tournament": "t8w2k1m0q9x4c7z"
}
|
| 400 |
The address cannot be used.
|
| 401 |
No token.
|
| 403 |
The token did not come from this link.
|
| 404 |
The link has been used, has expired, or never existed.
|
DELETE
/api/organiser/account
token required
Delete the account and everything it owns
Permanent. Every tournament the account owns is deleted with its courts, teams, stages, matches, tables, screens and crew; the account is removed from the crews it was on, and from any match it was down to referee.
Responses
| 200 |
Deleted.
Example{
"deleted": true
}
|
| 401 |
No token.
|
POST
/api/organiser/delete
token required
Delete the account, for clients that cannot send DELETE
The same operation as DELETE /api/organiser/account.
Responses
| 200 |
Deleted.
Example{
"deleted": true
}
|
| 401 |
No token.
|
Agents
The MCP server and the OAuth 2.1 authorization server in front of it. Connection instructions for Claude, ChatGPT, Cursor and other clients are on the MCP page at https://whistle.day/mcp.
GET
/api/mcp
no token
Open the stream an MCP client listens on
Server-to-client messages for the session in Mcp-Session-Id.
Responses
| 200 |
An open text/event-stream.
|
POST
/api/mcp
no token
Send an MCP request
The MCP server, over Streamable HTTP: JSON-RPC in the body, the session in the Mcp-Session-Id header the server hands out on initialize. No credential is needed to start: create_tournament makes a temporary account and the session remembers it. A client that has been through the OAuth flow below sends its access token as Authorization: Bearer and works on that account instead. Limited to 120 requests a minute per IP address.
Responses
| 200 |
A JSON-RPC response, as JSON or as an event stream.
|
| 429 |
More than 120 requests in a minute from this IP address.
|
DELETE
/api/mcp
no token
End an MCP session
Ends the session in Mcp-Session-Id. A temporary account lasts as long as the session that made it, so call the create_handoff tool first to keep the tournament.
Responses
| 200 |
The session is closed.
|
GET
/.well-known/oauth-protected-resource
no token
Where the MCP server's tokens come from
Protected resource metadata (RFC 9728): names /api/mcp as the resource and this host as its authorization server.
Responses
| 200 |
The metadata document.
|
GET
/.well-known/oauth-authorization-server
no token
The OAuth endpoints and what they support
Authorization server metadata (RFC 8414), and the authoritative list of the endpoints below. Authorization code with PKCE (S256) and refresh tokens, public clients only, one scope: tournaments.
Responses
| 200 |
The metadata document.
|
POST
/oauth/register
no token
Register an OAuth client
Dynamic client registration (RFC 7591). Send redirect_uris and a client_name; the answer carries the client_id to use from then on. There is no client secret.
Responses
| 201 |
The registered client.
|
| 400 |
The registration is not acceptable, most often because of a redirect URI.
|
GET
/oauth/authorize
no token
Ask a person to connect their account
The authorization endpoint. Send the browser here with a standard authorization code request carrying a PKCE code_challenge; the person signs in, approves, and is sent back to the client's redirect_uri with a code.
Responses
| 302 |
A redirect, to the consent screen or back to the client.
|
| 400 |
The client or its redirect URI is not recognised.
|
POST
/oauth/token
no token
Exchange a code or a refresh token
The token endpoint, taking grant_type=authorization_code with the PKCE code_verifier, or grant_type=refresh_token. Refresh tokens rotate: each one is good once, and using a spent one revokes the whole family.
Responses
| 200 |
An access token for /api/mcp and a refresh token.
|
| 400 |
An OAuth error object, such as invalid_grant.
|
Collections
What the records API reads and writes. A tournament is an ordered list of stages; a stage holds pools; a pool holds slots, and a fixture is played between two of them. The field lists below are read from the running database, so they are what the API returns today.
| Collection | What it is | Read | Write |
events |
A combat-sport day: its mats (mats, a list of names), the rest required between bouts (rest_seconds) and its status (draft, weigh_in, live, finished). Its divisions are tournaments with event set. |
Anybody once out of draft; the owner while a draft |
The owner |
tournaments |
The event: its name, sport, status, and how matches are scored and ties are broken. |
Anybody once published; owner and crew while a draft |
Any signed-in account creates one. Owner and crew update, the owner deletes. Only the owner sets club |
clubs |
Who runs a series of tournaments, and the address they are listed together at. A tournament's club puts it on that page. |
The owner. Everybody else reads one through GET /api/clubs/{slug} |
The owner. The routes under Clubs above are the easier way in, and the only one that keeps to one club per account |
courts |
Playing areas, named as the venue names them. |
Anybody once published |
Owner and crew |
entries |
A participant, team or individual. short_name is what a projector draws. |
Anybody once published |
Owner and crew |
stages |
A phase of the tournament. A tournament is an ordered list of them, each with its own format and config. |
Anybody once published |
Owner and crew |
pools |
A self-contained part of a stage: one round-robin group, or one side of a bracket. |
Anybody once published |
Owner and crew; normally written by drawing the stage |
slots |
A position that gets filled later, such as the winner of a semi-final or first place in group A. entry is empty until its source resolves. |
Anybody once published |
Owner and crew; normally written by drawing the stage |
fixtures |
A match. Entering a result is a patch to one of these. |
Anybody once published |
Owner and crew |
games |
The sets, legs or maps inside a match. |
Anybody once published |
Owner and crew |
standings |
A table, rebuilt from scratch after every result. tiebreak records which criteria placed each row. |
Anybody once published |
The server only |
fixture_events |
An append-only record of who changed a result, from what, to what. |
Anybody once published |
The server only |
sponsors |
The businesses credited on a tournament's closing screen. |
Anybody once published |
Owner and crew |
displays |
A projector screen and how it is configured: which panels, how fast it rotates, what it is narrowed to. |
Whoever sends the screen's ?token=, and the owner and crew |
Owner and crew |
staff |
The crew: who may operate a tournament, in which role, and the name they gave when they joined. |
Owner and crew |
The owner. People join through POST /api/staff/join |
invites |
A join code: one token per role. |
The owner |
The owner |
events fields
id | text |
name | text |
owner | relation to users |
sport | text |
location | text |
starts_on | date |
status | draft | weigh_in | live | finished |
mats | json |
rest_seconds | number |
settings | json |
created | autodate |
updated | autodate |
tournaments fields
id | text |
name | text |
slug | text |
sport | text |
location | text |
starts_on | date |
ends_on | date |
status | draft | published | live | finished | archived |
owner | relation to users |
logo | file |
scoring | json |
settings | json |
created | autodate |
updated | autodate |
club | relation to clubs |
event | relation to events |
division | json |
clubs fields
id | text |
name | text |
slug | text |
owner | relation to users |
logo | file |
accent | text |
created | autodate |
updated | autodate |
courts fields
id | text |
tournament | relation to tournaments |
name | text |
position | number |
active | bool |
created | autodate |
updated | autodate |
entries fields
id | text |
tournament | relation to tournaments |
name | text |
short_name | text |
club | text |
contact | text |
seed | number |
status | registered | checked_in | active | withdrawn | disqualified |
logo | file |
members | json |
created | autodate |
updated | autodate |
withdrawal | forfeit | void |
declared_weight | number |
weight | number |
weigh_in | ok | over | moved | scratched |
birth_year | number |
stages fields
id | text |
tournament | relation to tournaments |
position | number |
name | text |
format | round_robin | single_elim | double_elim | swiss | ladder |
status | draft | seeded | live | finished |
config | json |
created | autodate |
updated | autodate |
name_kind | text |
pools fields
id | text |
stage | relation to stages |
name | text |
position | number |
kind | group | winners | losers | final | consolation | repechage |
advance_count | number |
created | autodate |
updated | autodate |
name_kind | text |
slots fields
id | text |
stage | relation to stages |
pool | relation to pools |
round | number |
position | number |
label | text |
entry | relation to entries |
source_type | direct | fixture_winner | fixture_loser | pool_rank | stage_rank | bye |
source_pool | relation to pools |
source_stage | relation to stages |
source_position | number |
created | autodate |
updated | autodate |
source_fixture | relation to fixtures |
label_kind | text |
label_args | json |
fixtures fields
id | text |
tournament | relation to tournaments |
stage | relation to stages |
pool | relation to pools |
round | number |
position | number |
code | text |
home_slot | relation to slots |
away_slot | relation to slots |
home_entry | relation to entries |
away_entry | relation to entries |
status | pending | ready | live | finished | walkover | bye | cancelled |
home_score | number |
away_score | number |
winner | relation to entries |
loser | relation to entries |
court | relation to courts |
referee | relation to users |
scheduled_at | date |
started_at | date |
finished_at | date |
locked | bool |
notes | text |
created | autodate |
updated | autodate |
forfeited_by | relation to entries |
mat | number |
called_at | date |
combat | json |
games fields
id | text |
fixture | relation to fixtures |
number | number |
home_score | number |
away_score | number |
finished | bool |
created | autodate |
updated | autodate |
standings fields
id | text |
stage | relation to stages |
pool | relation to pools |
entry | relation to entries |
position | number |
played | number |
won | number |
drawn | number |
lost | number |
score_for | number |
score_against | number |
sub_for | number |
sub_against | number |
points | number |
tiebreak | json |
qualified | bool |
created | autodate |
updated | autodate |
fixture_events fields
id | text |
fixture | relation to fixtures |
actor | relation to users |
kind | recorded | corrected | cleared |
status | text |
home_score | number |
away_score | number |
winner | relation to entries |
previous | json |
created | autodate |
displays fields
id | text |
tournament | relation to tournaments |
name | text |
token | text |
mode | auto | now_playing | standings | bracket | schedule | results | court_schedule | stage_progress |
rotate_seconds | number |
scope | json |
theme | json |
active | bool |
created | autodate |
updated | autodate |
panels | json |
staff fields
id | text |
tournament | relation to tournaments |
user | relation to users |
role | organizer | referee | scorer |
created | autodate |
updated | autodate |
name | text |
invites fields
id | text |
tournament | relation to tournaments |
token | text |
role | organizer | referee | scorer |
active | bool |
created | autodate |
updated | autodate |