404 Not Found
The HTTP status meaning there is no resource at the requested address.
In more detail
Some services also use 404 to hide the existence of something the caller may not see, but that should be a deliberate, documented choice. Answer it with a problem details body rather than a 200 with an empty object, so clients and caches cannot mistake it for a real result.
Examples
In the APIs course: The course service answers a missing task with 404 and a problem details body, never 200 with an empty object.The course answers not found, rather than forbidden, for an object the caller may not have, so an attacker cannot map which records exist.Related terms
- HTTP status code — The three-digit number at the start of a response, such as 200 or 404, that says how the server handled the request.
- Problem Details — A standard JSON shape for HTTP error responses, defined in RFC 9457, with members such as type, title, status, detail and instance.
- 200 OK — The HTTP status meaning the request worked and the body holds the answer.
- not-found.tsx — A special file that renders a custom "not found" screen when a route does not exist or notFound() is called.
- 403 Forbidden — The HTTP status meaning the server knows who the caller is but that identity is not allowed to do this.
- ownership check — Confirming that the object a caller asked for actually belongs to that caller before returning or changing it.
Taught in
- What An API Is, And The Alternatives — Modern API Architecture: REST, GraphQL & gRPC
- HTTP Methods And Status Codes — Modern API Architecture: REST, GraphQL & gRPC
- Problem Details: RFC 9457 — Modern API Architecture: REST, GraphQL & gRPC
- Contract Testing — Modern API Architecture: REST, GraphQL & gRPC
- The Dependency Injection Container: Scopes and Lifetimes — Modern .NET Core, C# & Enterprise Microservices
- Building Routes with Controllers — Modern .NET Core, C# & Enterprise Microservices
- Building Routes with Minimal APIs — Modern .NET Core, C# & Enterprise Microservices
- Unit Testing with xUnit and NSubstitute — Modern .NET Core, C# & Enterprise Microservices
- Integration Testing with WebApplicationFactory — Modern .NET Core, C# & Enterprise Microservices
- Behavior-Driven Development with Reqnroll — Modern .NET Core, C# & Enterprise Microservices
- Handling Nulls With Optional — Modern Java: Virtual Threads & High-Throughput Services
- Exception Handling To Problem Details — Modern Java: Virtual Threads & High-Throughput Services
- Dynamic Routes: Slugs & generateStaticParams — Next.js 15 & Modern App Router Architecture
- Not Found Handling: not-found.tsx & Programmatic Exits — Next.js 15 & Modern App Router Architecture
- Authentication Versus Authorisation — Application Security & Threat Modeling for Engineers
- Broken Object Level Authorization — Application Security & Threat Modeling for Engineers