Skip to content
Toggles

Player API

Your board, from your own scripts

If you'd rather keep your hypotheses in a spreadsheet or a script than click switches, the player API lets you set your board and read your results. It can do only what the board can: the same dates, the same lock at 23:00 UTC, the same settings each toggle takes. It never returns an answer, and scoring still happens once a night, so it's no faster route to a perfect board.

Getting a token

Sign in, open Settings, API tokens, and create a token. It's shown once, so copy it then. You can hold up to 5 at a time and revoke any of them. Send it with every request:

curl -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Accept: application/json" \
     https://toggles.codewalkers.net/api/v1/season

Each token gets 60 requests a minute. A suspended account, or one whose email isn't verified, gets 403.

Endpoints

RequestWhat it does
GET /api/v1/seasonYour season, today's game date, the lock time, your totals, and the toggles active for you today
GET /api/v1/board/{date}Your board for a date, from the day you joined to 14 days ahead
PUT /api/v1/board/{date}Save settings for a date, today through 14 days ahead
GET /api/v1/results?from=&to=Your scored days, with each toggle's feedback and points; add season= for an earlier season
GET /api/v1/dispatch/{date}The public Daily Dispatch numbers for a night, or latest. No token needed

Dates are game dates in UTC, written YYYY-MM-DD. Toggles are numbered 1 to 24 in board order, and the Final Lock is 25.

Saving a board

Send the settings you want to change, by toggle number. Toggles you leave out keep the setting that carries forward, just as on the board.

curl -X PUT https://toggles.codewalkers.net/api/v1/board/2027-01-15 \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d '{"settings": {"3": true, "7": "Ebb", "12": 42}}'

The reply is the saved board. Each toggle in it says what it takes under takes:

When a save is refused

A save the rules don't allow gets 422 with a reason you can check and a message you can show:

{
  "reason": "date_closed",
  "message": "The board for Jan 15, 2027 can't be changed: it has locked, or it's not open yet."
}
ReasonMeaning
date_closedThe date has locked, isn't open yet, or is before you joined
toggle_not_activeThat toggle isn't active for you on that date
invalid_settingThat isn't a setting the toggle can take
season_closedThe season isn't open to play
not_joinedYou haven't joined a season (404)

Saves arriving at the lock are settled the same way as on the board: a save either lands before 23:00 UTC or is refused, never half saved.

Fair use

Use a token for your own board only, and keep it to yourself: anyone holding it can set your board. If one leaks, revoke it and create another.