Responses and Errors

The MikroCloud API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.), and codes in the 5xx range indicate an error with MikroCloud's servers.

Status codes

Here is a list of the different categories of status codes returned by the MikroCloud API.

  • Name
    200
    Description

    Standard response for successful HTTP requests.

  • Name
    201
    Description

    Used for successful POST requests, when a new object was created.

  • Name
    204
    Description

    Unless otherwise specified, a successful request that did not return any content. It is used for all successful DELETE requests.

  • Name
    404
    Description

    The route you requested does not exist.

  • Name
    410
    Description

    The object or resource you requested does not exist.

  • Name
    422
    Description

    Your request payload failed to pass validation.

  • Name
    5xx
    Description

    Indicates a server error - let us know if you see one of these.


Error types

Whenever a request is unsuccessful, the MikroCloud API will return an error response with an error type and message. You can use this information to understand better what has gone wrong and how to fix it. Most of the error messages are pretty helpful and actionable.

  • Name
    message
    Type
    string
    Description

    This will be a human-readable message that explains the error.

  • Name
    errors
    Type
    array|object
    Required
    Optional
    Description

    When present, this will provide more context about the error.

Example validation error response - 422

{
    "message": "The type field is required. (and 1 more error)",
    "errors": {
        "type": [
            "The type field is required."
        ],
        "value": [
            "The value field is required."
        ]
    }
}

Was this page helpful?