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

# Authentication

> Authenticate and start using the Well API in minutes.

## 🔐 Authenticate with the Well API

To start using the Well API, you need to generate a Bearer token via the `/auth/api_key` endpoint using your `client_id` and `client_secret` — provided by the Well team.

***

### Endpoint

```http theme={null}
POST https://api.wellapp.ai/auth/api_key
```

***

### Request Body

```json theme={null}
{
  "client_id": "your-client-id",
  "client_secret": "your-client-secret"
}
```

* <code>client\_id</code> and <code>client\_secret</code> are provided by the Well team when your
  account is provisioned.
* Keep your credentials secure and never expose them in public code or frontend applications.

***

### Example using cURL

```bash theme={null}
curl -X POST https://api.wellapp.ai/auth/api_key \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "your-client-id",
    "client_secret": "your-client-secret"
  }'
```

***

### Response

A successful response will return a JSON payload containing your bearer token:

```json theme={null}
{
  "token": "your-bearer-token",
  "expires_in": 3600
}
```

* <code>token</code>: Use this token in the `Authorization` header for all subsequent API calls.
* <code>expires\_in</code>: Indicates how long the token is valid (in seconds).

***

### Authenticated Requests

Use the bearer token like this:

```bash theme={null}
curl https://api.wellapp.ai/documents \
  -H "Authorization: Bearer your-bearer-token"
```

***

### 🔒 Security Notes

* Always use HTTPS when calling the API.
* Never expose your `client_secret` or token in frontend code.
* Tokens are short-lived; you can refresh them by repeating the authentication request.

***

### ✅ You're Ready

Now that you're authenticated, you can start using:

* The [Documents API](/documents)
* The [Webhooks API](/webhooks)
* The [Webhook Events Reference](/webhook-events)

Need help? Reach out at [support@wellapp.ai](mailto:support@wellapp.ai)
