// Reference Codex

API ERROR GLOSSARY

Every HTTP status code, OAuth error, and API-specific term decoded. Standardized protocol errors separated from provider-specific terminology so you stop guessing from the status code alone.

Understanding API Errors

API errors do not all use one universal vocabulary. HTTP status codes have standardized meanings, while individual API providers may define their own error codes, messages, and response fields.

This glossary distinguishes standardized HTTP and protocol errors from common API-specific terminology.

HTTP Status Codes

1xx — Informational Responses

100

Continue

The server has received the initial portion of the request and is asking the client to continue sending the request.

Common context

  • Large requests using Expect: 100-continue.
101

Switching Protocols

The server agrees to switch protocols as requested by the client.

Common context

  • Protocol upgrades such as WebSocket connections.
102

Processing

The server has received and is processing the request, but no final response is available yet.

Common context

  • WebDAV.
NoteThis is not a general-purpose API error.
103

Early Hints

The server provides preliminary response headers before the final response.

Common context

  • Sending Link headers so clients can begin fetching resources before the final response is available.

HTTP Status Codes

2xx — Successful Responses

2xx responses indicate that a request was successfully received, understood, and processed. They are not errors, but they are useful when troubleshooting APIs.

200

OK

The request succeeded.

Common API uses

  • Successful data retrieval
  • Successful updates
  • Successful operations that return a response body
201

Created

The request succeeded and resulted in the creation of a new resource.

Common API use

  • Successful POST requests that create a resource.
202

Accepted

The request has been accepted for processing, but processing has not necessarily completed.

Common API use

  • Asynchronous jobs or background processing.
203

Non-Authoritative Information

The request succeeded, but the returned representation or metadata may have been modified from the origin server's response.

204

No Content

The request succeeded, but there is no content to return in the response.

Common API use

  • Successful deletion or updates that do not require a response body.
205

Reset Content

The request succeeded and the client should reset the document or view that initiated the request.

206

Partial Content

The server is returning only part of the requested resource.

Common API use

  • Range requests and resumable downloads.

HTTP Status Codes

3xx — Redirection Responses

3xx responses generally indicate that the client must take additional action to complete the request or that the requested resource is available elsewhere.

CodeNameGeneral Meaning
300Multiple ChoicesMultiple possible representations or destinations
301Moved PermanentlyResource permanently moved
302FoundResource temporarily available elsewhere
303See OtherRetrieve the result from another URL
304Not ModifiedCached version is still valid
305Use ProxyDeprecated proxy instruction
306UnusedReserved/unused status code
307Temporary RedirectTemporary redirect that preserves method
308Permanent RedirectPermanent redirect that preserves method
300

Multiple Choices

The request has multiple possible responses, and the user agent may select one.

301

Moved Permanently

The requested resource has been permanently moved to a different URL.

Common API/web causes

  • An endpoint was permanently relocated.
  • A website or API was migrated.
  • An old URL has been replaced by a new one.

What to check

  • Verify the new URL.
  • Update hard-coded API endpoints.
  • Check the API provider's documentation for the current endpoint.
302

Found

The requested resource is temporarily available at a different URL.

Common context

  • Temporary redirection.
ImportantA 302 does not indicate that the resource has permanently moved.
303

See Other

The server directs the client to another URL to retrieve a representation of the requested resource. The follow-up request is normally performed using GET.

Common context

  • A server redirects the client to a separate resource after completing an operation.
304

Not Modified

The requested resource has not changed since the version stored by the client or cache.

Common context

  • Browser caching
  • API caching
  • Conditional requests
  • If-None-Match
  • If-Modified-Since
Important304 is not an error. It tells the client that its cached representation can still be used.
305

Use Proxy

The request was intended to be accessed through a proxy.

ImportantThis status code is deprecated and should not be used by modern APIs.
306

Unused

This status code is no longer used.

Important306 was previously defined but is now reserved and should not be treated as a normal API response.
307

Temporary Redirect

The requested resource is temporarily available at another URL. Unlike some historical uses of 302, 307 explicitly requires the client to preserve the original HTTP method and request content when following the redirect.

