API Reference

Errors

This page shows how is the errors format in Matic REST API

Matic REST API uses conventional HTTP status code to indicate whether the request failed or not. 2xx status codes indicate a success and 4xx and 500 are returned when things went wrong.

You will find the format of the successful response in each endpoint definition at our Matic REST API section. Here you will find the format for the failed requests.

Format

The format used for all the data is JSON and so our errors. The JSON structure for 4xx and 500 is the following:

{
    "code": 400,
    "name": "Error name",
    "description": "Error description"
}
{
    "code": 422,
    "name": "Error name",
    "description": "Error description",
    "errors": {
        "json|query|_schema|view_args": {
          "field_name": [
            "First validation error",
            "Second validation error"
          ],
          "second_field_name": [
            "First validation error",
            "Second validation error"
          ]
        }
    }
}

Error code summary

Matic has a set of error codes with an specific meaning.

HTTP status codeDescription
400 - Bad requestThe request could not be processed due business validations.
401 - UnauthorizedThere was an error with the http credentials that you are using.
403 - ForbiddenYou are not allowed to access to the resource.
404 - Not foundWe could not find some ID referenced in your request.
405 - Method not allowedYou are using the HTTP method/verb incorrectly against the API endpoint URL.
500 - Internal server errorAn error happened at Matic API end's. When this happen, we will be automatically notified so we can cover the irregular scenario.