# unauthorized

> The request has no valid credential, or the wrong kind for this endpoint. Send the right bearer token.

`401 Unauthorized` · `Unauthorized` · `type: https://docs.dlogify.com/errors/unauthorized`

## When it happens

- The `Authorization` header is missing or not a bearer token.
- The API key is malformed, unknown or revoked.
- An API key was sent to a management endpoint, or a session token to an ingestion endpoint.
- The session expired, was signed out, or belongs to an account whose email is not verified yet.

## How to fix it

Ingestion endpoints (`POST /v1/ingest`, `POST /v1/logs`, OTLP/gRPC) take a project API key: `Authorization: Bearer lgf_live_…`. Every other endpoint takes a session token (see [Authentication](https://docs.dlogify.com/api.md#authentication)). If a key stopped working, check in the dashboard that it was not revoked, and create a new one if needed.

## Example

```http
HTTP/1.1 401 Unauthorized
Content-Type: application/problem+json
```

```json
{
  "type": "https://docs.dlogify.com/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Missing or invalid API key.",
  "instance": "req_01j…"
}
```

Source: https://docs.dlogify.com/errors/unauthorized
