Response format and status codes common to all endpoints
Unless a page says otherwise, every response body is a JSON object with two fields:
{
"message": "Success",
"data": { }
}message - describes the result of the operationdata - the requested or resulting object, or null when there is nothing to return200 OKmessage: describes the operation, for example Success or Successfully added the user.data: the object in its new state, an array, or null400 Bad Requestmessage: the error, for example Could not parse payload: ... for malformed JSONdata: null401 UnauthorizedMissing token or Invalid tokenmessage describing the issue, for example Insufficient permission or Failed to log in, and data: null404 Not Foundmessage: describes what was not founddata: null409 Conflictmessage: describes the conflicting value, for example The username already exists: admindata: nullStatus code: 422 Unprocessable Entity
message: Validation errors: <key> - <constraint description>, one entry per failed field
data: object with an errors array:
{
"message": "Validation errors: username - Usernames should be in lowercase, can only start with letters followed by numbers or underscore. Should be between 1 and 32 characters.",
"data": {
"errors": [
{
"path": "/",
"key": "username",
"message": "Usernames should be in lowercase, can only start with letters followed by numbers or underscore. Should be between 1 and 32 characters.",
"constraint": "username_constraint"
}
]
}
}path - JSON pointer to the object that holds the failed fieldkey - the failed fieldmessage - description of the constraintconstraint - name of the constraint500 Internal Server Errormessage: the error messagedata: null