Skip to main content

Error Handling

The API returns standard HTTP status codes and JSON error bodies.

Error Response Format

{
  "statusCode": 400,
  "message": ["email must be an email"],
  "error": "Bad Request"
}
FieldDescription
statusCodeHTTP status code
messageError message (string or array)
errorShort error label

Common Status Codes

CodeMeaning
200OK — request succeeded
201Created — resource created
400Bad Request — validation failed
401Unauthorized — missing or invalid token
403Forbidden — insufficient permissions
404Not Found — resource does not exist
429Too Many Requests — rate limit exceeded
500Internal Server Error — unexpected server failure

Validation Errors

The API uses class-validator with ValidationPipe. Invalid request bodies return a 400 with an array of messages describing each field error.
{
  "statusCode": 400,
  "message": [
    "name should not be empty",
    "email must be an email"
  ],
  "error": "Bad Request"
}