GoTak API

A Tak game server API providing endpoints for game management and gameplay.

📚 View Swagger Documentation

Available Endpoints

post
/auth/confirm-reset
Reset password with token
auth
post
/auth/login
Login with email and password
auth
post
/game/{slug}/annotate
Add or update a comment on a specific move
game
get
/game/{slug}/chat
Returns recent spectator chat history (up to 50 messages). Active game players are forbidden from reading.
game
get
/game/{slug}/position/{turn}
Replays the game forward until it has applied every move of every turn with Number <= turn, then returns the resulting board. turn=0 yields the starting (empty) position; turn beyond the final turn yields the final position.
game
get
/game/{slug}/replay
Returns an ordered list of every half-turn played in the game, along with the board state after each one, so a client can step through without making per-turn requests.
game
get
/game/{slug}/spectate
Returns the current game state, spectator count, and WebSocket URL for live updates. When requested with WebSocket upgrade headers, opens a live spectating stream.
game
post
/analyze/compare-moves
Plays each candidate PTN move from a TPS position and scores the result. Each move reports a White-relative score, its loss against the engine's best move for the player to move, and the engine's best reply. Sorted best first; illegal moves carry an error and sort last. At most 16 moves.
analysis
post
/analyze/game/{slug}
Walks the game move-by-move and scores every position with the engine. Each move gets the engine's preferred move and line, White-relative scores before and after, the loss it cost its player (about 400 per flat), and a quality label. critical_moments lists the costliest moves. Boards up to 8x8.
analysis
get
/analyze/game/{slug}/jobs/{id}
Reports a job started by POST /analyze/game/{slug} for a long game: running, failed with an error, or done with the full analysis in result.
analysis
post
/auth/register
Register with email and password
auth
get
/game/new
Creates a new Tak game with the specified board size
game
post
/game/new
Creates a new Tak game with the specified board size
game
post
/game/{slug}/join
Join a game that is waiting for a second player (as black player)
game
get
/game/{slug}/{turn}
Returns the state of a game at a specific turn
game
get
/
Returns basic API information and available endpoints
info
get
/analyze/heatmap
Returns per-square piece placement counts across all stored games of the given board size, split by player color and stone type. Turn 1 placements in Tak place the opponent's piece, so turn 1 placements are attributed to the stone's color (the opponent).
analysis
get
/auth/profile
Get current user profile information
auth
put
/auth/profile
Update current user profile information
auth
get
/analyze/openings
Given a prefix of moves (in PTN order — White on turn 1 first, Black second, then alternating), returns the count of stored games matching the prefix and the frequency of moves played in the next half-turn. Empty prefix lists first-move distribution across all games.
analysis
post
/analyze/tree
Builds a tree of candidate moves and variations from a TPS position. Each node reports score and forced win; leaves carry the engine's principal variation. Breadth up to 4, depth up to 3.
analysis
post
/auth/logout
Logout current user (client should discard token)
auth
post
/auth/reset-password
Send password reset token for email
auth
get
/game/{slug}
Returns the current state of a game
game
post
/game/{slug}/move
Submit a move for a specific game
game
get
/game/{slug}/ptn
Serialises the game as Portable Tak Notation text.
game
get
/healthz
Returns service health status
health
post
/analyze/position
Scores an arbitrary position given in TPS. Returns the engine's best move and line, a White-relative score (about 400 per flat; forced wins are +/-100000 with forced_win set), and squares where either side could complete a road with one flat. Boards from 4x4 to 8x8.
analysis