Authorization: Bearer eyJhbGciOi...Bearer tokens are the most common auth mechanism for modern APIs.
Bearer auth, API keys, permission errors, versioning strategies, and compatibility patterns for HTTP APIs.
Use standard auth headers and do not leak secrets in URLs.
Authorization: Bearer eyJhbGciOi...Bearer tokens are the most common auth mechanism for modern APIs.
X-API-Key: sk_live_123456If you support API keys, prefer headers over query parameters to reduce accidental leakage in logs and URLs.
Keep credentials out of path and query strings.
Avoid: GET /reports?access_token=abc123URLs are frequently logged, cached, and copied, making them a poor place for secrets.
HTTP/1.1 403 ForbiddenUse 403 when the user is known but does not have the right scope, role, or entitlement.
Introduce breaking changes without surprising existing clients.
GET /v1/usersPath versioning is simple and highly visible, making it popular for public APIs.
Accept: application/vnd.example.v2+jsonThis keeps URLs stable but can make testing and documentation slightly more complex.
API-Version: 2026-03-01Some APIs version behavior by date rather than integer versions, especially when changes are incremental.
Deprecation: true
Sunset: Tue, 01 Sep 2026 00:00:00 GMTDeprecation signals help clients migrate before a breaking removal.