A request such as:
POST /api/upload
may be temporarily redirected while remaining a POST.
308

Permanent Redirect

The requested resource has permanently moved to another URL. Like 307, the client should preserve the original HTTP method and request content when following the redirect.

POST /api/v1/users
may permanently redirect to:
POST /api/v2/users

Redirect Troubleshooting

If an API request unexpectedly returns a 3xx response, check:

  • The URL being requested
  • Whether the API endpoint has moved
  • Whether the client automatically follows redirects
  • Whether the HTTP method is preserved
  • Whether authentication headers are preserved appropriately
  • Whether the API documentation specifies a new endpoint
  • Whether a proxy or gateway is involved
  • Whether an outdated API version is being used
ImportantA redirect is not automatically an error. Some redirects are intentional parts of how a service operates.

Common Redirect Differences

Key distinctions between redirection status codes.

301 — Moved Permanently

  • The resource has permanently moved.

302 — Found

  • The resource is temporarily available elsewhere.

302 vs. 307

Both indicate temporary redirection.

  • 302 has historically had varying client behavior regarding the HTTP method.
  • 307 explicitly preserves the original HTTP method and request content.

301 vs. 308

Both indicate permanent redirection.

  • 301 has historically allowed clients to change the request method in some circumstances.
  • 308 explicitly preserves the original HTTP method and request content.

304 vs. Other 3xx Responses

304 Not Modified is different from most other 3xx responses. It does not tell the client to visit another URL. Instead, it tells the client that its existing cached representation remains valid.

Phantom Audit Tip

When debugging an API, don't automatically treat every non-2xx response as a failure. A 304 can indicate successful cache validation, while a 301, 302, 307, or 308 may indicate that an endpoint has moved or that an intermediary is redirecting the request.

HTTP Status Codes

4xx — Client Error Responses

4xx responses generally indicate that something about the request is invalid, unacceptable, unauthorized, or otherwise cannot be fulfilled by the server.

400

Bad Request

The server cannot or will not process the request because it considers the request invalid.

Common API causes

  • Malformed JSON
  • Missing required information
  • Invalid parameters
  • Invalid request structure
  • Invalid parameter combinations
Important400 is intentionally broad. The response body may contain the specific reason.
401

Unauthorized

The request lacks valid authentication credentials.

Common causes

  • Missing access token
  • Expired token
  • Invalid token
  • Invalid credentials
  • Failed authentication
ImportantDespite the name "Unauthorized," this status primarily concerns authentication.
402

Payment Required

The status code is reserved for future use. Some APIs use 402 for billing, payment, subscription, or quota-related conditions.

ImportantThere is no universal API meaning for 402 beyond its registered HTTP status phrase.
403

Forbidden

The server understood the request but refuses to fulfill it.

Common causes

  • Insufficient permissions
  • Missing authorization scope
  • Access restrictions
  • Policy restrictions

Common distinction

  • 401 = Authentication is missing or invalid.
  • 403 = The request is understood, but access is not permitted.
404

Not Found

The server cannot find the requested resource.

Common API causes

  • Incorrect endpoint
  • Incorrect resource ID
  • Resource does not exist
  • Resource was deleted
  • Incorrect API version
ImportantAn API may deliberately return 404 instead of 403 to avoid revealing whether a protected resource exists.
405

Method Not Allowed

The HTTP method is recognized by the server but is not supported for the requested resource.

DELETE /users/123
when the endpoint only supports GET.

A server should provide an Allow header indicating the methods supported by the target resource.

406

Not Acceptable

The server cannot provide a response representation that satisfies the client's content-negotiation requirements.

Common API context

  • An Accept header requests a response format that the server cannot provide.
407

Proxy Authentication Required

Authentication with an intermediary proxy is required before the request can proceed.

408

Request Timeout

The server did not receive a complete request within the time it was prepared to wait.

ImportantThis is different from 504 Gateway Timeout.
409

Conflict

The request conflicts with the current state of the target resource.

Common API causes

  • Resource-state conflicts
  • Duplicate creation attempts
  • Version conflicts
  • Concurrent modifications
