---
title: "UNAUTHORIZED"
description: "What triggers UNAUTHORIZED (HTTP 401) when a request lacks valid authentication credentials."
canonical_url: "https://docs.leyr.io/api/error-handling/unauthorized"
---
# UNAUTHORIZED

> What triggers UNAUTHORIZED (HTTP 401) when a request lacks valid authentication credentials.

## Summary

This error corresponds to the standard `401 Unauthorized` HTTP status code, indicating that the request lacks valid authentication credentials for the requested resource.

## Example Response

```json
{
    "code": "UNAUTHORIZED",
    "type": "https://docs.leyr.io/api/error-handling/unauthorized",
    "title": "Unauthorized",
    "status": 401,
    "detail": "Application with the provided client ID was not found.",
    "instance": "36f6904c-fd11-4ea9-8f74-a103fc829bd1"
}
```

## Common Causes

- Missing `x-leyr-client-id` header in the request
- Invalid `x-leyr-client-id` header - the specified application ID doesn't exist
- Incorrect authentication credentials for the requested endpoint

## Resolution Steps

To resolve this error:

1. Check the `detail` field in the response body. It contains specific information about the authentication issue, following the [Pydantic error message](https://docs.pydantic.dev/latest/concepts/models/#error-handling) standard, including which parameter is missing and where (e.g. body, query, path, etc). It will also hint if you are trying to send in a value that is not allowed in a certain parameter.
2. Verify your request against our [API Reference](https://api.leyr.io/docs), paying particular attention to the required headers for each endpoint.
3. Go to [Developer portal](https://leyr.io/developers/apps/) and double-check the Client Id of application you are using.
4. If the issue persists, contact our support team at [contact@leyr.io](mailto:contact@leyr.io) with:
  - The `instance` ID from your error response
  - The endpoint you're trying to access
  - A copy of your request headers (excluding sensitive data)


## Sitemap

See the full [sitemap](https://docs.leyr.io/sitemap.md) for all pages.
