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

# unauthenticated

> The request has no valid credentials.

| Status | Title |
| - | - |
| `401` | Missing, invalid or expired credentials |
| `401` | Missing or invalid session credential |

## Where you see it

* **Your server**, on any SDK API endpoint, with the first title.
* **Your app's result**, rarely: when the hosted flow reloads and its link session's own credential is no longer valid, it ends and reports this code in `LinkResult.error.code`. The second title belongs to the hosted flow's own calls.

## What it means

The `Authorization` header is missing, isn't a `Bearer` token, or the token is unknown, revoked or expired.

An integration's token from the client credentials grant lasts one hour.

## What to do

* Request a new token from `https://app.plugchoice.com/oauth/token` with your integration's client ID and secret (`grant_type=client_credentials`), then retry.
* Cache the token on your server and renew it before its `expires_in` runs out, rather than requesting one per call.
* Send it as `Authorization: Bearer <token>`.

See [Authentication](/sdk/api#authentication).

## Example

```json theme={null}
{
  "type": "https://developer.plugchoice.com/sdk/errors/unauthenticated",
  "title": "Missing, invalid or expired credentials",
  "status": 401,
  "code": "unauthenticated"
}
```


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