API Error Responses

Complete list of error responses for all API endpoints

Error Responses – Complete Reference

All API endpoints return consistent error responses in JSON format. Each error includes an error message and success status.

cross-cutting: pending account deletion

While a player account is inside the deletion grace window, player-scoped endpoints other than delete/restore fail with HTTP 403 and this payload. Provider sign-in through game_players.php/register returns the same payload until the client repeats the sign-in with explicit user consent in {"restore": true}.

{"error":"Account is pending deletion — restore it before the purge date or it will be permanently deleted", "success": false, "deletion_pending": true, "purge_after":"2026-12-26T09:24:32Z"}

game_data.php

endpoint: game/get
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
endpoint: player/get
{"error":"API token is required", "success": false}
{"error":"Game player token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid game player token", "success": false}
{"error":"Player does not belong to this game", "success": false}
{"error":"You are banned", "success": false}
endpoint: game/update
{"error":"API token is required", "success": false}
{"error":"API private token is required", "success": false}
{"error":"Invalid API token or private token", "success": false}
endpoint: player/update
{"error":"API token is required", "success": false}
{"error":"Game player token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player or does not belong to game", "success": false}
endpoint: default
{"error":"Invalid endpoint", "success": false}
{"error":"Method not allowed", "success": false}
{"error":"Database error", "success": false}
{"error":"An unexpected error occurred", "success": false}

game_players.php

