Skip to main content

Invalid API Key

Invalid API Key

type
string
https://docs.username.dev/errors/invalid-api-key
status
integer
401
When it occurs
Your API key is missing, malformed, or invalid. This can happen if:
  • The Authorization header is missing
  • The API key format is incorrect
  • The API key has been regenerated or expired
  • The API key doesn’t exist in the system
How to fix
  1. Verify your API key is correctly formatted as un_live_<32-char-random>
  2. Ensure the Authorization header is included: Authorization: Bearer un_live_your_api_key
  3. Get your API key from the dashboard at app.username.dev/dashboard
  4. If you recently regenerated your API key, make sure you’re using the new key
{
  "type": "https://docs.username.dev/errors/invalid-api-key",
  "title": "Invalid API Key",
  "status": 401,
  "detail": "API key is invalid or missing",
  "instance": "/check?input=test"
}
Example scenario: Using an old API key after regenerating it, or forgetting to include the Authorization header.