Skip to main content

When it happens

  • No Authorization header.
  • Only an X-API-Key header. Send the key as Authorization: Bearer <key> instead.
  • A key in the query string, under any parameter name (api_key, access_token, key, token, …). Such keys are rejected even when valid, and removed from our logs.
  • An unknown or malformed key.
  • Your IP address is temporarily blocked: after 20 lookups of unknown keys from one address within a minute, requests from it get this error for 5 minutes, with a Retry-After header. A valid key that was used successfully within the last minute may still get through.
Every 401 carries a WWW-Authenticate header; for unknown and malformed keys it includes error="invalid_token". A blocked address’s 401 does not, because its key was not checked: do not discard a key because of it.

What to do

Send Authorization: Bearer <key> with a current key. Do not retry automatically: a deployment that keeps retrying a wrong key can block every system behind the same egress address. See Authentication.

Example

Headers
Body
See the errors catalogue for every error type, and Handling errors for retry strategy.