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

# Authentication

> Generate an API key from your dashboard and authorize your Referly API requests with a Bearer token.

<Note>
  The API is a premium feature that's only available to users who have an active
  Business Plan. [See Pricing Page](https://referly.so/pricing)
</Note>

To use this API, you need to have created your Affiliate Program and entered all necessary details.

All API endpoints are authenticated using Bearer tokens, this requires you to have completed creating your Affiliate Program. Here's how you create an Auth Token:

Step 1. Click on `API Keys` on your dashboard sidebar:

<img className="block" src="https://mintcdn.com/pushlapgrowth/Kgf273m3Sfv2f_w5/images/step-1.png?fit=max&auto=format&n=Kgf273m3Sfv2f_w5&q=85&s=87bb8c02e7739767552afc488d263e59" style={{ borderRadius: "10px" }} alt="The API Keys item in the Referly dashboard sidebar" width="534" height="294" data-path="images/step-1.png" />

Step 2. Click on `Generate New API Key +`:

<img className="block" src="https://mintcdn.com/pushlapgrowth/Kgf273m3Sfv2f_w5/images/step-2.png?fit=max&auto=format&n=Kgf273m3Sfv2f_w5&q=85&s=77501b00c285ce8d02c07ea70e352a42" style={{ borderRadius: "10px" }} alt="The Generate New API Key button in the Referly dashboard" width="2372" height="384" data-path="images/step-2.png" />

Step 3. Click the copy icon to copy your Auth Token:

<img className="block" src="https://mintcdn.com/pushlapgrowth/Kgf273m3Sfv2f_w5/images/step-3.png?fit=max&auto=format&n=Kgf273m3Sfv2f_w5&q=85&s=829e41e4f32f9fcb2b6718b6384c92e9" style={{ borderRadius: "10px" }} alt="Copying the generated auth token in the Referly dashboard" width="1132" height="218" data-path="images/step-3.png" />

Step 4. Add your Auth Token to your API requests:

```json theme={null}
{
  "Authorization": "Bearer <YOUR_TOKEN>"
}
```

<Warning>
  Your API key grants full access to your program. Keep it on your server and never expose it in
  client-side code.
</Warning>
