API ReferenceMatches
Forfeit a match
Forfeits a match and grants the win to the oponent.
Triggers the match:game_over ws event to the players and match subscribers.
Path Parameters
match_id*string
Header Parameters
Response Body
application/json
curl -X POST "https://example.com/api/match/string/forfeit"{ "success": true, "data": { "id": 1, "createdAt": "2024-01-01T12:00:00Z", "status": "black_won", "whiteId": "123e4567-e89b-12d3-a456-426614174000", "blackId": "987e6543-e21b-34d5-a678-426614174000", "endReason": "forfeit", "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": "2024-01-01T12:02:00Z", "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": 1100, "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": 1300, "rd": 350, "vol": 0.06 }, "whiteRatingDiff": -100, "blackRatingDiff": 100, "activeDrawRequest": null, "whiteRequestedDraw": false, "blackRequestedDraw": false, "ranked": true }}Request a draw POST
Requests a draw for an active match. Triggers the `match:draw_request` ws event to the opponent.
Make a move POST
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