410

Gone

The requested resource is no longer available and is expected to remain unavailable.

Difference from 404

  • 404 = The server cannot find the resource.
  • 410 = The server knows that the resource is gone.
411

Length Required

The server refuses to process the request because it requires a valid Content-Length header.

412

Precondition Failed

A condition supplied with the request was not satisfied.

Common API context

  • If-Match
  • If-Unmodified-Since
  • Conditional updates
413

Content Too Large

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

Common causes

  • Oversized JSON payload
  • Oversized file upload
  • Request body exceeds configured limits
NoteOlder documentation may call this "Payload Too Large."
414

URI Too Long

The requested URI is longer than the server is willing to interpret.

Common API cause

  • An excessively large query string.
415

Unsupported Media Type

The server refuses the request because the media format of the request content is not supported.

The API expects:
Content-Type: application/json
but receives:
Content-Type: text/xml
416

Range Not Satisfiable

The requested range of a resource cannot be fulfilled.

Common API context

  • Partial file downloads.
417

Expectation Failed

The server cannot meet the requirements specified in the request's Expect header.

418

Unused

This status code is currently registered as unused.

Important"I'm a teapot" originated from an April Fools' specification. Although some servers use 418 as a joke or custom response, it should not be presented as a normal standardized API error meaning.
421

Misdirected Request

The request was directed at a server that cannot produce a response for the requested target.

Common context

  • HTTP/2 or HTTP/3 routing and connection issues.
422

Unprocessable Content

The server understands the content type and syntax of the request but cannot process the contained instructions.

Common API causes

  • Valid JSON containing invalid values
  • Validation failures
  • Application-level constraints
  • Semantically invalid input
{
  "age": -5
}
The JSON is syntactically valid, but the API may reject the value because it violates the application's rules.
ImportantOlder documentation may call this "Unprocessable Entity."
423

Locked

The target resource is locked and cannot currently be modified.

Common context

  • WebDAV.
424

Failed Dependency

The requested action could not be performed because it depended on another action that failed.

Common context

  • WebDAV.
425

Too Early

The server is unwilling to process the request because doing so could create a replay risk.

Common context

  • Early data and TLS 1.3. This is uncommon in ordinary APIs.
426

Upgrade Required

The server refuses the request using the current protocol and indicates that the client may succeed after upgrading to another protocol. The response should include an Upgrade header identifying the required protocol.

428

Precondition Required

The server requires the request to be conditional.

Common purpose

  • Preventing lost-update problems when multiple clients may modify the same resource.

Common API context

  • Requiring If-Match before an update.
429

Too Many Requests

The client has sent too many requests within a given period.

Common causes

  • Rate limiting
  • Excessive request frequency
  • API request limits

A response may include a Retry-After header indicating when the client should try again.

431

Request Header Fields Too Large

The server refuses the request because its request headers are too large.

Common causes

  • Oversized cookies
  • Excessively large custom headers
  • Oversized authentication headers
451

Unavailable For Legal Reasons

The server is denying access because of a legal demand.

Common context

  • Court orders
  • Government restrictions
  • Legal or regulatory requirements

The use of 451 does not necessarily establish whether the requested resource actually exists.

HTTP Status Codes

5xx — Server Error Responses

5xx responses generally indicate that the server encountered a problem while attempting to fulfill an apparently valid request.

500

Internal Server Error

The server encountered an unexpected condition that prevented it from fulfilling the request.

Common causes

  • Unhandled application exception
  • Server-side bug
  • Database failure
  • Misconfiguration
  • Unexpected dependency failure
501

Not Implemented

The server does not support the functionality required to fulfill the request.

Important distinction

  • 405 = The method is known but not allowed for this resource.
  • 501 = The server does not support the functionality required to fulfill the request.
502

Bad Gateway

A server acting as a gateway or proxy received an invalid response from an upstream server.

Example architecture:
Client -> API Gateway -> Backend Service
If the gateway receives an invalid response from the backend, a 502 may result.
503

Service Unavailable

The server is currently unable to handle the request.

Common causes

  • Temporary overload
  • Maintenance
  • Temporary service outage
  • Insufficient capacity

