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

# Authentication

> Learn how to authenticate with the LinkedCamp API

## API Token Authentication

The LinkedCamp API uses token-based authentication. Every authenticated request must include a `token` header containing your API key.

```bash theme={null}
curl -X GET https://api.linkedcamp.com/users/me \
  -H "token: YOUR_API_TOKEN"
```

## Obtaining Your API Token

There are two ways to get your API token:

### From the Dashboard

1. Log in to your [LinkedCamp account](https://app.linkedcamp.com)
2. Navigate to **Settings** > **API**
3. Copy your API token

### Via the API (Agency Owners)

Agency owners can retrieve API tokens for their sub-accounts using the [Get API Token](/api-reference/tokens/get-api-token) endpoint:

```bash theme={null}
curl -X GET "https://api.linkedcamp.com/tokens?accountEmail=user@example.com" \
  -H "token: AGENCY_OWNER_TOKEN"
```

## Request Headers

All API requests require the following headers:

| Header         | Required | Description                                |
| -------------- | -------- | ------------------------------------------ |
| `token`        | Yes      | Your LinkedCamp API token                  |
| `Content-Type` | Yes\*    | `application/json` (for POST/PUT requests) |

<Note>
  The `Content-Type` header is only required for requests that include a JSON body (POST and PUT methods).
</Note>

## Authentication Errors

If authentication fails, the API returns:

```json theme={null}
{
  "success": false,
  "message": "Invalid Token!"
}
```

Common reasons for authentication failures:

| Error Message        | Cause                                                       |
| -------------------- | ----------------------------------------------------------- |
| `Token is required!` | The `token` header is missing from the request              |
| `Invalid Token!`     | The token is incorrect, expired, or the account is inactive |
| `User not found!`    | No active user account is associated with the token         |

## Token Requirements

* The token must belong to an **active** user account
* The user must have a **current plan** assigned
* Tokens are validated on every request and the `lastUsedAt` timestamp is updated automatically
