Cupday

REST API

Open JSON endpoints for schedules, results and live updates.

Base URL: https://cupday.app. JSON in and out. Everything public is open; organizer and referee calls use the secret token from their link.

Plan and create

POST /api/plan

Schedule options for a description. Saves nothing.

Auth: None

POST /api/plan
{ "description": "U10 cup Saturday 9-14, 3 pitches", "teams": "Riverside Blue\nHarbour United\nHill Town\nOakfield", "overrides": { "match_minutes": 12 } }

POST /api/tournaments

Create and publish. Optional "plan" (option number) and "listed": false.

Auth: Signed-in session or OAuth bearer token

POST /api/tournaments
{ "description": "…", "teams": "", "plan": 0 }

201
{ "slug": "spring-cup-2027-ab12", "name": "Spring Cup", "public_url": "https://cupday.app/t/spring-cup-2027-ab12",
  "manage_url": "https://cupday.app/m/<secret>", "referee_url": "https://cupday.app/r/<secret>", "matches": 28 }

Read

GET /api/tournaments?q=&country=&from=&to=&examples=1

Search public tournaments.

Auth: None

{ "tournaments": [ { "slug": "…", "name": "…", "date": "2027-05-15", "country": "GB", … } ] }

GET /api/t/:slug

The whole tournament: teams, matches with scores and status, pitches, tables.

Auth: None

GET /t/:slug/events

Server-sent events. An "update" event fires on every change; then re-fetch.

Auth: None

const es = new EventSource('https://cupday.app/t/<slug>/events');
es.addEventListener('update', () => refresh());

GET /t/:slug/team/:team.ics

Calendar file with one team’s games.

Auth: None

Scores (organizer and referee)

GET /api/m/:token

Role and tournament data for the token.

Auth: Organizer or referee token (+ referee password cookie if set)

{ "role": "manage" | "ref", "version": 12, "tournament": { … } }

POST /api/m/:token/match/:id

Enter or correct a score. Status becomes done when both scores are set, unless given.

Auth: Organizer or referee token

{ "hg": 2, "ag": 1, "status": "done" }   // also "hp"/"ap" for penalties, status "live" | "scheduled"

POST /api/m/:token/referee

Referee access: link only, or link plus password (at least 4 characters).

Auth: Organizer token only

{ "mode": "password", "password": "kentta7" }   // or { "mode": "link" }

POST /r/:token/login

Used by the referee login screen.

Auth: Form post with the referee password; sets a cookie

Errors

  • 400 with { "error": "…" } for bad input, 401 when a referee password is required, 404 for unknown slugs or tokens.