API for Product Managers
API Error Handling for Product Managers
In this lesson
You'll learn why API calls fail, what the common error codes mean, and how to plan good error handling into your features.
Why API calls fail
API calls can fail because of wrong input, an expired login, a missing record, too many requests or a problem on the server. Good error handling decides what your users see and how your product recovers.
Common error codes
Status code | Meaning | Typical cause |
|---|---|---|
400 Bad Request | The request is invalid | Missing or wrong input |
401 Unauthorized | Not authenticated | Missing or expired login or API key |
403 Forbidden | Not allowed | The user lacks permission |
404 Not Found | The resource doesn't exist | Wrong ID or deleted data |
429 Too Many Requests | Rate limit reached | Too many calls in a short time |
500 Internal Server Error | The server failed | A bug or outage on the server |
503 Service Unavailable | Temporarily unavailable | Downtime or overload |
Good error handling practices
Show clear, helpful messages instead of technical codes.
Retry automatically for temporary errors, such as timeouts or 503s.
Use fallbacks, such as cached data, when a service is down.
Log errors and set up alerts so your team can respond quickly.
Example
A payment API times out during checkout. Poor handling shows a raw error code and leaves the user unsure whether they were charged. Good handling explains what happened in plain language, checks the payment status before allowing a retry, and makes it easy to try again.
Why this matters for you as a PM
Error states are part of the user experience, not just an engineering detail.
Planning for failures early protects conversion and user trust.
Common mistakes to avoid
Designing only the happy path and leaving error states for later.
Showing technical error codes to users.
Launching without alerts to track error rates.