> For the complete documentation index, see [llms.txt](https://docs.clearfeed.ai/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clearfeed.ai/api/quick-start/authentication-guide.md).

# Authentication Guide

To access ClearFeed APIs, authentication is required using a bearer token. This token acts as a secure passkey for authorized usage. Follow these steps to obtain and use the token.

### Obtaining Your API Token:

1. **Access Developer Settings:** Open your web browser and navigate to [**Developer Settings**](https://web.clearfeed.app/settings/developer-settings).

<figure><img src="https://2719052266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5mcT5Ccv0HPFDCfXy7RC%2Fuploads%2Fgit-blob-de8c17816221b76d13d264ec07f481a89b483df9%2Fimage.png?alt=media" alt=""><figcaption><p>Personal Access Token section under Developer Settings</p></figcaption></figure>

2. **Generate New Token:** If you haven't generated an API token yet, simply click the `Generate Token` button. This will create a new token for your use.

<figure><img src="https://2719052266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5mcT5Ccv0HPFDCfXy7RC%2Fuploads%2Fgit-blob-499f38563fe1cbe93701b7c4db774ad059e27fb9%2Fimage.png?alt=media" alt=""><figcaption><p>Generated Token</p></figcaption></figure>

After generating the token, you can easily copy it and begin using it.

{% hint style="info" %}
Remember, it's crucial to keep your token secure and avoid sharing it. If you suspect any compromise, promptly revoke the token; you can always generate a new one from the same page.
{% endhint %}

3. **Encountering Error (403):** If you encounter an Error like this below while running any Endpoint with an Access Token, it means that the API token used for the request is associated with a user who is not a member of the connected Slack workspace. ClearFeed validates the user’s Slack profile for all ticketing operations.

```
{
  "message": "The authenticated user does not have a corresponding profile in the Slack workspace.",
  "error": "FORBIDDEN"
}
```

**Possible Causes:**

* The user whose API token was used has been removed from the Slack workspace.
* The user’s email/profile is not correctly mapped between Slack and ClearFeed.
* The API token is outdated or invalid.

**How to Resolve:**

1. Ensure the user is an active member of the connected Slack workspace.
2. If the user was removed or is inactive, generate a new **Personal Access Token** from ClearFeed:
   * Open the ClearFeed web app and go to [Developer Settings](https://web.clearfeed.app/settings/developer-settings).
   * Under **Personal Access Token**, click **Generate Token**.
   * Replace the old token in your API calls with the newly generated token.
3. Verify the user has appropriate roles (Agent/Responder) in ClearFeed.

### Using Your API Token:

Include the bearer token in the HTTP request's `Authorization` header for API access:

```vbnet
GET /v1/rest/endpoint
Host: api.clearfeed.app
Authorization: Bearer YOUR_TOKEN_HERE
```