endpoint: register
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Player name is required", "success": false}
{"error":"Failed to register player", "success": false}
endpoint: login
{"error":"API token and game player token are required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid game player token", "success": false}
{"error":"You are banned", "success": false}
endpoint: heartbeat
{"error":"API token and game player token are required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Failed to update heartbeat", "success": false}
{"error":"You are banned", "success": false}
endpoint: logout
{"error":"API token and game player token are required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"You are banned", "success": false}
endpoint: rename
{"error":"API token and game player token are required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"New name is required", "success": false}
{"error":"Player name must be between 2 and 50 characters", "success": false}
{"error":"Failed to update player name", "success": false}
{"error":"You are banned", "success": false}
endpoint: delete
{"error":"Method not allowed", "success": false}
{"error":"API token and game player token are required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid game player token", "success": false}
endpoint: restore
{"error":"Method not allowed", "success": false}
{"error":"API token and game player token are required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid game player token", "success": false}
{"error":"Account is not pending deletion", "success": false}
endpoint: list
{"error":"API token and private token are required", "success": false}
{"error":"Invalid API credentials", "success": false}
endpoint: ban
{"error":"API token and private token are required", "success": false}
{"error":"Invalid API credentials", "success": false}
{"error":"player_id is required", "success": false}
{"error":"ban_duration is required (hour, day, week, month, quarter, year, forever)", "success": false}
{"error":"Invalid ban_duration. Must be one of: hour, day, week, month, quarter, year, forever", "success": false}
{"error":"Player not found or does not belong to this game", "success": false}
endpoint: unban
{"error":"API token and private token are required", "success": false}
{"error":"Invalid API credentials", "success": false}
{"error":"player_id is required", "success": false}
{"error":"Player not found or does not belong to this game", "success": false}
endpoint: default
{"error":"Method not allowed", "success": false}
{"error":"Invalid endpoint", "success": false}
{"error":"Internal server error", "success": false}

game_room.php

endpoint: create
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are already in a game room. Leave current room first.", "success": false}
{"error":"You cannot create a game room while in a matchmaking lobby.", "success": false}
{"error":"Failed to create room", "success": false}
{"error":"You are banned", "success": false}
endpoint: list
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Failed to list rooms", "success": false}
endpoint: join
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are already in another room", "success": false}
{"error":"Room not found", "success": false}
{"error":"Room inactive", "success": false}
{"error":"Room is full", "success": false}
{"error":"Incorrect password", "success": false}
{"error":"You are banned", "success": false}
endpoint: players
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in any room", "success": false}
{"error":"You are banned", "success": false}
endpoint: leave
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in any room", "success": false}
{"error":"You are not in this room", "success": false}
{"error":"Room not found", "success": false}
{"error":"Players are not allowed to leave this room", "success": false}
{"error":"You are banned", "success": false}
endpoint: heartbeat
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Player is not in any room", "success": false}
{"error":"Failed to update heartbeat", "success": false}
{"error":"You are banned", "success": false}
endpoint: actions
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing action_type", "success": false}
{"error":"request_data_json must be a string", "success": false}
{"error":"Player is not in any room", "success": false}
{"error":"You are banned", "success": false}
endpoint: actions/poll
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Player is not in any room", "success": false}
{"error":"You are banned", "success": false}
endpoint: actions/pending
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in any room", "success": false}
{"error":"You are banned", "success": false}
endpoint: actions/complete
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Status is required", "success": false}
{"error":"response_data_json must be a string", "success": false}
{"error":"response_data is not valid JSON", "success": false}
{"error":"Action not found or already processed", "success": false}
{"error":"You are banned", "success": false}
endpoint: updates
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Player is not in any room", "success": false}
{"error":"Missing required field: target_players", "success": false}
{"error":"Missing required field: type", "success": false}
{"error":"Missing required field: target_players_ids", "success": false}
{"error":"Invalid target players ids", "success": false}
{"error":"No valid target players found", "success": false}
{"error":"Invalid target players", "success": false}
{"error":"Failed to send updates", "success": false}
{"error":"You are banned", "success": false}
endpoint: updates/poll
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Player is not in any room", "success": false}
{"error":"No valid source players found", "success": false}
{"error":"Invalid from players", "success": false}
{"error":"You are banned", "success": false}
endpoint: current
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are banned", "success": false}
endpoint: stop
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in any game room", "success": false}
{"error":"Only host can stop game room", "success": false}
{"error":"Failed to stop game room", "success": false}
{"error":"You are banned", "success": false}
endpoint: default
{"error":"Invalid endpoint", "success": false}
{"error":"Internal server error", "success": false}

leaderboard.php

endpoint: default
{"error":"Method not allowed. Use POST.", "success": false}
{"error":"api_token is required", "success": false}
{"error":"Invalid or expired api_token", "success": false}
{"error":"Invalid JSON body", "success": false}
{"error":"sort_by must be a non-empty array of field names", "success": false}
{"error":"limit must be between 1 and 100", "success": false}
{"error":"No valid sort fields provided after sanitization", "success": false}
{"error":"Database error", "success": false}
{"error":"Server error", "success": false}

matchmaking.php

endpoint: list
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"You are banned", "success": false}
endpoint: create
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are already in a matchmaking lobby", "success": false}
{"error":"You cannot create matchmaking while in a game room. Leave room first.", "success": false}
{"error":"Missing required field: max_players", "success": false}
{"error":"Failed to create matchmaking lobby", "success": false}
{"error":"You are banned", "success": false}
endpoint: request
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required parameter: matchmakingId", "success": false}
{"error":"You are already in a matchmaking lobby", "success": false}
{"error":"You already have a pending request to this matchmaking lobby", "success": false}
{"error":"Matchmaking lobby not found or already started", "success": false}
{"error":"Matchmaking lobby is full", "success": false}
{"error":"You are banned", "success": false}
endpoint: join
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required parameter: matchmakingId", "success": false}
{"error":"You are already in a matchmaking lobby", "success": false}
{"error":"Matchmaking lobby not found or already started", "success": false}
{"error":"This matchmaking lobby requires host approval. Use /request endpoint instead.", "success": false}
{"error":"Matchmaking lobby is full", "success": false}
{"error":"You are banned", "success": false}
endpoint: leave
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in any matchmaking lobby", "success": false}
{"error":"Players are not allowed to leave this matchmaking lobby", "success": false}
{"error":"You are banned", "success": false}
endpoint: players
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in any matchmaking lobby", "success": false}
{"error":"Failed to get players", "success": false}
{"error":"You are banned", "success": false}
endpoint: heartbeat
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in any matchmaking lobby", "success": false}
{"error":"Failed to update heartbeat", "success": false}
{"error":"You are banned", "success": false}
endpoint: remove
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in a matchmaking lobby", "success": false}
{"error":"Only host can remove matchmaking lobby", "success": false}
{"error":"Failed to remove matchmaking lobby", "success": false}
{"error":"You are banned", "success": false}
endpoint: current
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Failed to get matchmaking status", "success": false}
{"error":"You are banned", "success": false}
endpoint: status
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required parameter: requestId", "success": false}
{"error":"Request not found or you are not the requester", "success": false}
{"error":"You are banned", "success": false}
endpoint: response
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required fields: requestId and action", "success": false}
{"error":"Action must be \"approve\" or \"reject\"", "success": false}
{"error":"Request not found or already processed", "success": false}
{"error":"Only the host can respond to join requests", "success": false}
{"error":"Matchmaking lobby not found or already started", "success": false}
{"error":"Matchmaking lobby is full", "success": false}
{"error":"You are banned", "success": false}
endpoint: start
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in a matchmaking lobby", "success": false}
{"error":"Only host can start matchmaking", "success": false}
{"error":"Matchmaking lobby not found or already started", "success": false}
{"error":"Lobby must be full to start (strict_full enabled)", "success": false}
{"error":"You are banned", "success": false}
endpoint: stop
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are not in a matchmaking lobby", "success": false}
{"error":"Only host can stop matchmaking lobby", "success": false}
{"error":"Cannot stop matchmaking lobby after it has been started", "success": false}
{"error":"Failed to stop matchmaking lobby", "success": false}
{"error":"You are banned", "success": false}
endpoint: default
{"error":"Invalid endpoint", "success": false}
{"error":"Internal server error", "success": false}

friends.php

endpoint: list
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Player is offline — log in again", "success": false}
{"error":"Friends service unavailable — schema not ready", "success": false}
{"error":"You are banned", "success": false}
endpoint: lookup
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Player is offline — log in again", "success": false}
{"error":"Invalid player tag — expected # plus 8 characters", "success": false}
{"error":"No player with that tag", "success": false}
{"error":"You are banned", "success": false}
endpoint: request
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Player is offline — log in again", "success": false}
{"error":"Invalid player tag — expected # plus 8 characters", "success": false}
{"error":"No player with that tag", "success": false}
{"error":"Missing required field: player_id", "success": false}
{"error":"Player not found", "success": false}
{"error":"You cannot add yourself", "success": false}
{"error":"Already friends", "success": false}
{"error":"Friend request already sent", "success": false}
{"error":"Friends list is full", "success": false}
{"error":"Too many pending requests — wait for answers first", "success": false}
{"error":"You are banned", "success": false}
endpoint: accept
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required field: player_id", "success": false}
{"error":"No pending request from that player", "success": false}
{"error":"Friends list is full", "success": false}
{"error":"You are banned", "success": false}
endpoint: decline
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required field: player_id", "success": false}
{"error":"No pending request from that player", "success": false}
{"error":"You are banned", "success": false}
endpoint: remove
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required field: player_id", "success": false}
{"error":"Not in your friends list", "success": false}
{"error":"You are banned", "success": false}
endpoint: steam
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required field: steam_ids (array)", "success": false}
{"error":"Too many steam_ids — max 100", "success": false}
{"error":"You are banned", "success": false}
endpoint: invite
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required field: player_id", "success": false}
{"error":"Player not found", "success": false}
{"error":"You cannot invite yourself", "success": false}
{"error":"You can only invite friends", "success": false}
{"error":"You are not in a lobby or room", "success": false}
{"error":"The lobby is full", "success": false}
{"error":"The room is full", "success": false}
{"error":"You are banned", "success": false}
endpoint: invites
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"You are banned", "success": false}
endpoint: invites/accept
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required field: invite_id", "success": false}
{"error":"Invite not found or already answered", "success": false}
{"error":"Leave your current lobby first", "success": false}
{"error":"Leave your current room first", "success": false}
{"error":"Lobby no longer exists or already started", "success": false}
{"error":"Room no longer exists", "success": false}
{"error":"The lobby is full", "success": false}
{"error":"The room is full", "success": false}
{"error":"You are banned", "success": false}
endpoint: invites/decline
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Missing required field: invite_id", "success": false}
{"error":"Invite not found or already answered", "success": false}
{"error":"You are banned", "success": false}
endpoint: default
{"error":"Invalid endpoint", "success": false}
{"error":"Internal server error", "success": false}

