API Errors
API Errors
When FusionAuth encounters an error or finds validation errors in your request, an Errors object is returned in the response body. The Errors object is defined as follows, where fieldName indicates the field in the request body the message is describing and [x] indicates the value is part of an array of one or more values.
Error Fields
generalErrorsArrayThe list of general error messages.
generalErrors[x].codeStringThe code of the error message.
generalErrors[x].messageStringA descriptive error message that details the problem that occurred.
fieldErrorsObjectThe list of field error message.
fieldErrors[fieldName]ArrayThe list of error messages for that field
fieldErrors[fieldName][x].codeStringThe code of the error message.
fieldErrors[fieldName][x].messageStringA descriptive error message that details the problem that occurred.
Example Errors JSON Object
{
  "generalErrors": [
    {
      "code": "[invalid]",
      "message": "Your JSON was invalid"
    }
  ],
  "fieldErrors": {
    "user.username": [
      {
        "code": "[duplicate]user.username",
        "message": "A User with username = [neo] already exists."
      }
    ]
  }
}