Skip to content

API key missing

HTTP 401api_key_missing

When the API answers 401 api_key_missing, and how to fix it.

Version v1.1, updated

The type field of every api_key_missing response links to this page.

On this page

The request reached the API without an API key. Every operation except GET /v1/openapi.json needs one, in the Authorization header.

At a glance

  • Status: 401 Unauthorized

  • Code: api_key_missing

  • Retry: No. Fix the cause first: the same request gets the same answer.

Causes and fixes

Likely cause

How to fix it

The request has no Authorization header.

Send Authorization: Bearer followed by the key, as in Make your first request.

The header says Bearer with nothing after it, often because the variable that holds the key is empty on this server.

Check that BIRP_API_KEY is set where your code runs. Never print the key to check it.

The key is sent in another header, or in the URL.

Move it to the Authorization header. A key that was in a URL may be in logs: revoke it and create a new one.

Example

401 api_key_missingJSON
{
  "code": "api_key_missing",
  "detail": "Send the API key in the Authorization header: \"Authorization: Bearer <key>\".",
  "instance": "/v1/categories",
  "request_id": "a1b2c3d4-0000-4000-8000-0000000000ee",
  "status": 401,
  "title": "API key missing",
  "type": "https://birp.io/developers/errors/api_key_missing"
}
  • first-request
  • keep-your-key-safe
  • unsupported-auth-scheme
  • errors-overview