HTTP 404 Not Found

There is no resource at this URL. The server will not say whether there ever was one.

Defined in RFC 9110 §15.5.5 — 404 Not Found · MDN reference

Where you meet HTTP 404 in production

Deleted records, mistyped ids, a page past the end of a collection, a route that no longer exists after a refactor.

Why you would test it

Test both halves: an id that never existed, and one that was deleted. Also check that a filter matching nothing returns an empty 200 rather than a 404.

What your client should do about a 404

Do not retry. Distinguish "this id does not exist" from "this endpoint does not exist" — they are the same status and completely different bugs. If your client cannot tell them apart, an API rename will look like missing data for as long as it takes someone to open the network tab.

404 versus the codes it gets confused with

Endpoints that return 404

169 endpoints in this playground answer with 404. Every one is free, needs no signup, and can be called from the browser or with curl.

…and 144 more endpoints across the catalog.

Questions about HTTP 404

Should an empty list be a 404?
No. A collection with no matching items is a 200 with an empty array — the collection exists.
Is it acceptable to return 404 instead of 403?
Yes, as a deliberate choice to avoid confirming that a resource exists to someone not allowed to know.

Other client error codes

All HTTP status codes · All 39 mock REST APIs · Getting started guide

Last updated