Error codes
Explore API error codes and solutions.
This section describes the possible HTTP response status codes returned from API and how to interpret them.
Status Code |
Meaning |
Details & Resolution |
---|---|---|
200 OK |
Success |
The request was successfully processed, and the response contains the generated output based on the input request. |
400 Bad Request |
Invalid Request |
The request is malformed. This could be due to validation errors, missing required parameters, or incorrect data formats. Check the response details for specific validation failures. |
401 Unauthorized |
Authentication Required |
The request lacks valid authentication credentials. Ensure that the API key is included and correct. |
422 Unprocessable Entity |
Retry Recommended |
The request could not be processed at this time, but the client should retry. It indicates that the request is expected to succeed under different conditions, such as after a short delay. |
500 Internal Server Error |
Unexpected Server Issue |
An unknown error occurred on the server. If this persists, contact support at api@pearl.com. |
Error details
When an error occurs (e.g., 400 Bad Request
or 500 Internal Server Error
), the API returns a standardized ProblemDetailsResponse
object:
{
"error": {
"message": "Invalid JSON format. See https://www.pearl.com/api/reference for request format.",
"code": "invalid_json",
"type": null,
"param": null
}
}
Handling 422 Unprocessable Entity
Unlike typical errors, a 422 response is expected behavior. It indicates that the request was valid, but the expert’s response is not yet ready. Clients should implement retry logic when encountering this status to poll for the final response.
However, if you have registered a webhook to receive a callback when the expert’s response is ready, you do not need to implement a retry mechanism. In this case, your system will be automatically notified once the expert’s response is available.