A Retry-After header may indicate when the client should retry.

504

Gateway Timeout

A gateway or proxy did not receive a timely response from an upstream server.

Common distinction

  • 502 = Upstream response was invalid.
  • 504 = Upstream response did not arrive in time.
505

HTTP Version Not Supported

The server does not support the HTTP version used in the request.

506

Variant Also Negotiates

The server has an internal configuration error in which the selected variant resource is itself configured to participate in content negotiation in a way that cannot be completed.

Common context

  • HTTP content negotiation.
510

Not Extended

The server requires further extensions to the request before it can fulfill it.

Common context

  • HTTP extension mechanisms.
NoteThis is uncommon in modern APIs.
511

Network Authentication Required

The client must authenticate with the network before it can access the requested resource.

Common context

  • Captive portals
  • Public Wi-Fi login pages
  • Network access authentication
Important511 generally concerns network access rather than authentication with the requested API itself.

WebDAV and Extended HTTP Status Codes

Some HTTP status codes are associated with WebDAV or other HTTP extensions rather than ordinary REST APIs. They remain useful to know because developers may encounter them in APIs, file systems, enterprise systems, and WebDAV services.

207

Multi-Status

Provides separate status information for multiple resources or operations.

208

Already Reported

Indicates that a resource's members have already been reported in an earlier part of a WebDAV response.

423

Locked

The requested resource is locked.

424

Failed Dependency

The requested action failed because a dependent action failed.

507

Insufficient Storage

The server cannot store the representation needed to complete the request.

508

Loop Detected

The server detected an infinite loop while processing the request.

OAuth API Errors

OAuth defines several error values that can appear in authorization and token responses.

ImportantThese are error identifiers used by OAuth. They are not HTTP status codes.

invalid_request

The request is missing a required parameter, contains an invalid parameter value, repeats a parameter, or is otherwise malformed.

Common HTTP response

  • 400 Bad Request.

invalid_client

Client authentication failed.

Possible causes

  • Unknown client
  • Missing client authentication
  • Invalid client credentials
  • Unsupported client authentication method

invalid_grant

The supplied authorization grant is invalid, expired, revoked, malformed, or otherwise unsuitable for the requested operation.

Common context

  • Authorization codes
  • Refresh tokens
  • Other OAuth grants

unauthorized_client

The client is not authorized to use the requested authorization grant type or method.

unsupported_grant_type

The authorization server does not support the requested grant type.

invalid_scope

The requested scope is invalid, unknown, malformed, or otherwise unacceptable.

access_denied

The resource owner or authorization server denied the authorization request.

unsupported_response_type

The authorization server does not support the requested response type.

server_error

The authorization server encountered an unexpected condition that prevented it from fulfilling the request.

temporarily_unavailable

The authorization server is temporarily unable to handle the request.

Common causes

  • Temporary overload
  • Maintenance
  • Temporary service outage

OAuth Bearer Token Errors

OAuth bearer-token usage defines additional error values for protected-resource requests.

invalid_request

The request is malformed or does not correctly contain the required access-token information.

Common HTTP response

  • 400 Bad Request.

invalid_token

The supplied access token is expired, revoked, malformed, or otherwise invalid.

Common HTTP response

  • 401 Unauthorized.

insufficient_scope

The access token does not provide sufficient privileges to perform the requested operation.

Common HTTP response

  • 403 Forbidden.

API Problem Details

Modern HTTP APIs may use the standardized Problem Details format defined by RFC 9457. A Problem Details response commonly uses Content-Type: application/problem+json.

{
  "type": "https://example.com/problems/invalid-request",
  "title": "Invalid Request",
  "status": 400,
  "detail": "The supplied account ID is invalid.",
  "instance": "/requests/12345"
}

type

Identifies the type of problem using a URI reference. The type can point to documentation describing the problem. If omitted, the default value is about:blank.

title

A short, human-readable summary of the problem type. The title generally describes the type of problem rather than the individual occurrence.

status

Contains the HTTP status code associated with the problem.

400
ImportantThe actual HTTP response status remains authoritative. The status member is advisory.

