This section outlines the error response format used in our API. When an error occurs, the API will return a structured JSON response to provide detailed information about the problem.
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.Code | Message | Description |
---|---|---|
INVALID_REQUEST | The request data is invalid. | The request was malformed or had invalid parameters. |
NOT_FOUND | The resource was not found. | The requested resource could not be found. |
CONFLICT | Conflict with existing data. | A conflict occurred with existing data (e.g., duplicate resource). |
UNAUTHORIZED | You are not authorized to access this resource. | The client lacks proper authentication. |
FORBIDDEN | You do not have permission. | The client does not have permission to perform the operation. |
INTERNAL_ERROR | An internal error occurred. | A server-side error occurred during request processing. |
BAD_GATEWAY | The 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_TIMEOUT | The server did not receive a timely response from the upstream server. | A timeout occurred when contacting upstream services. |
SERVICE_UNAVAILABLE | The service is temporarily unavailable. | The service is currently unavailable, possibly due to maintenance. |