> ## Documentation Index
> Fetch the complete documentation index at: https://docs.permitcore.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Invalid credentials

> 401 — the API key is malformed, revoked, or unknown. How to fix it.

Your request included an `Authorization: Bearer <key>` header, but the key
itself didn't resolve to an active credential — it's malformed, has been
revoked, or was never issued.

```json 401 application/problem+json theme={null}
{
  "type": "https://docs.permitcore.io/errors/invalid-credentials",
  "title": "Invalid Credentials",
  "status": 401,
  "detail": "Invalid or revoked API key.",
  "instance": "/v1/permits",
  "request_id": "req_815e1778d2b34558aa841a16db85bb13"
}
```

This is distinct from [`missing-credentials`](https://docs.permitcore.io/errors/missing-credentials): the
header was present, so the problem is the key's **value**, not its absence.

## Fix it

**1. Check the key you sent**

Confirm you're sending the full plaintext key exactly as issued — no
truncation, no extra whitespace, no leftover `<your-api-key>` placeholder.
Keys are shown in full **only once**, at creation.

**2. Rotate the key if it was revoked or lost**

If the key was deleted, or you no longer have the plaintext, create a fresh
one at
[permitcore.io/account/api-keys](https://permitcore.io/account/api-keys)
and update your environment. Revoked keys never reactivate.

**3. Resubmit**

```bash theme={null}
curl https://api.permitcore.io/v1/permits \
  -H "Authorization: Bearer $PERMITCORE_API_KEY"
```

## Common causes

* The key was revoked from the dashboard (any request with it now fails).
* Only part of the key was copied, or a placeholder was never replaced.
* A key from a different environment/account was used.
* Stray characters (newline, quotes) around the key in a config file or shell.

> [card] [Manage your keys](https://permitcore.io/account/api-keys)
>
> Create, view usage for, and revoke keys from the developer console.

See also [Authentication](https://docs.permitcore.io/authentication.md) and the full [error catalog](https://docs.permitcore.io/errors.md).
Every response carries an `x-request-id` header — include it in any support
request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.