Gaffr API
REST under https://api.gaffr.app, realtime over WebSocket. Auth via signed JWT in the Authorization header.
Every authenticated request must include:
Authorization: Bearer <supabase_access_token> Content-Type: application/json
Auth
/auth/oauth/googleInitiates Google OAuth via Supabase.
{ "url": "https://accounts.google.com/o/oauth2/v2/auth?..." }/auth/oauth/appleInitiates Apple OAuth via Supabase.
{ "url": "https://appleid.apple.com/auth/authorize?..." }/auth/signoutRevokes the current session.
{ "ok": true }Roster
/api/roster/seasonReturns the locked 5-player season roster.
{
"locked_at": "2025-08-14T18:22:00Z",
"players": [
{ "id": "p11", "name": "Bukayo Saka", "position": "MID", "team": "ARS", "points": 32 },
{ "id": "p14", "name": "William Saliba", "position": "DEF", "team": "ARS", "points": 8 }
],
"total": 78,
"state": "alive"
}/api/roster/seasonLocks 5 players for the season. Rejects after lock.
{ "players": ["p11", "p14", "p25", "p28", "p15"] }{ "locked_at": "2025-08-14T18:22:00Z", "ok": true }/api/roster/january-switchSwap exactly one player. Only valid Jan 1–31.
{ "out": "p1", "in": "p38" }{ "ok": true, "new_total": 76, "state": "alive", "switch_used": true }/api/roster/monthlyReturns the current month's 3-player roster.
{ "month": "2025-11", "players": ["p22","p36","p30"], "total": 9, "target": 15 }/api/roster/monthlyLocks 3 outfielders for the current month.
{ "players": ["p22","p36","p30"] }{ "ok": true, "month": "2025-11" }Players
/api/playersFilter by team, position, search. Paginated.
{
"data": [
{ "id": "p1", "name": "Mohamed Salah", "team": "liv", "position": "FWD", "price": 13.2, "points": 31 }
],
"page": 1,
"total": 50
}/api/players/:id/statsGranular per-gameweek breakdown including all FPL live metrics.
{
"id": "p1",
"stats": [
{ "gw": 8, "goals": 1, "assists": 0, "yellow": 0, "red": 0, "tackles": 1, "shots": 4, "fouls": 1, "minutes": 90 }
]
}Leaderboards
/api/leaderboard/seasonSorted by total points ascending from 100. Busted users separated.
{
"alive": [
{ "user_id": "u-101", "name": "Sam Whitaker", "total": 98 }
],
"busted": [
{ "user_id": "u-110", "name": "Yuki Tanaka", "total": 103, "over_by": 3 }
]
}/api/leaderboard/monthly?month=2025-11Filtered to gameweeks within the calendar month.
{ "month": "2025-11", "rows": [{ "user_id": "u-101", "total": 14 }] }Admin
/api/admin/scoring-rules/:idChange points or active flag. Admin only.
{ "points": 2, "active": true }{ "ok": true }/api/admin/sync/bootstrapRe-pulls players/teams from FPL.
{ "queued": true, "job_id": "sync_4821" }/api/admin/sync/liveRe-pulls live events for a gameweek.
{ "gw": 9 }{ "queued": true }/api/admin/users/:idSoft-deletes a user and detaches their roster.
{ "ok": true }Realtime
wss://api.gaffr.app/realtime/leaderboardPushes ranking updates as live events score.
event: rank.update
data: { "user_id": "u-103", "delta": 1, "new_total": 87 }