realtime.php

endpoint: token
{"error":"API token is required", "success": false}
{"error":"Invalid API token", "success": false}
{"error":"Invalid player token", "success": false}
{"error":"Player token is required", "success": false}
{"error":"Player is not in a realtime-enabled room", "success": false}
{"error":"Failed to generate realtime token", "success": false}
{"error":"You are banned", "success": false}
endpoint: default
{"error":"Invalid endpoint", "success": false}
{"error":"Internal server error", "success": false}

time.php

endpoint: default
{"error":"Method not allowed", "success": false}
{"error":"API key is required", "success": false}
{"error":"Invalid API key", "success": false}
{"error":"Internal server error", "success": false}

censor.php

endpoint: default
{"error":"Method not allowed. Use POST.", "success": false}
{"error":"api_token is required", "success": false}
{"error":"Invalid or expired api_token", "success": false}
{"error":"Invalid JSON body", "success": false}
{"error":"text is required and must be a string", "success": false}
{"error":"text must be at most 1000 characters", "success": false}
{"error":"Too many requests", "success": false, "retry_after": 12}
{"error":"Database error", "success": false}
{"error":"Server error", "success": false}

Region pinning — all api/ endpoints

Returned with HTTP 421 when a game's api_key is presented on a node the game is not pinned to. Re-resolve the node via POST /api/discover.php with the key in the X-Api-Token header and repoint the client at home_api_url.

HTTP 421 Misdirected Request
{"success":false,"error":"This game is hosted on a different region","home_region":"uk","home_api_url":"https://uk-api.michitai.com/api"}