ErrorResponse Structure

The ErrorResponse is a JSON object that contains the following fields:
  • code: A string representing the error code. This field helps to identify the type of error.
  • message: A string that provides a human-readable description of the error.
  • details (optional): An optional field that provides additional context or information about the error, often with specific details related to the failed request.

Error Response

Invalid Request (400)

A request is invalid, often due to missing or incorrect parameters.
{
  "code": "INVALID_REQUEST",
  "message": "The request data is invalid.",
  "details": {
    "field": "email",
    "error": "Invalid email format"
  }
}

Not Found (404)

The requested resource could not be found.
{
  "code": "NOT_FOUND",
  "message": "The requested user was not found.",
  "details": null
}

Conflict (409)

There was a conflict when attempting to create or update a resource.
{
  "code": "CONFLICT",
  "message": "Email address already in use.",
  "details": {
    "field": "email",
    "error": "This email address is already associated with an existing user."
  }
}

Internal Server Error (500)

An unexpected error occurred on the server while processing the request.
{
  "code": "INTERNAL_ERROR",
  "message": "An internal server error occurred.",
  "details": null
}

Common Error Codes

Below is a list of common error codes you may encounter in the API responses:
CodeMessageDescription
INVALID_REQUESTThe request data is invalid.The request was malformed or had invalid parameters.
NOT_FOUNDThe resource was not found.The requested resource could not be found.
CONFLICTConflict with existing data.A conflict occurred with existing data (e.g., duplicate resource).
UNAUTHORIZEDYou are not authorized to access this resource.The client lacks proper authentication.
FORBIDDENYou do not have permission.The client does not have permission to perform the operation.
INTERNAL_ERRORAn internal error occurred.A server-side error occurred during request processing.
BAD_GATEWAYThe server is acting as a gateway or proxy and received an invalid response from the upstream server.The server could not communicate with upstream services.
GATEWAY_TIMEOUTThe server did not receive a timely response from the upstream server.A timeout occurred when contacting upstream services.
SERVICE_UNAVAILABLEThe service is temporarily unavailable.The service is currently unavailable, possibly due to maintenance.