1xx
100 Continue
The request headers are accepted; the client may send its body. Let the HTTP server manage Expect: 100-continue; not an application JSON response.
// No NextResponse.json example: do not emit this code from a normal route handler.
Find the right response for your route handler. Search by code, meaning or API situation — free, no sign-up.
Loading the tool…
RFC reference with application guidance. Reserved codes are labeled; protocol-level responses belong to the HTTP server. Import { NextResponse } from next/server.
Reviewed 2026-10-09. Search in the tool above; all entries remain readable here and in Markdown.
| Code | Meaning | Next.js SaaS usage | Response example | Source |
|---|---|---|---|---|
| 100 Continue | The request headers are accepted; the client may send its body. | Let the HTTP server manage Expect: 100-continue; not an application JSON response. | // No NextResponse.json example: do not emit this code from a normal route handler. | Official source ↗ |
| 101 Switching Protocols | The server agrees to change protocols. | Handled by an upgrade-capable server, not a normal Next.js JSON route. | // No NextResponse.json example: do not emit this code from a normal route handler. | Official source ↗ |
| 200 OK | The request succeeded. | Return a fetched resource or successful action result. | return NextResponse.json({ data: 'example' }, { status: 200 }); | Official source ↗ |
| 201 Created | The request created one or more resources. | After inserting a record; provide Location for the new resource. | return NextResponse.json({ data: 'example' }, { status: 201, headers: { 'Location': '/api/items/123' } }); | Official source ↗ |
| 202 Accepted | Processing was accepted but has not completed. | Queue an asynchronous job and return a status URL. | return NextResponse.json({ data: 'example' }, { status: 202 }); | Official source ↗ |
| 203 Non-Authoritative Information | A transforming proxy modified the origin representation. | Use only when your service is acting as such a transforming proxy. | return NextResponse.json({ data: 'example' }, { status: 203 }); | Official source ↗ |
| 204 No Content | The request succeeded and has no response content. | A successful delete with no payload; JSON is forbidden. | return new NextResponse(null, { status: 204 }); // No JSON body | Official source ↗ |
| 205 Reset Content | The action succeeded; the client should reset its document view. | A UI reset signal with an empty body; never include JSON. | return new NextResponse(null, { status: 205 }); // No JSON body | Official source ↗ |
| 206 Partial Content | One or more requested byte ranges are returned. | For actual range responses; include Content-Range, not a JSON pagination marker. | return new NextResponse('abcd', { status: 206, headers: { 'Content-Range': 'bytes 0-3/10', 'Content-Type': 'text/plain' } }); | Official source ↗ |
| 300 Multiple Choices | Several representations are available. | Return a list of available representations for client selection. | return NextResponse.json({ data: 'example' }, { status: 300 }); | Official source ↗ |
| 301 Moved Permanently | The resource has a permanent new URI; clients may change POST to GET. | For a permanent redirect where changing method is acceptable; prefer 308 to preserve it. | return NextResponse.redirect(new URL('/api/v2/items', request.url), 301); | Official source ↗ |
| 302 Found | The resource temporarily resides elsewhere; clients may change POST to GET. | For a temporary redirect; use 307 when the original method must be preserved. | return NextResponse.redirect(new URL('/api/v2/items', request.url), 302); | Official source ↗ |
| 303 See Other | Retrieve a different resource using GET or HEAD. | After a POST, redirect to the resulting resource using GET. | return NextResponse.redirect(new URL('/api/v2/items', request.url), 303); | Official source ↗ |
| 304 Not Modified | A conditional GET or HEAD can reuse its cached representation. | After validating If-None-Match or If-Modified-Since; never include a body. | return new NextResponse(null, { status: 304 }); // No JSON body | Official source ↗ |
| 305 Use Proxy (deprecated) | An obsolete proxy redirection mechanism. | Do not emit in a modern application. | // No NextResponse.json example: do not emit this code from a normal route handler. | Official source ↗ |
| 306 Unused | This previously assigned code is reserved and no longer used. | Do not emit. | // No NextResponse.json example: do not emit this code from a normal route handler. | Official source ↗ |
| 307 Temporary Redirect | Temporary new URI with method and body preserved. | Temporarily move an endpoint while retaining POST semantics. | return NextResponse.redirect(new URL('/api/v2/items', request.url), 307); | Official source ↗ |
| 308 Permanent Redirect | Permanent new URI with method and body preserved. | Permanently move an endpoint while retaining its method. | return NextResponse.redirect(new URL('/api/v2/items', request.url), 308); | Official source ↗ |
| 400 Bad Request | The request cannot be processed because of a perceived client error. | Reject malformed JSON or invalid request syntax. | return NextResponse.json({ error: 'Request failed' }, { status: 400 }); | Official source ↗ |
| 401 Unauthorized | The request lacks valid authentication credentials. | Missing or invalid authentication; include a WWW-Authenticate challenge. | return NextResponse.json({ error: 'Request failed' }, { status: 401, headers: { 'WWW-Authenticate': 'Bearer' } }); | Official source ↗ |
| 402 Payment Required | Reserved for future use by HTTP. | Any SaaS payment convention is application-specific; document it explicitly. | return NextResponse.json({ error: 'Request failed' }, { status: 402 }); | Official source ↗ |
| 403 Forbidden | The server understands the request but refuses it. | A signed-in user lacks permission to access a workspace. | return NextResponse.json({ error: 'Request failed' }, { status: 403 }); | Official source ↗ |
| 404 Not Found | No current representation was found, or its existence is undisclosed. | A missing resource, including intentional concealment of a forbidden resource. | return NextResponse.json({ error: 'Request failed' }, { status: 404 }); | Official source ↗ |
| 405 Method Not Allowed | The method is known but unsupported for this resource. | Reject an unsupported method; include Allow. Next.js can generate this automatically. | return NextResponse.json({ error: 'Request failed' }, { status: 405, headers: { 'Allow': 'GET, POST' } }); | Official source ↗ |
| 406 Not Acceptable | No representation satisfies proactive content negotiation. | The client requests a format your endpoint cannot provide. | return NextResponse.json({ error: 'Request failed' }, { status: 406 }); | Official source ↗ |
| 407 Proxy Authentication Required | Authentication with an intermediary proxy is required. | Only for an authenticating proxy; include Proxy-Authenticate. | return NextResponse.json({ error: 'Request failed' }, { status: 407, headers: { 'Proxy-Authenticate': 'Basic realm="proxy"' } }); | Official source ↗ |
| 408 Request Timeout | The full request did not arrive within the waiting period. | Usually generated by the HTTP server; distinguish from an upstream 504. | return NextResponse.json({ error: 'Request failed' }, { status: 408 }); | Official source ↗ |
| 409 Conflict | The request conflicts with the resource’s current state. | A unique key conflict or an incompatible workflow transition. | return NextResponse.json({ error: 'Request failed' }, { status: 409 }); | Official source ↗ |
| 410 Gone | The resource is no longer available and this is likely permanent. | An intentionally retired API resource. | return NextResponse.json({ error: 'Request failed' }, { status: 410 }); | Official source ↗ |
| 411 Length Required | The request needs a defined Content-Length. | Only if your endpoint truly requires a length; usually server-managed. | return NextResponse.json({ error: 'Request failed' }, { status: 411 }); | Official source ↗ |
| 412 Precondition Failed | A request-header precondition evaluated false. | If-Match does not match the current resource version. | return NextResponse.json({ error: 'Request failed' }, { status: 412 }); | Official source ↗ |
| 413 Content Too Large | The request content exceeds the size the server will accept. | Reject an upload above your documented limit. | return NextResponse.json({ error: 'Request failed' }, { status: 413 }); | Official source ↗ |
| 414 URI Too Long | The target URI is longer than the server accepts. | An excessively long query string; usually generated before your handler. | return NextResponse.json({ error: 'Request failed' }, { status: 414 }); | Official source ↗ |
| 415 Unsupported Media Type | The request content format is unsupported. | A JSON-only endpoint receives a different Content-Type. | return NextResponse.json({ error: 'Request failed' }, { status: 415 }); | Official source ↗ |
| 416 Range Not Satisfiable | The requested ranges cannot be served. | A bytes range is outside the resource; return Content-Range with its length. | return NextResponse.json({ error: 'Request failed' }, { status: 416, headers: { 'Content-Range': 'bytes */10' } }); | Official source ↗ |
| 417 Expectation Failed | A request expectation cannot be met. | Cannot satisfy the Expect header; usually server-managed. | return NextResponse.json({ error: 'Request failed' }, { status: 417 }); | Official source ↗ |
| 418 Unused (reserved) | Reserved in RFC 9110 to prevent reassignment. | Not a production API error convention; the teapot joke is not defined here. | // No NextResponse.json example: do not emit this code from a normal route handler. | Official source ↗ |
| 421 Misdirected Request | The request arrived at a server unable to produce an authoritative response. | Routing or connection reuse to the wrong origin; usually infrastructure-managed. | return NextResponse.json({ error: 'Request failed' }, { status: 421 }); | Official source ↗ |
| 422 Unprocessable Content | The content type and syntax are understood but instructions cannot be processed. | A parsed JSON payload violates field or business validation. | return NextResponse.json({ error: 'Request failed' }, { status: 422 }); | Official source ↗ |
| 426 Upgrade Required | The server requires a different protocol. | Only for a real protocol upgrade; include Upgrade. | return NextResponse.json({ error: 'Request failed' }, { status: 426, headers: { 'Upgrade': 'TLS/1.3' } }); | Official source ↗ |
| 428 Precondition Required | The request must be conditional. | Require If-Match to avoid lost updates. | return NextResponse.json({ error: 'Request failed' }, { status: 428 }); | Official source ↗ |
| 429 Too Many Requests | The caller exceeded a rate limit. | Return a rate-limit error with Retry-After when appropriate. | return NextResponse.json({ error: 'Request failed' }, { status: 429, headers: { 'Retry-After': '60' } }); | Official source ↗ |
| 431 Request Header Fields Too Large | Request headers are too large. | Reject oversized headers; usually handled before the route. | return NextResponse.json({ error: 'Request failed' }, { status: 431 }); | Official source ↗ |
| 500 Internal Server Error | An unexpected condition prevented completion. | An unhandled server failure; do not expose secrets or stack traces. | return NextResponse.json({ error: 'Request failed' }, { status: 500 }); | Official source ↗ |
| 501 Not Implemented | The server lacks the functionality required for the request. | An unsupported capability or unrecognized method, distinct from 405. | return NextResponse.json({ error: 'Request failed' }, { status: 501 }); | Official source ↗ |
| 502 Bad Gateway | A gateway received an invalid upstream response. | Your proxy cannot parse or use an upstream provider response. | return NextResponse.json({ error: 'Request failed' }, { status: 502 }); | Official source ↗ |
| 503 Service Unavailable | The service is temporarily unavailable. | Maintenance or overload; Retry-After can suggest when to retry. | return NextResponse.json({ error: 'Request failed' }, { status: 503, headers: { 'Retry-After': '60' } }); | Official source ↗ |
| 504 Gateway Timeout | A gateway did not receive a timely upstream response. | Your route acts as a gateway and its upstream times out. | return NextResponse.json({ error: 'Request failed' }, { status: 504 }); | Official source ↗ |
| 505 HTTP Version Not Supported | The server does not support the major HTTP version. | HTTP-server concern, not a version number for your business API. | return NextResponse.json({ error: 'Request failed' }, { status: 505 }); | Official source ↗ |
| 511 Network Authentication Required | Network access authentication is required. | For intercepting network portals, not SaaS sign-in. | // Network portal only; do not use for SaaS authentication. | Official source ↗ |
Free, no sign-up. Inputs and results stay in your browser. Analytics record only a tool identifier and action, never your input.
The reference includes all code entries in RFC 9110 section 15, including obsolete and reserved entries. 428, 429, 431 and 511 come from RFC 6585 and link to that separate source.
No. Informational responses, 204, 205 and 304 cannot carry JSON here. Redirects use NextResponse.redirect. Range responses require real range content and headers. The reference gives safe alternatives rather than invalid JSON snippets.
401 means authentication is missing or invalid and needs a WWW-Authenticate challenge. 403 means the request is understood but refused, such as a signed-in user lacking workspace permissions.
400 fits malformed requests. 422 fits understood, syntactically valid content whose instructions cannot be processed. Choose a consistent documented contract for your API.
No. Each snippet shows the response construction, assuming NextResponse is imported from next/server and request is available. Add authentication, validation, logging and your own data handling.
Encode and decode Base64 text and files, create image data URIs and use URL-safe encoding. Recognize JSON and JWTs. Free, no sign-up, browser only.
Edit Markdown with a live preview, create tables and start from README.md, AGENTS.md, CLAUDE.md or llms.txt templates. Free, no sign-up, browser only.
Convert epoch seconds, milliseconds and ISO dates in your browser. Inspect time zones and PostgreSQL timestamptz for Next.js + Supabase. Free, no sign-up.
50 matching entries.
1xx
The request headers are accepted; the client may send its body. Let the HTTP server manage Expect: 100-continue; not an application JSON response.
// No NextResponse.json example: do not emit this code from a normal route handler.
1xx
The server agrees to change protocols. Handled by an upgrade-capable server, not a normal Next.js JSON route.
// No NextResponse.json example: do not emit this code from a normal route handler.
2xx
The request succeeded. Return a fetched resource or successful action result.
return NextResponse.json({ data: 'example' }, { status: 200 });2xx
The request created one or more resources. After inserting a record; provide Location for the new resource.
return NextResponse.json({ data: 'example' }, { status: 201, headers: { 'Location': '/api/items/123' } });2xx
Processing was accepted but has not completed. Queue an asynchronous job and return a status URL.
return NextResponse.json({ data: 'example' }, { status: 202 });2xx
A transforming proxy modified the origin representation. Use only when your service is acting as such a transforming proxy.
return NextResponse.json({ data: 'example' }, { status: 203 });2xx
The request succeeded and has no response content. A successful delete with no payload; JSON is forbidden.
return new NextResponse(null, { status: 204 }); // No JSON body2xx
The action succeeded; the client should reset its document view. A UI reset signal with an empty body; never include JSON.
return new NextResponse(null, { status: 205 }); // No JSON body2xx
One or more requested byte ranges are returned. For actual range responses; include Content-Range, not a JSON pagination marker.
return new NextResponse('abcd', { status: 206, headers: { 'Content-Range': 'bytes 0-3/10', 'Content-Type': 'text/plain' } });3xx
Several representations are available. Return a list of available representations for client selection.
return NextResponse.json({ data: 'example' }, { status: 300 });3xx
The resource has a permanent new URI; clients may change POST to GET. For a permanent redirect where changing method is acceptable; prefer 308 to preserve it.
return NextResponse.redirect(new URL('/api/v2/items', request.url), 301);3xx
The resource temporarily resides elsewhere; clients may change POST to GET. For a temporary redirect; use 307 when the original method must be preserved.
return NextResponse.redirect(new URL('/api/v2/items', request.url), 302);3xx
Retrieve a different resource using GET or HEAD. After a POST, redirect to the resulting resource using GET.
return NextResponse.redirect(new URL('/api/v2/items', request.url), 303);3xx
A conditional GET or HEAD can reuse its cached representation. After validating If-None-Match or If-Modified-Since; never include a body.
return new NextResponse(null, { status: 304 }); // No JSON body3xx
An obsolete proxy redirection mechanism. Do not emit in a modern application.
// No NextResponse.json example: do not emit this code from a normal route handler.
3xx
This previously assigned code is reserved and no longer used. Do not emit.
// No NextResponse.json example: do not emit this code from a normal route handler.
3xx
Temporary new URI with method and body preserved. Temporarily move an endpoint while retaining POST semantics.
return NextResponse.redirect(new URL('/api/v2/items', request.url), 307);3xx
Permanent new URI with method and body preserved. Permanently move an endpoint while retaining its method.
return NextResponse.redirect(new URL('/api/v2/items', request.url), 308);4xx
The request cannot be processed because of a perceived client error. Reject malformed JSON or invalid request syntax.
return NextResponse.json({ error: 'Request failed' }, { status: 400 });4xx
The request lacks valid authentication credentials. Missing or invalid authentication; include a WWW-Authenticate challenge.
return NextResponse.json({ error: 'Request failed' }, { status: 401, headers: { 'WWW-Authenticate': 'Bearer' } });4xx
Reserved for future use by HTTP. Any SaaS payment convention is application-specific; document it explicitly.
return NextResponse.json({ error: 'Request failed' }, { status: 402 });4xx
The server understands the request but refuses it. A signed-in user lacks permission to access a workspace.
return NextResponse.json({ error: 'Request failed' }, { status: 403 });4xx
No current representation was found, or its existence is undisclosed. A missing resource, including intentional concealment of a forbidden resource.
return NextResponse.json({ error: 'Request failed' }, { status: 404 });4xx
The method is known but unsupported for this resource. Reject an unsupported method; include Allow. Next.js can generate this automatically.
return NextResponse.json({ error: 'Request failed' }, { status: 405, headers: { 'Allow': 'GET, POST' } });4xx
No representation satisfies proactive content negotiation. The client requests a format your endpoint cannot provide.
return NextResponse.json({ error: 'Request failed' }, { status: 406 });4xx
Authentication with an intermediary proxy is required. Only for an authenticating proxy; include Proxy-Authenticate.
return NextResponse.json({ error: 'Request failed' }, { status: 407, headers: { 'Proxy-Authenticate': 'Basic realm="proxy"' } });4xx
The full request did not arrive within the waiting period. Usually generated by the HTTP server; distinguish from an upstream 504.
return NextResponse.json({ error: 'Request failed' }, { status: 408 });4xx
The request conflicts with the resource’s current state. A unique key conflict or an incompatible workflow transition.
return NextResponse.json({ error: 'Request failed' }, { status: 409 });4xx
The resource is no longer available and this is likely permanent. An intentionally retired API resource.
return NextResponse.json({ error: 'Request failed' }, { status: 410 });4xx
The request needs a defined Content-Length. Only if your endpoint truly requires a length; usually server-managed.
return NextResponse.json({ error: 'Request failed' }, { status: 411 });4xx
A request-header precondition evaluated false. If-Match does not match the current resource version.
return NextResponse.json({ error: 'Request failed' }, { status: 412 });4xx
The request content exceeds the size the server will accept. Reject an upload above your documented limit.
return NextResponse.json({ error: 'Request failed' }, { status: 413 });4xx
The target URI is longer than the server accepts. An excessively long query string; usually generated before your handler.
return NextResponse.json({ error: 'Request failed' }, { status: 414 });4xx
The request content format is unsupported. A JSON-only endpoint receives a different Content-Type.
return NextResponse.json({ error: 'Request failed' }, { status: 415 });4xx
The requested ranges cannot be served. A bytes range is outside the resource; return Content-Range with its length.
return NextResponse.json({ error: 'Request failed' }, { status: 416, headers: { 'Content-Range': 'bytes */10' } });4xx
A request expectation cannot be met. Cannot satisfy the Expect header; usually server-managed.
return NextResponse.json({ error: 'Request failed' }, { status: 417 });4xx
Reserved in RFC 9110 to prevent reassignment. Not a production API error convention; the teapot joke is not defined here.
// No NextResponse.json example: do not emit this code from a normal route handler.
4xx
The request arrived at a server unable to produce an authoritative response. Routing or connection reuse to the wrong origin; usually infrastructure-managed.
return NextResponse.json({ error: 'Request failed' }, { status: 421 });4xx
The content type and syntax are understood but instructions cannot be processed. A parsed JSON payload violates field or business validation.
return NextResponse.json({ error: 'Request failed' }, { status: 422 });4xx
The server requires a different protocol. Only for a real protocol upgrade; include Upgrade.
return NextResponse.json({ error: 'Request failed' }, { status: 426, headers: { 'Upgrade': 'TLS/1.3' } });4xx
The request must be conditional. Require If-Match to avoid lost updates.
return NextResponse.json({ error: 'Request failed' }, { status: 428 });4xx
The caller exceeded a rate limit. Return a rate-limit error with Retry-After when appropriate.
return NextResponse.json({ error: 'Request failed' }, { status: 429, headers: { 'Retry-After': '60' } });4xx
Request headers are too large. Reject oversized headers; usually handled before the route.
return NextResponse.json({ error: 'Request failed' }, { status: 431 });5xx
An unexpected condition prevented completion. An unhandled server failure; do not expose secrets or stack traces.
return NextResponse.json({ error: 'Request failed' }, { status: 500 });5xx
The server lacks the functionality required for the request. An unsupported capability or unrecognized method, distinct from 405.
return NextResponse.json({ error: 'Request failed' }, { status: 501 });5xx
A gateway received an invalid upstream response. Your proxy cannot parse or use an upstream provider response.
return NextResponse.json({ error: 'Request failed' }, { status: 502 });5xx
The service is temporarily unavailable. Maintenance or overload; Retry-After can suggest when to retry.
return NextResponse.json({ error: 'Request failed' }, { status: 503, headers: { 'Retry-After': '60' } });5xx
A gateway did not receive a timely upstream response. Your route acts as a gateway and its upstream times out.
return NextResponse.json({ error: 'Request failed' }, { status: 504 });5xx
The server does not support the major HTTP version. HTTP-server concern, not a version number for your business API.
return NextResponse.json({ error: 'Request failed' }, { status: 505 });5xx
Network access authentication is required. For intercepting network portals, not SaaS sign-in.
// Network portal only; do not use for SaaS authentication.