API ReferenceMatches
Make a move
Submits a new move for an active chess match. The move is validated and then the board state is updated.
Triggers the match:board_move ws event to the match subscribers and the opponent.
Also triggers match:game_over to both players and subscribers if the move causes the match to end
Path Parameters
match_id*string
Header Parameters
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/api/match/string/move" \ -H "Content-Type: application/json" \ -d '{ "move": "string" }'{ "success": true, "data": { "move": { "players": { "whiteId": "123e4567-e89b-12d3-a456-426614174000", "blackId": "987e6543-e21b-34d5-a678-426614174000" }, "turn": { "before": "w", "after": "b" }, "pgn": { "before": "[Event \"Casual\"]\n[Site \"https://chessnow.angelcmh.com\"]\n[Date \"2024.01.01\"]\n[Round \"0\"]\n[White \"johndoe\"]\n[Black \"janedoe\"]\n[Result \"*\"]\n\n*", "after": "[Event \"Casual\"]\n[Site \"https://chessnow.angelcmh.com\"]\n[Date \"2024.01.01\"]\n[Round \"1\"]\n[White \"johndoe\"]\n[Black \"janedoe\"]\n[Result \"*\"]\n\n1. e4 *" }, "fen": { "before": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", "after": "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1" }, "san": "e4", "lan": "e2e4", "piece": "p" }, "match": { "id": 1, "createdAt": "2024-01-01T12:00:00Z", "status": "active", "whiteId": "123e4567-e89b-12d3-a456-426614174000", "blackId": "987e6543-e21b-34d5-a678-426614174000", "endReason": null, "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", "pgn": "[Event \"Casual\"]\n[Site \"https://chessnow.angelcmh.com\"]\n[Date \"2024.01.01\"]\n[Round \"0\"]\n[White \"johndoe\"]\n[Black \"janedoe\"]\n[Result \"*\"]\n\n*", "finishedAt": null, "whitePlayer": { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "John Doe", "username": "johndoe", "createdAt": "2024-01-01T12:00:00Z", "updatedAt": "2024-01-01T12:00:00Z", "botOwnerId": null, "rating": 1200, "rd": 350, "vol": 0.06 }, "blackPlayer": { "id": "987e6543-e21b-34d5-a678-426614174000", "name": "Jane Doe", "username": "janedoe", "createdAt": "2024-01-01T12:00:00Z", "updatedAt": "2024-01-01T12:00:00Z", "botOwnerId": null, "rating": 1200, "rd": 350, "vol": 0.06 }, "whiteRatingDiff": null, "blackRatingDiff": null, "activeDrawRequest": null, "whiteRequestedDraw": false, "blackRequestedDraw": false, "ranked": true } }}