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

# Authenticate with the Linkvite API

> API keys for your own account, OAuth access tokens for apps other people use, and which endpoints need neither.

Every request is made over HTTPS and authenticates in one of two ways.

| Method | Header | Use it for |
| - | - | - |
| [API key](https://docs.linkvite.io/developers/api-keys.md) | `x-api-key: link_...` | Scripts and servers acting as your own account |
| [OAuth access token](https://docs.linkvite.io/developers/oauth.md) | `Authorization: Bearer <token>` | Apps other people sign in to |

```bash API key theme={null}
curl https://api.linkvite.io/v1/user \
  -H "x-api-key: $LINKVITE_API_KEY"
```

```bash Access token theme={null}
curl https://api.linkvite.io/v1/user \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

## Permissions

* **API keys** act with your account's full access.
* **OAuth access tokens** are limited to the [scopes](https://docs.linkvite.io/developers/scopes.md) the user approved. A request outside them fails with `403` and names the missing scope.

## Public endpoints

Some endpoints work without authentication, such as public profiles and public collections (`GET /v1/profiles/{username}` and the endpoints under it). Authentication is optional there: send credentials to see what's visible to your account, such as a private account you follow.

## Failed authentication

A missing, invalid, revoked or expired credential returns `401`:

```json theme={null}
{
  "ok": false,
  "error": "...",
  "request_id": "..."
}
```

With OAuth, refresh the access token and retry; see [refreshing tokens](https://docs.linkvite.io/developers/oauth.md#refresh-tokens).


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