Skip to content

401 — Missing or invalid API key

1 min read

401 Unauthorized

You get 401 on both /v1/* and /dawa/* when the key is missing, malformed, or unrecognised.

Messages (on /v1/*):

  • "Manglende eller ugyldig API-nøgle" (Missing or invalid API key)
  • "Ukendt eller deaktiveret API-nøgle." (Unknown or deactivated API key)

On /dawa/* the same 401 comes in DAWA's shape: { "type": "AuthorizationError", "title": "Request not authorized." }.

Fix:

  1. Add the header Authorization: Bearer <key>.
  2. Copy the key again from the dashboard (no whitespace, not truncated). Keys start with sk_live_ or sk_pub_ (older keys with addr_ or daa_).
  3. Key revoked? Create a new one under Dashboard → API keys.
Bash
curl -H "Authorization: Bearer sk_live_xxx" \
  "https://api.danskadresseapi.dk/v1/adresser?q=rådhuspladsen%201%20københavn"
/dawa/* also requires a key — anonymous access no longer exists. The only exception is an IP binding: if you call with no key at all from an IP bound to your account, the binding is used. If you send an invalid key you get 401 — even from a bound IP. A wrong pub key gives 403 (see "403 — Forbidden").
Was this helpful?