Error Codes

Providing a detailed list of error codes that API consumers can expect when integrating with an API, sharing common HTTP status codes, but also custom errors returned. Having a single page helps communicate errors with consumers, but it also helps producers evaluate how errors are handled across many different APIs.

Also known as: Errors, Problem Details, Status Codes

Example

error-codes.yaml
- type: ErrorCodes
  url: https://developers.example.com/errors

Standards

HTTP Headers

HeaderDirectionSpecDescription
Content-Type response RFC 9110 §8.3 Should be application/problem+json (or +xml) for Problem Details payloads.
Content-Language response RFC 9110 §8.5 Optional natural-language tag for localised error detail.

Status Codes

Media Types

OpenAPI Expression

Link Relations

Governance Rules

Risk & Compliance

OWASP:

Compliance:

Security: Verbose error responses can leak stack traces, internal hostnames, query fragments, or PII. Use Problem Details with stable type URIs, redact sensitive fields, and ensure error bodies do not vary based on existence of resources in ways that enable enumeration.

Tools

Suggested Metrics

Example Implementations

Related Properties

Tags


All Common Properties