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

# Authentication

This page explains the authentication process required to make a call to any endpoint.

The GEM REST API uses Bearer token authentication to securely identify and authorize requests.

Every API request must include a valid API key in the `Authorization` HTTP header.

### Authorization Header

Include your API key using the following format:

```
Authorization: Bearer {your_api_key}
```

Replace `{your_api_key}` with the REST API access key generated in GEM-SUITE.

### Generating Your API Key

API keys are generated and managed directly within **GEM-SUITE**. Each key is associated with a specific user account and inherits that user's permissions.

To locate your API key, follow these steps:

1. Log in to **GEM-SUITE** using an administrator account or an account with permission to manage user access.
2. Click your name in the top-right corner of the home screen.
3. Select **Actif account management** (or **Users management** if you are not logged in as an administrator).
4. Navigate to the **Users** tab.
5. Select the user account you want to associate with your API requests.
6. Locate the **REST API access key** field to retrieve the key associated with that user.

You can now use this key to authenticate your API requests.

### API Access and User Permissions

**Important: Your API key does not automatically grant access to every API endpoint.**

Each API key is directly linked to a specific GEM-SUITE user. The endpoints you can access and the operations you can perform depend entirely on the permissions assigned to that user.

This means:

* **Endpoint availability:** You can only access API endpoints for which the associated user has the required permissions.
* **Read and write permissions:** The ability to retrieve, create, update, or delete data depends on the user's access rights.
* **Role-based restrictions:** Any restrictions applied to the user's role also apply to requests authenticated with their API key.
* **User identity:** API operations are performed using the permissions and identity of the user associated with the key.

**Example**

If you generate an API key associated with a user who can view transactions but cannot create them:

* Requests to retrieve transactions may be allowed.
* Requests to the `create_transaction` endpoint will be denied.

Even if your API key is valid, a request may fail if the associated user does not have sufficient permissions.

**When choosing which user to associate with your API key, make sure that user has access to all the features and operations required by your integration.**

### Security Recommendations

Treat your API key as a confidential credential, just like a password.

* Never expose your API key in publicly accessible code or repositories.
* Store API keys securely using environment variables or a secrets manager.
* Only associate API keys with users who have the permissions necessary for the integration.
* Avoid using accounts with unrestricted administrative privileges unless absolutely necessary.

### Next Steps

Once you have retrieved your API key and verified the associated user's permissions, explore the **Resources** section to discover the available endpoints and begin integrating with the GEM API.
