Data

HTTP Status Codes JSON Example

A reference JSON dataset of the most important HTTP status codes — including success, redirection, client error, and server error categories. Copy-ready for API documentation, mock servers, and error-handling libraries.

{
  "version": "1.0",
  "generatedAt": "2025-01-15T00:00:00Z",
  "count": 12,
  "codes": [
    {
      "code": 200,
      "text": "OK",
      "category": "success",
      "description": "The request succeeded."
    },
    {
      "code": 201,
      "text": "Created",
      "category": "success",
      "description": "Resource created successfully."
    },
    {
      "code": 204,
      "text": "No Content",
      "category": "success",
      "description": "Request succeeded; response body is empty."
    },
    {
      "code": 301,
      "text": "Moved Permanently",
      "category": "redirection",
      "description": "Resource permanently moved to a new URL."
    },
    {
      "code": 304,
      "text": "Not Modified",
      "category": "redirection",
      "description": "Client cache is still valid; no body returned."
    },
    {
      "code": 400,
      "text": "Bad Request",
      "category": "client_error",
      "description": "Request syntax or parameters are invalid."
    },
    {
      "code": 401,
      "text": "Unauthorized",
      "category": "client_error",
      "description": "Authentication credentials are missing or invalid."
    },
    {
      "code": 403,
      "text": "Forbidden",
      "category": "client_error",
      "description": "Authenticated but lacks permission for this resource."
    },
    {
      "code": 404,
      "text": "Not Found",
      "category": "client_error",
      "description": "Requested resource does not exist."
    },
    {
      "code": 422,
      "text": "Unprocessable Entity",
      "category": "client_error",
      "description": "Validation failed on the request body."
    },
    {
      "code": 429,
      "text": "Too Many Requests",
      "category": "client_error",
      "description": "Rate limit exceeded; client should slow down."
    },
    {
      "code": 500,
      "text": "Internal Server Error",
      "category": "server_error",
      "description": "Server encountered an unexpected condition."
    }
  ]
}

Field Reference

versionstringrequiredDataset version for caching and cache-busting.
generatedAtstring (ISO 8601)requiredTimestamp when this dataset was generated.
countnumberrequiredTotal number of status code entries.
codes[].codenumberrequiredNumeric HTTP status code (e.g. 200, 404).
codes[].textstringrequiredOfficial IANA reason phrase for the code.
codes[].categorystringrequiredOne of: success, redirection, client_error, server_error.
codes[].descriptionstringrequiredHuman-readable explanation of what this code means.

Variants

Client errors onlyFiltered to 4xx codes — useful for building error-handling utilities
Client errors only
{
  "category": "client_error",
  "codes": [
    {
      "code": 400,
      "text": "Bad Request",
      "description": "Request syntax or parameters are invalid."
    },
    {
      "code": 401,
      "text": "Unauthorized",
      "description": "Authentication credentials are missing or invalid."
    },
    {
      "code": 403,
      "text": "Forbidden",
      "description": "Authenticated but lacks permission for this resource."
    },
    {
      "code": 404,
      "text": "Not Found",
      "description": "Requested resource does not exist."
    },
    {
      "code": 422,
      "text": "Unprocessable Entity",
      "description": "Validation failed on the request body."
    },
    {
      "code": 429,
      "text": "Too Many Requests",
      "description": "Rate limit exceeded; client should slow down."
    }
  ]
}

Common Use Cases

  • Building a reference lookup table in your API client or SDK
  • Seeding mock servers with known error responses
  • Generating user-friendly error messages from numeric codes
  • Testing API error-handling branches with known status codes
  • Powering developer documentation portals and status code glossaries
HTTPstatus codesREST APIreferenceerror handling

Validate or format this JSON

Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.

Frequently Asked Questions

The HTTP specification (RFC 9110) defines five classes by the first digit: 1xx informational, 2xx success, 3xx redirection, 4xx client error, and 5xx server error. Each class groups codes with similar semantics so clients can take the right action even for unknown codes.

Return 400 Bad Request when the request is syntactically malformed (invalid JSON, missing required headers). Return 422 Unprocessable Entity when the syntax is correct but the data fails semantic validation — for example, an end date before a start date or an invalid email format in a valid JSON body.

401 Unauthorized means the client is not authenticated — no credentials or invalid credentials. 403 Forbidden means the client IS authenticated but does not have permission for that resource. Always send a WWW-Authenticate header with 401.

Use 403 if revealing that the resource exists is acceptable. Use 404 if you want to hide whether the resource exists at all (security through obscurity) — this is common for admin endpoints and private user data.

Related JSON Examples