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

# Authentication APIs

> APIs for client authentication and token management

![Flabs Logo Light](https://mintcdn.com/flabs/XMaScWewdN3WnYoT/logo/light.svg?fit=max\&auto=format\&n=XMaScWewdN3WnYoT\&q=85\&s=76bd6efd710b5d3a6017da1d7b459ed2)

## Overview

Flabs authentication APIs allow you to securely authenticate clients and manage tokens for API access.

> [card] [Generate Token](https://developer.flabslis.com/auth/endpoint/get_auth_token.md)
>
> Get auth tokens using client credentials

> [card] [Refresh Token](https://developer.flabslis.com/auth/endpoint/get_auth_token_refresh.md)
>
> Refresh your auth token when it expires

## Authentication Flow

Our authentication system uses a two-token approach with a streamlined flow designed for security and efficiency:

![Authentication Flow Diagram](https://mintcdn.com/flabs/XMaScWewdN3WnYoT/images/auth-flow.png?fit=max\&auto=format\&n=XMaScWewdN3WnYoT\&q=85\&s=909625228ce4fbffc18d5a76d875e8fc)

### Flow Breakdown

1. **Initial Authentication**: Use your Client ID and Client Secret to generate both an access token and refresh token
2. **Token Storage**: Store the refresh token securely in cache for future use
3. **API Access**: Use the access token (valid for 10 minutes) for all API requests
4. **Token Refresh**: When the access token expires, use the refresh token to generate a new access token without re-authentication
5. **Refresh Token Longevity**: The refresh token remains valid for 30 days of inactivity, eliminating the need for frequent re-authentication

### Key Benefits

* **Access Token**: Valid for 10 minutes, used for API requests
* **Refresh Token**: Expires after 30 days of inactivity; used to obtain new authentication tokens
* **Seamless Experience**: No need to repeatedly provide credentials once authenticated

> [!NOTE]
>
> All authentication tokens should be included in the Authorization header using
> the Bearer scheme.

## Getting Started

To integrate with our authentication system:

1. Obtain client credentials (Client ID and Client Secret)
2. Generate an initial auth token using the [token endpoint](https://developer.flabslis.com/auth/endpoint/get_auth_token.md)
3. Store both tokens securely
4. When the auth token expires, use the [refresh endpoint](https://developer.flabslis.com/auth/endpoint/get_auth_token_refresh.md) to get the auth token again with logging again.


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