Errors
General Errors
Errors are returned as either 401 Bad Request or 500 Internal Server Error. In the case of 401, the API will return an error object.
Error Object
Attribute | Type | Remarks |
---|---|---|
code | string | Error code. |
message | string | Translated error message. |
Example
{
"errors": [
{
"code": "unknown_exception",
"message": "An unknown exception occurred."
}
]
}
Validation Errors
Validation error objects are returned as 422 Unprocessable Entity.
Validation Error Object
Attribute | Type | Description |
---|---|---|
field | string | The name of the field that has an error. |
code | string | The validation error code describing which validation failed. |
message | string | Translated error message. |
Example
{
"errors": [
{
"field": "username",
"code": "already_taken",
"message": "Username has already been taken"
}
]
}
Updated about 2 years ago