API Response Codes

MKNet uses standard HTTP response codes to indicate successful or unsuccessful requests - you can find a brief overview of those here: Http Content Codes.

More response codes will be added to this list over time - if you receive a response that isn't listed here, please contact the backend team for more information.

Successful Responses#

Any response code starting with 2xx indicates a successful response.

200 - OK #

200 is the most common successful response - this indicates that the request was completed successfully by the API.

201 - Created #

A 201 response code indicates that a new resource was created by the API as a result of the request.

Error Responses#

There are two different kinds of error responses. Any response starting with 4xx indicates a problem with the request that was sent. Any response starting with 5xx indicates that something went wrong in the API.

400 - Bad Request #

The response code 400 indicates that the request sent to the API couldn't be understood. This may be because one of the required arguments is missing - e.g. trying to Sign In with an empty username or password.

401 - Unauthorized #

A 401 response indicates that the call made to the API requires authorization, meaning you need to be logged in as an MKNet user to make this call.

403 - Forbidden #

A response of 403 means that the API refuses to fulfil the request. An example of a request which would return a 403 error is trying to create a new account with a username that already exists.

429 - Too Many Requests (Rate Limiting) #

MKNet now uses Rate Limiting to prevent a single client from sending too many requests at once. If a request returns the error code 429, it means that client has hit the limit of requests specified in MKNet's configuration. Contact the back end team if you need more information on specific limits.

Endpoints are limited based on the MKNet Client ID sending the request - a request that isn't authenticated is not rate limited.

If you get this error, the response will contain a "Retry-After" header - this tells you how many seconds remain until the limit is refreshed and you can send another request to this endpoint.

As a guideline, the default rate limiting settings are as follows:

  • A maximum of 10 requests per second (per user) to each Leaderboard endpoint
  • A maximum of 15 requests per second (per user) to any other endpoint
500 - Internal Server Error #

500 is a generic error indicating that something went wrong in the API while trying to process the request. There are a lot of different scenarios that can lead to this response - if you haven't changed anything and start receiving these errors, contact the backend team.