---
title: "unauthorized error"
url: "https://lookvalid.com/docs/errors/unauthorized.md"
canonical_url: "https://lookvalid.com/docs/errors/unauthorized"
last_updated: "2026-10-22"
type: "reference"
summary: "HTTP 401 unauthorized: The API key is missing, malformed, revoked or unknown. Cause, fix and a curl example."
related: ["https://lookvalid.com/docs/errors.md", "https://lookvalid.com/docs/authentication.md"]
---

# unauthorized error

HTTP 401 unauthorized: The API key is missing, malformed, revoked or unknown. Cause, fix and a curl example.

`unauthorized` is returned with HTTP **401**. Retryable: no. Sending the same request again returns the same error. Nothing is charged for this error.

## What it means

The API key is missing, malformed, revoked or unknown.

## Most likely cause

The request has no `Authorization` header, the key has a typo or a stray space or newline, the key was revoked in the dashboard, or the environment variable that holds it is empty in the process that sends the request.

## How to fix it

Send a valid key in the Authorization header as "Bearer <key>". If the key was revoked, create a new one and retry.

## Example

A request without a key is rejected with HTTP 401 and a `WWW-Authenticate: Bearer` header.

```sh
curl -i https://YOUR_API_HOST/v1/account
```

An error response is one JSON envelope. Branch on `code`, never on the message text. The `message` and `fix` of a real response can be more specific than the defaults shown here.

```json
{
  "error": {
    "code": "unauthorized",
    "message": "The API key is missing, malformed, revoked or unknown.",
    "fix": "Send a valid key in the Authorization header as \"Bearer <key>\". If the key was revoked, create a new one and retry.",
    "docs_url": "https://lookvalid.com/docs/errors/unauthorized",
    "retryable": false,
    "request_id": "req_3fK9pQ2xVb7LmN4sTz8WcA"
  }
}
```

## See also

- [All error codes](https://lookvalid.com/docs/errors.md) with the response envelope.
- [Authentication](https://lookvalid.com/docs/authentication.md).
- Quote the `request_id` when you write to [hello@lookvalid.com](mailto:hello@lookvalid.com).

## Related

- [Errors](https://lookvalid.com/docs/errors.md)
- [Authentication](https://lookvalid.com/docs/authentication.md)
