HTTP 413 — Payload Too Large

The request is larger than the server is willing or able to process

When to use it

Use status 413 when this is the correct HTTP response semantic: The request is larger than the server is willing or able to process

Request and response example

GET /protected-resource HTTP/1.1
Host: api.example.com

HTTP/1.1 413 Payload Too Large
Content-Type: application/json

{"error":"Request cannot be completed"}

Related status codes

400, 401, 402, 403

References

MDN · RFC 9110