Returned when /products/<id> or /users/<id> does not match anything.
{
"status": 404,
"error": "Not Found",
"message": "Product with id 9999 was not found",
"code": "resource_not_found",
"resource": "product",
"id": 9999
}
Last updated 2026-05-20
Use this for "the resource does not exist" — either the id is wrong, or the path is unknown. Include the resource type and the id so the client can surface a useful message.
{
"status": 404,
"error": "Not Found",
"message": "Product with id 9999 was not found",
"code": "resource_not_found",
"resource": "product",
"id": 9999
}
const res = await fetch('https://jsonexamples.com/http/404/Resource+not+found');
if (!res.ok) {
const err = await res.json();
console.error(res.status, err.message);
}
curl -i https://jsonexamples.com/http/404/Resource+not+found
import requests
r = requests.get('https://jsonexamples.com/http/404/Resource+not+found')
if r.status_code >= 400:
print(r.status_code, r.json())
Click below to call /http/404/Resource+not+found from your browser.
// click the button to populate this block
{
"status": 404,
"error": "Not Found",
"message": "No route matches GET /unknown-path",
"code": "path_not_found"
}
Generated starting points for TypeScript, JSON Schema, and Zod. Refine before shipping to production.
export interface 404NotFound {
"status": number;
"error": string;
"message": string;
"code": string;
"resource": string;
"id": number;
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "404NotFound",
"type": "object",
"properties": {
"status": {
"type": "integer"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"code": {
"type": "string"
},
"resource": {
"type": "string"
},
"id": {
"type": "integer"
}
},
"required": [
"status",
"error",
"message",
"code",
"resource",
"id"
],
"additionalProperties": false
}
import { z } from 'zod';
export const 404NotFoundSchema = z.object({
status: z.number(),
error: z.string(),
message: z.string(),
code: z.string(),
resource: z.string(),
id: z.number()
});
export type 404NotFound = z.infer<typeof 404NotFoundSchema>;