Skip to main content
apiguide.dev

apiguide.dev

Authoritative design patterns for developer-friendly APIs. Standardize your error schemas, document your status codes, secure your headers, and master the HTTP specification.

Reference Directories

Common API Scenarios

How to handle rate limits?

Protect your servers from abuse by implementing uniform rate-limiting responses. Learn which headers to write and when to drop client requests.

How to lock concurrency?

Prevent "mid-air collisions" and race conditions where multiple clients update the same database entity concurrently using optimistic locking.

How to structure validation failures?

Return clear, nested parameter-level validation errors to clients when form submissions fail, using RFC 9457 standard patterns.

How to guarantee request idempotence?

Ensure safe retries for state-mutating requests (like payment actions) without duplicate charge processing by utilizing unique header keys.

The Standardized Error Pattern

Web APIs should use RFC 9457 (Problem+JSON) error responses rather than arbitrary ad-hoc properties, providing predictable error categorization.

🚫 Bad Ad-hoc Error Payload
{
  "error": true,
  "msg": "Invalid email format",
  "code": 9942,
  "timestamp": 178598402
}
✅ Standard RFC 9457 Problem+JSON
{
  "type": "https://apiguide.dev/errors/validation-failed",
  "title": "Validation Failed",
  "status": 422,
  "detail": "The request body validation parameters failed.",
  "instance": "/users/102/profile",
  "invalid_params": [
    {
      "name": "email",
      "reason": "Email address must contain '@' sign"
    }
  ]
}

Quick Reference Dashboard

Featured Error Schemas

UnauthorizedHTTP 401

Unauthorized: A standardized definition for this error code.

Conflict: A standardized definition for this error code.

Unprocessable Entity: A standardized definition for this error code.

Too Many Requests: A standardized definition for this error code.

View all error schemas →

Essential HTTP Headers

Contains the credentials to authenticate the client with the server.

Directives for caching mechanisms in both requests and responses.

Custom request header used to prevent duplicate operations (mutations) on the server.

Retry-Afterresponse

Tells the client how long to wait before making a follow-up request.

View all headers →

HTTP Methods Cheat Sheet

MethodSafeIdempotent
GETYesYes
POSTNoNo
PUTNoYes
PATCHNoNo
DELETENoYes
View all request verbs →