Start free · Free tools · Fair usage limits
Browse Tools

Categories

Custom AI Solutions – AI2Flows
LIVE NEWS
Loading latest AI & SEO news…
Home›Tools›HTTP Status Codes Reference›HTTP 428 Precondition Required
4xx Client Error

HTTP 428 Precondition Required

HTTP 428 Precondition Required means the server requires the request to be conditional, typically by including an If-Match header with the resource’s ETag.

Quick answer

HTTP 428 Precondition Required means the server requires the request to be conditional, typically by including an If-Match header with the resource’s ETag. APIs use it to force clients to prove they are editing the latest version and avoid lost updates.

Last updated · Maintained by FreeAIToolz · How we test

What does HTTP 428 Precondition Required mean?

Where 412 says “your precondition failed”, 428 says “you must send one”. It pushes clients towards the read-then-update-with-ETag pattern.

Status code428
NamePrecondition Required
Class4xx Client Error
Defined inRFC 6585
Cacheable by defaultNo, unless Cache-Control says so
Safe to retry automatically?No: change the request first
Related headersIf-Match, ETag

What causes HTTP 428?

  • An update request without If-Match or If-Unmodified-Since on an API that requires it.

How do I fix HTTP 428?

  1. Fetch the resource, read its ETag, and send it back in If-Match.

What should a client do after HTTP 428?

Add the precondition header and retry.

Does HTTP 428 affect SEO?

No SEO impact.

Example 428 response

HTTP/1.1 428 Precondition Required
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json

{"error":{"status":428,"message":"Precondition Required"}}

How to return 428 Precondition Required in code

Express (Node.js)

res.status(428).json({ error: 'Precondition Required' });

Next.js route handler

return Response.json({ error: 'Precondition Required' }, { status: 428 });

FastAPI (Python)

raise HTTPException(status_code=428, detail="Precondition Required")

PHP

http_response_code(428);

Nginx

location = /example {
    return 428;
}

Other 4xx status codes

The request contains an error or cannot be fulfilled as sent. Fix the request before retrying.

Frequently asked questions

428 vs 412?
428: no precondition was sent but one is required. 412: a precondition was sent and was false.
Which APIs use 428?
APIs that protect against concurrent edits, often for configuration or document resources.
Is 428 a client or server error?
428 is in the 4xx class, so it is classed as a client error: the request needs to change before it can succeed.