API Gateway has high 4xx error percentage
Why do I see this?
One of your API endpoints has a high 4xx error rate.
What does this mean?
API gateway uses the HTTP response codes to convey errors. 4xx errors are client-side errors that are indicated by the 4xx HTTP response code. These codes range from 400 to 499 and can mean many things including:
- Incorrect API usage, indicated by 400 Error: Bad Request
- Unauthorized access, indicated by 403 and 401 Error: Access Denied
- Incorrect URL, indicated by 404 Error: Not Found
This event warns you when one of your API endpoints has shown to have a high 4xx error percentage in the last 30 minutes.
How do I fix "API Gateway has high 4XX error percentage"?
The first thing you can do is make sure you have turned on Detailed CloudWatch Metrics. That will make sure that data such as the total count of client-side errors can be captured. Further, verify the information included in the requests to your API and review the IAM roles and policies associated with your API gateway. This will help troubleshoot the errors related to unauthorized access. Some errors can be caused due to wrong API gateway configuration as well. So, you can make sure you follow and adhere to AWS' developer guide to working with API gateways.
You can also check out the developer guide to troubleshooting issues with APIs