Skip to main content

Key Not Found

key_not_found404

Not Found · API key management

No API key with that ID exists in your account, or you don't have permission to access it.

What this means​

A request to revoke or rotate a specific API key by its ID found no active key with that ID under the signed-in account. Key management happens in the dashboard (it needs a dashboard sign-in, not an API key), so this is a dashboard error, not an authentication failure. The key is someone else's, doesn't exist, or was already revoked; a revoked key can't be rotated back to life.

When you'll see this​

  • A dashboard UI tried to load details for a key that was already revoked or deleted.
  • Rotate was clicked on a key that had already been revoked in another tab.
  • A copy-paste introduced a typo in the key ID.
  • The key was created and immediately revoked in a previous test, and stale state is referencing it.
Learn more about how this works

Key lookups are account-scoped. A key ID that exists for account A returns key_not_found when looked up by account B — we don't disclose whether the ID exists somewhere else. Like account lookups, this is deliberate: a working "does this key ID exist anywhere" oracle would be useful for attackers and useful for almost nobody else.

The most common gotcha: this is not about authenticating with a key (that's api_key_not_found, which is the 401 path during a real request). This error is about managing a key in the dashboard. Different layer, different fix.

Example response​

{
"success": false,
"error": "key_not_found",
"message": "API key not found or you do not have permission to access it.",
"details": [],
"retry_after": null,
"doc_url": "https://docs.asterwise.com/reference/errors/key_not_found/",
"request_id": "req_01HXYZABCDEFGH",
"timestamp": "2026-05-25T12:34:56Z"
}
NEW TO APIS?
Quick fix
  1. Sign in at asterwise.com/dashboard and open the API Keys page to see your current key IDs.
  2. Compare against the ID in the failing request — typos and copy-paste artifacts are the leading cause.
  3. If the key was created in a different account (consulting, agency, multi-tenant work), sign in to that account and retry.
PRODUCTION ENGINEER
Recovery pattern

Only the dashboard receives this error: revoking and rotating keys need a dashboard sign-in, and an API key sent to those endpoints gets session_required instead. Code that calls the API with a key never sees key_not_found, so there is nothing to handle in it. In the dashboard, reload the API Keys list and act on a key that is still shown there.

Production handler​

No code example provided.

Avoid this error by​

  • Revoke and rotate keys from the API Keys list in the dashboard, which only shows keys that exist.
  • Don't hardcode key IDs across environments; staging IDs don't exist in production and vice versa.
  • Treat a revoked key as gone: rotation issues a new key from an active one, never from a revoked one.
  • In team tooling, record which account owns each key so people sign in to the right account.