What does HTTP status code 404 mean?
The 404 Not Found status code indicates that the server cannot map the requested URI to a valid route, or the specific resource record requested does not exist.
When to use it in APIs
Use 404 for invalid endpoint URLs or when a model query fails (e.g., GET /leads/123 where lead 123 does not exist).
How it compares to other codes
- 405 Method Not Allowed: Use 405 if the URL is valid but the HTTP method (like POST instead of GET) is not supported.