How to Troubleshoot API Errors
You’re integrating with HARi’s API and receiving error responses.
Common error codes
Section titled “Common error codes”| Code | Meaning | Typical cause |
|---|---|---|
| 401 | Unauthorized | Missing or expired access token |
| 403 | Forbidden | Token is valid but lacks permission for this action |
| 404 | Not Found | Invalid endpoint URL or record does not exist |
| 422 | Validation Error | Request body has invalid or missing required fields |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Unexpected server-side issue |
Step-by-step fix
Section titled “Step-by-step fix”401 Unauthorized
Section titled “401 Unauthorized”- Verify your access token is included in the
Authorization: Bearer <token>header. - Check if the token has expired. Access tokens have a limited lifetime — use the refresh token endpoint to get a new one.
- Ensure the token was generated for the correct environment (development vs. production).
403 Forbidden
Section titled “403 Forbidden”- The token is valid but the associated user profile doesn’t have permission for this entity or action.
- Ask your administrator to check the API user’s profile permissions.
404 Not Found
Section titled “404 Not Found”- Double-check the endpoint URL. Common mistakes: missing
/api/prefix, wrong entity name, typo in the record ID. - If requesting a specific record, verify the record exists and hasn’t been deleted.
422 Validation Error
Section titled “422 Validation Error”- Read the response body — it contains specific field-level error messages.
- Ensure all required fields are included in your request body.
- Verify data types: dates must be YYYY-MM-DD, numbers must not be strings, lookup fields must reference valid IDs.
429 Rate Limited
Section titled “429 Rate Limited”- Reduce the frequency of your API calls.
- Implement exponential backoff in your integration code.
- For bulk operations, use the batch endpoints instead of individual calls.
Still stuck?
Section titled “Still stuck?”Include the full error response body and the request you sent (with sensitive data redacted) when contacting support. The response body contains detailed error information that helps pinpoint the issue.