Errors

Anchor uses HTTP response Codes to indicate whether a request has been successfully processed or failed. We use HTTP codes to group errors.

2xx status codes confirm your request worked as expected (no errors)

4xx status codes indicate that the request failed due to the information in the request or situational reasons (e.g. an insufficient balance or a validation error on the request).

5xx status codes are extremely rare and indicate an error means we encountered an error in our software, which we will work to fix immediately.

{
  "errors": [
    {
      "title": "Not found",
      "status": "404",
      "detail": "Deposit Account was not found"
    }
  ]
}

There are five fields that are returned in the error response body

  • title: is the overarching category of the error. In the above example, Not Found is the type for request validation error - this happens if the resource you're looking for does not exist.

  • status: is the specific error. It is a short string that you can handle programmatically if you choose.

  • detail: is a human readable error message meant to be read by a developer, not an end consumer. details will change and should not be used programatically. If you want consumer-friendly error messaging, we recommend you map off of status.