Skip to main content

Error Handling

When an API request fails, Blueink returns a structured JSON response to help you identify and resolve the issue.

Error Response Format

All error responses (400, 401, 403, 404, 409, 429, 500) follow a consistent format:

{
"errorMessage": "A human-readable description of the error",
"errorCode": "E_CODE_NAME",
"fieldErrors": {
"field_name": ["List of errors for this specific field"]
}
}
  • errorMessage: A clear explanation of what went wrong.
  • errorCode: A machine-readable string identifying the error type.
  • fieldErrors: (Optional) For 400 Bad Request errors, this object contains validation errors for specific input fields.

Common Error Codes

Error CodeDescription
INVALID_DATAOne or more fields in the request body failed validation.
MISSING_REQUIREDA required field was not provided.
NOT_FOUNDThe specified resource ID does not exist.
PERMISSION_DENIEDYour API key does not have access to this resource.
LIMIT_EXCEEDEDYou have reached your account's usage or rate limits.
CONFLICTThe request could not be completed due to a conflict with the current state of the resource.

Best Practices

  • Always check the errorCode for automated error handling.
  • Log the errorMessage and fieldErrors for debugging purposes.
  • Implement retry logic with exponential backoff for 503 or 429 errors.