detail

Provides a human-readable explanation specific to the particular occurrence of the problem. It should generally help the client understand or correct the problem.

instance

Identifies the specific occurrence of the problem. This can be useful for troubleshooting, support, logging, or forensic purposes.

Common API-Specific Error Terms

The following terms are commonly encountered in APIs but are not universal HTTP status codes. Their exact meaning can vary between API providers.

invalid_api_key

The supplied API key is invalid, expired, revoked, malformed, or otherwise unacceptable.

ImportantThe exact meaning depends on the API provider.

missing_api_key

The API expected an API key but did not receive one.

invalid_credentials

The supplied authentication credentials could not be accepted.

authentication_required

The endpoint requires authentication before it can be used.

access_denied

Access to the requested operation or resource was denied.

ImportantThis is also an OAuth-standard error value, but other APIs may use the same name independently.

permission_denied

The authenticated client does not have the required permission.

forbidden

The API refuses to permit the requested operation.

ImportantThis may be an application-specific error message rather than the HTTP 403 status itself.

resource_not_found

The requested resource could not be found.

not_found

The requested resource could not be located.

missing_parameter

A required parameter was not provided.

invalid_parameter

A supplied parameter is invalid.

invalid_argument

An argument supplied to the API is invalid.

invalid_request

The request does not satisfy the API's requirements.

ImportantThis term is also standardized in OAuth, but other APIs may use it independently.

malformed_request

The request does not have the expected structure or format.

invalid_json

The request body contains malformed JSON or JSON that the API cannot accept.

validation_error

One or more submitted values failed application-level validation.

Common examples

  • Invalid email address
  • Value outside an allowed range
  • Required field missing
  • Invalid date
  • Invalid field combination

duplicate

The submitted value or resource conflicts with an existing one because it is considered a duplicate.

already_exists

The requested resource already exists.

conflict

The requested operation conflicts with the current state of a resource.

method_not_allowed

The requested HTTP method is not supported for the endpoint.

unsupported_media_type

The supplied content format is not supported by the API.

request_too_large

The request exceeds a size limit imposed by the API.

payload_too_large

The request payload exceeds an allowed size.

ImportantCurrent HTTP terminology uses 413 Content Too Large, although "Payload Too Large" remains common in API documentation and software.

rate_limit_exceeded

The client has exceeded a configured request-rate limit.

Common HTTP status

  • 429 Too Many Requests.

quota_exceeded

The client has exhausted an allocated usage quota.

Examples

  • API calls per month
  • Tokens per billing period
  • Storage allocation
  • Data transfer allocation

limit_exceeded

A configured usage or resource limit has been exceeded.

service_unavailable

The service is temporarily unable to process the request.

Common HTTP status

  • 503 Service Unavailable.

internal_server_error

The server encountered an unexpected internal problem.

Common HTTP status

  • 500 Internal Server Error.

timeout

An operation exceeded the amount of time allowed for completion.

ImportantThe exact cause and corresponding HTTP status can vary.

request_timeout

The server or API gateway did not receive or complete the request within an expected time period.

gateway_timeout

A gateway or intermediary did not receive a timely response from an upstream service.

Common HTTP status

  • 504 Gateway Timeout.

upstream_error

A dependent or upstream service returned an error.

dependency_failure

A required internal or external service failed.

database_error

An operation involving a database failed.

ImportantThis is generally an internal application error rather than a standardized HTTP error.

configuration_error

The service has an invalid, incomplete, or incompatible configuration.

not_implemented

The requested functionality is not implemented.

Common HTTP status

  • 501 Not Implemented.

Common API Error Response Fields

API providers frequently include additional fields beyond the standardized Problem Details members. The following are common conventions, but they are not all standardized HTTP fields.

code

An application-specific identifier for the error.

{
  "code": "INVALID_ACCOUNT"
}

message

A human-readable description of the error.

ImportantApplications should generally avoid requiring clients to parse human-readable messages as machine-readable codes.

error

A general-purpose error identifier or object.

ImportantThe exact structure varies widely between APIs.

error_code

An application-specific error identifier.

