Documentation / API / Errors
On this page
HTTP Status Codes Error Envelope Validation Errors No Stack Traces

API — Errors Premium

Status codes the API returns and the shape every error response follows.

HTTP Status Codes

CodeMeaningWhen it happens
200OKSuccessful GET request.
401UnauthorizedMissing, malformed, or invalid Authorization header. Token not found in the database.
403ForbiddenToken is valid but the server's Mokito Premium subscription is expired or inactive.
404Not FoundThe requested resource was not found in this server.
415Unsupported Media TypeRequest body has a Content-Type other than application/json.
422Unprocessable EntityValidation failed (e.g. mutually exclusive parameters both provided, or a required parameter missing).
429Too Many RequestsRate limit exceeded. The token is temporarily banned (15–30 minutes).
500Internal Server ErrorUnexpected server error. Retry with exponential backoff.

Error Envelope

All error responses use a consistent JSON envelope with a top-level message field:

{
  "message": "A human-readable description of the error."
}

Validation Errors

Validation errors (422) include an errors object with field-specific messages:

{
  "message": "The given data was invalid.",
  "errors": {
    "discord_id": [
      "Provide either discord_id or steam_id, not both."
    ]
  }
}

No Stack Traces

No stack traces. The API never exposes internal stack traces, SQL queries, or file paths in error responses. A 500 error returns only a generic message; the detailed error is logged server-side.