Method Failure / Enhance Your Calm
Production Risk
Low — only encountered with specific legacy APIs. Treat it as a rate limit signal.
420 has two distinct unofficial uses: Spring Framework's WebDAV implementation used it to indicate a method failure, and Twitter's API v1 used it as 'Enhance Your Calm' to signal rate limiting. Neither use is standardised; Twitter has since migrated to 429 Too Many Requests.
- 1Spring WebDAV: A WebDAV method call failed in a Spring-based application.
- 2Twitter API v1: The client was sending too many requests and being rate limited (now replaced by 429).
- 3Any vendor using 420 for custom purposes outside the IETF specification.
Calling a deprecated Twitter API v1 endpoint at high frequency, or a Spring WebDAV method failure.
GET /1/statuses/home_timeline.json HTTP/1.1 Host: api.twitter.com # Sent too rapidly
expected output
HTTP/1.1 420 Enhance Your Calm
Fix
Migrate to 429 handling for rate limits
WHEN Integrating with APIs that may return 420 for rate limiting.
// Treat 420 the same as 429
if (response.status === 420 || response.status === 429) {
await sleep(retryAfter * 1000);
return retry();
}Why this works
Handle both 420 and 429 as rate limit signals and back off accordingly.
✕ Do not use 420 in new API designs
Use 429 Too Many Requests for rate limiting — it is the IETF-standardised code.
Twitter used 420 for rate limiting in API v1. Twitter API v2 uses 429.
Used in older Spring WebDAV implementations; not in widespread use.
Twitter API documentation (legacy)
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#420 ↗Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev