420
HTTPERRORCritical4xx Client Error (Unofficial)MEDIUM confidence

Method Failure / Enhance Your Calm

Production Risk

Low — only encountered with specific legacy APIs. Treat it as a rate limit signal.

What this means

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.

Why it happens
  1. 1Spring WebDAV: A WebDAV method call failed in a Spring-based application.
  2. 2Twitter API v1: The client was sending too many requests and being rate limited (now replaced by 429).
  3. 3Any vendor using 420 for custom purposes outside the IETF specification.
How to reproduce

Calling a deprecated Twitter API v1 endpoint at high frequency, or a Spring WebDAV method failure.

trigger — this will error
trigger — this will error
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.

Migrate to 429 handling for rate limits
// 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.

What not to do

Do not use 420 in new API designs

Use 429 Too Many Requests for rate limiting — it is the IETF-standardised code.

Version notes
Twitter API v1

Twitter used 420 for rate limiting in API v1. Twitter API v2 uses 429.

Spring WebDAV

Used in older Spring WebDAV implementations; not in widespread use.

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All HTTP errors