error_message

A human-readable description of an application-specific error.

error_description

A human-readable description of an error.

Common context

  • OAuth.

errors

A collection of individual validation or processing errors.

Importanterrors is not a required RFC 9457 member. APIs may define it as an extension.

request_id

An identifier associated with a particular request.

Common purpose

  • Allows developers or support personnel to locate the request in server logs.

correlation_id

An identifier used to associate related operations or requests across systems.

trace_id

An identifier used to correlate activity across distributed services and tracing systems.

timestamp

A timestamp indicating when the error or request occurred.

ImportantThe exact format and meaning depend on the API.

path

The endpoint or request path associated with the error.

field

Identifies the input field associated with a validation error.

parameter

Identifies the request parameter associated with an error.

retry_after

Provides information about when a client should attempt the request again.

ImportantHTTP's standardized mechanism for this information is the Retry-After response header. APIs may also expose application-specific fields with similar names.

Common API Validation Error Terms

These are especially common when an API accepts forms, JSON, or structured data.

required

A required value was not provided.

invalid_format

The value does not match the required format.

invalid_type

The value has an unexpected data type.

The API expects a number but receives a string.

out_of_range

The supplied value is outside the permitted range.

too_short

The supplied value is shorter than the minimum allowed length.

too_long

The supplied value exceeds the maximum allowed length.

invalid_value

The supplied value is not one of the values accepted by the API.

unsupported_value

The supplied value is syntactically valid but is not supported by the API.

missing_field

A required field is absent.

invalid_field

A particular field contains an invalid value.

conflicting_fields

Two or more fields contain values that cannot be used together.

Common API Authentication Terms

These terms frequently appear in authentication-related responses but are not universal HTTP status codes.

token_expired

The authentication or access token has expired.

token_revoked

The token has been revoked and can no longer be used.

token_invalid

The supplied token is invalid.

session_expired

The user's authenticated session has expired.

session_invalid

The server cannot accept the supplied session information.

account_locked

The account has been temporarily or permanently locked.

account_disabled

The account has been disabled.

mfa_required

Multi-factor authentication is required before the requested operation can proceed.

mfa_failed

The supplied multi-factor authentication information could not be verified.

verification_required

The API requires an additional verification step.

Common API Billing and Quota Terms

These terms are provider-specific unless the API documentation says otherwise.

payment_required

The API requires payment or an active subscription before the requested operation can proceed.

Possible HTTP status

  • 402 Payment Required.

subscription_required

The requested feature requires an active subscription.

plan_limit_exceeded

The user's current subscription plan does not permit the requested amount of usage.

quota_exceeded

The allocated usage quota has been exhausted.

credit_exhausted

The account has used all available credits.

billing_error

A billing-related operation failed.

payment_failed

A payment attempt was unsuccessful.

Common API File and Upload Errors

file_not_found

The requested file could not be located.

file_too_large

The uploaded or requested file exceeds an allowed size.

unsupported_file_type

The file type is not supported.

invalid_file

The supplied file is malformed, corrupted, or otherwise unacceptable.

upload_failed

The file upload could not be completed.

download_failed

The requested file could not be downloaded successfully.

storage_limit_exceeded

The account or service has exceeded its available storage allocation.

Common API Dependency and Infrastructure Errors

upstream_unavailable

A required upstream service is currently unavailable.

dependency_unavailable

A required dependency cannot currently be reached or used.

connection_failed

The service could not establish a required connection.

connection_timeout

A connection attempt exceeded the permitted time.

read_timeout

The service did not receive data from a connected service within the expected time.

write_timeout

The service could not complete a write operation within the expected time.

dns_error

A DNS-related problem prevented the service from resolving a required hostname.

network_error

A network-related failure prevented the operation from completing.

API Error Troubleshooting Quick Guide

Receiving 400?

Check

  • Request syntax
  • JSON formatting
  • Required parameters
  • Parameter names
  • Parameter values
  • Content type
  • API documentation

Receiving 401?

Check

  • API key
  • Access token
  • Authentication header
  • Token expiration
  • Authentication scheme

Receiving 403?

Check

  • Account permissions
  • Authorization scopes
  • Resource permissions
  • Subscription restrictions
  • Organization policies

Receiving 404?

Check

  • Endpoint URL
  • Resource ID
  • API version
  • Resource existence
  • Typographical errors

Receiving 405?

Check

  • HTTP method
  • API documentation
  • Allow response header

Receiving 409?

Check

  • Current resource state
  • Duplicate resources
  • Concurrent modifications
  • Version conflicts

Receiving 413?

Check

  • Request body size
  • File size
  • Upload limits
  • API payload limits

Receiving 415?

Check

  • Content-Type
  • Request body format
  • API-supported media types

Receiving 422?

Check

  • Field validation
  • Data types
  • Allowed values
  • Business rules
  • Required relationships between fields

Receiving 429?

Check

  • Rate limits
  • Request frequency
  • API quotas
  • Retry-After
  • Provider-specific usage limits

Receiving 500?

The problem is likely on the server side, although the request may have triggered an unhandled server-side condition.

Check

  • API status page
  • Server logs, if available
  • Request ID
  • Provider documentation
  • Whether the problem is reproducible

Receiving 502?

Check

  • Upstream services
  • API gateway
  • Reverse proxy
  • Load balancer
  • Provider status page

Receiving 503?

Check

  • Service availability
  • Maintenance notices
  • Provider status page
  • Retry-After
  • Temporary overload

Receiving 504?

Check

  • Upstream service response time
  • Gateway timeout configuration
  • Network connectivity
  • Provider status page

Important API Error Distinctions

400 vs. 422

400 Bad Request

  • The server considers the request invalid or malformed.

422 Unprocessable Content

  • The server understands the request and its content but cannot process the contained instructions.

401 vs. 403

401 Unauthorized

  • Authentication is missing or invalid.

403 Forbidden

  • The request is understood, but access is not permitted.

404 vs. 410

404 Not Found

  • The server cannot find the requested resource.

410 Gone

  • The server knows the resource is no longer available and is expected to remain unavailable.

405 vs. 501

405 Method Not Allowed

  • The HTTP method is recognized but isn't allowed for the requested resource.

501 Not Implemented

  • The server does not support the functionality required to fulfill the request.

408 vs. 504

408 Request Timeout

  • The server did not receive the request within the time it was prepared to wait.

504 Gateway Timeout

  • A gateway or proxy did not receive a timely response from an upstream server.

409 vs. 422

409 Conflict

  • The request conflicts with the current state of a resource.

422 Unprocessable Content

  • The request is understood but contains content that cannot be processed according to the application's rules.

429 vs. 503

429 Too Many Requests

  • The client is being rate limited.

503 Service Unavailable

  • The service is temporarily unable to handle requests, commonly because of overload or maintenance.

502 vs. 504

502 Bad Gateway

  • A gateway or proxy received an invalid response from an upstream server.

504 Gateway Timeout

  • A gateway or proxy did not receive a timely response from an upstream server.

API Error Response Best Practices

When troubleshooting an API error, examine more than the HTTP status code.

What to check

  • HTTP status code
  • Response body
  • API-specific error code
  • Error message
  • Request ID
  • Correlation or trace ID
  • Response headers
  • Request method
  • Endpoint URL
  • Request parameters
  • Request body
  • Authentication information
  • API documentation
  • Provider status page

Phantom Audit Tip

Never assume that an HTTP status code alone explains the entire problem.

Phantom Audit Reminder

An API error does not automatically mean that the API itself is broken. Errors can originate from many sources.

Common error origins

  • Invalid client requests
  • Authentication failures
  • Authorization restrictions
  • Rate limits
  • Resource conflicts
  • Validation rules
  • Server-side bugs
  • Database problems
  • Network failures
  • Upstream dependencies
  • Temporary outages
  • Configuration problems

Phantom Audit Tip

The HTTP status code tells you the general class of problem. The API's response body, documentation, logs, and surrounding context often provide the information needed to determine the actual cause. When in doubt: read the response body, check the API documentation, and investigate the specific error code rather than guessing from the HTTP status alone.