Skip to main content

API reference

The core API is a FastAPI app. All routes live under /v1. The full machine-readable schema, with request and response models, is openapi.json.

Regenerating

The tables below and openapi.json are generated from the app. After adding or changing a route, run DB_PASSWORD=test python scripts/export_openapi.py. A test fails if either file is stale or a route has no description.

How requests are authorized​

CallerGate
Browser usersoauth2-proxy in front of fantasy-web-ui. The API itself does not check user identity.
In-cluster CronJobs and fantasy-browser-workerX-API-Key header, checked against TRIGGER_API_KEY.

The X-API-Key column marks the routes that enforce the header. Without a configured TRIGGER_API_KEY, those routes return 500; with a wrong key, 401.

Which endpoints act on ESPN​

Accepted means queued by the API, not done on ESPN. See Queue publishing for payloads and idempotency.

Endpoints​

Trigger​

MethodPathPurposeX-API-KeyPublishes to
POST/v1/trigger/draft-pickQueue the recommended draft pick.Yesdraft_targets
POST/v1/trigger/lineupQueue lineup swaps and IR moves.Yeslineup_updates
POST/v1/trigger/rumor-actionEvaluate rumor signals now and queue the resulting moves.Nolineup_updates, waiver_actions
POST/v1/trigger/waiverQueue a waiver claim, optionally held behind an IR move.Yeswaiver_actions

Trade​

MethodPathPurposeX-API-KeyPublishes to
GET/v1/trade/candidatesList the latest precomputed league-wide trade candidates.No
GET/v1/trade/contextShow current rosters and head-to-head schedule evidence for trades.No
POST/v1/trade/evaluateCompute raw VORP delta for a trade.No
GET/v1/trade/incomingList incoming trade offers with scores and negotiation state.No
POST/v1/trade/incoming/{espn_transaction_id}/counterQueue a counter offer for an incoming offer.Yestrade_negotiations
POST/v1/trade/incoming/{espn_transaction_id}/decisionQueue an accept or decline for an incoming offer.Yestrade_responses
POST/v1/trade/incoming/{espn_transaction_id}/decision/retryQueue the same response again after a rejected or unknown attempt.Yestrade_responses
GET/v1/trade/incoming/{espn_transaction_id}/threadShow one offer's negotiation thread.No
POST/v1/trade/incoming/{espn_transaction_id}/triageDismiss or snooze an incoming offer.Yes
GET/v1/trade/offersList generated trade proposals with their stored score evidence.No
POST/v1/trade/offers/{offer_key}/approveApprove a staged proposal and queue it.Notrade_submissions
POST/v1/trade/offers/{offer_key}/resolutionRecord how ESPN resolved a sent offer, freeing its players for new trades.Yes
POST/v1/trade/scoreCompute the schedule-aware trade score.No

Draft day​

MethodPathPurposeX-API-KeyPublishes to
POST/v1/draft/auto-publishTurn draft auto-publish on or off.No
GET/v1/draft/configRead the stored live draft config.No
POST/v1/draft/configStore the league, team, season and mode for the draft listener.No
GET/v1/draft/logsTail the draft-sync pod log.No
POST/v1/draft/pausePause the auto-publish for a pick.No
DELETE/v1/draft/practice/sync-jobDelete the practice Job and its Redis state.No
POST/v1/draft/practice/sync-jobCreate a draft-sync Job for a practice room.No
GET/v1/draft/practice/sync-job/statusShow the practice Job's state.No
POST/v1/draft/resumeRecompute and republish the recommendation.No
POST/v1/draft/startCreate the draft-sync Kubernetes Job.No
GET/v1/draft/statusShow draft board, Job and listener state.No
POST/v1/draft/stopDelete a draft-sync Job and its Redis state.No
GET/v1/draft/streamStream draft status as server-sent events.No

Activity​

MethodPathPurposeX-API-KeyPublishes to
GET/v1/activity/actionsList queued actions with their delivery and verification state.No
GET/v1/activity/actions/{identity}Show one action with its event timeline.No
POST/v1/activity/actions/{identity}/checkRe-verify an action against ESPN now.No
GET/v1/activity/botsSummarize each bot's recent activity.No
GET/v1/activity/jobsLatest run and recent failure count per job, plus dead-letter queue depths.No
POST/v1/activity/read/{identity}Mark an activity item read.No
GET/v1/activity/runsList job and bot runs (audit log), newest first.No
GET/v1/activity/runs/{identity}Show one run with its trigger, inputs, outputs and child runs.No
GET/v1/activity/sessionsList bot sessions.No
GET/v1/activity/sessions/{identity}Show one bot session.No
GET/v1/activity/traceTrace an article, rumor evaluation or move through the rumor pipeline.No

Jobs​

MethodPathPurposeX-API-KeyPublishes to
GET/v1/jobsList catalog jobs and chains, including overrides and latest runs.No
DELETE/v1/jobs/{name}/pauseRemove a job or chain pause.Yes
PUT/v1/jobs/{name}/pausePause a catalog job or chain until a time, or indefinitely.Yes
POST/v1/jobs/{name}/runsQueue a catalog job run for the launcher.Yesjob_runs
GET/v1/launcher/healthShow launcher heartbeat age, queue depths and run counts.No
GET/v1/runs/{identity}Show one launcher run and its linked activity.No
POST/v1/runs/{identity}/cancelCancel a queued or running launcher run.Yes

Roster and waivers​

MethodPathPurposeX-API-KeyPublishes to
GET/v1/roster/bye-outlookShow which upcoming weeks NFL byes leave the lineup short.No
GET/v1/roster/deficitsShow per-position roster deficits.No
POST/v1/roster/move-previewPreview the effect of a roster move.No
GET/v1/waiver/free-agentsBrowse all claimable free agents with metrics and same-position swap values.No
GET/v1/waiver/recommendationsRecommend waiver adds and drops.No

League and matchup​

MethodPathPurposeX-API-KeyPublishes to
GET/v1/league/current-weekShow the current NFL week.No
GET/v1/league/player-leadersShow top scorers.No
GET/v1/league/standingsShow league standings.No
GET/v1/league/teamsList league teams.No
GET/v1/matchupShow our matchup for a season and week.No
GET/v1/matchup/rosterShow a matchup roster with swap and IR suggestions.No
GET/v1/matchup/scoreboardShow every matchup's score for a season and week.No
GET/v1/scoreboardSame as /v1/matchup/scoreboard.No

Players and stats​

MethodPathPurposeX-API-KeyPublishes to
GET/v1/players/searchSearch players by name.No
GET/v1/players/{player_id}/summaryShow one player's season summary.No
GET/v1/stats/vorpList VORP scores.No

Backtests​

MethodPathPurposeX-API-KeyPublishes to
GET/v1/backtest/resultsList backtest runs.No
GET/v1/backtest/results/{season}Show the backtest for a season.No

Chat and health​

MethodPathPurposeX-API-KeyPublishes to
POST/v1/chat/queryAsk the LLM a roster or waiver question.No
GET/v1/healthCheck Postgres and RabbitMQ reachability.No
GET/v1/livezLiveness probe; checks no dependencies.No