> For the complete documentation index, see [llms.txt](https://help.bioinsight.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.bioinsight.illumina.com/connected-analytics/api-access/getting-started/api-authentication.md).

# API Authentication

## **Authentication Methods**

To get the **Swagger API reference page** or your **examples** to work with your Platform Core instance, you need to authenticate the API calls by means of an **authorization token** (JSON Web Token). This is a standardized trusted token containing authentication context. This mechanism helps prevent unauthorized access to projects, analyses, pipelines, and data across ICA accounts. A JWT is generated by providing user credentials (API Key or username/password) to the token creation endpoint.

* **API key** (ApiKeyAuth) is the simplest credential type. This is a long-lived key which is used to obtain a JSON Web Token. API Keys operate similar to a user name and password combination and must be **kept secure** and **rotated on a regular basis.** You can have **up to 10 API keys per user** and manage them through the product dashboard after logging in through the [domain login URL](https://ilmn.login.illumina.com/platform-home/#/home). See[ Managing API Keys](https://help.connected.illumina.com/account-management/platform-home#manage-api-keys) for more information.
* **Username and password** (basicAuth) can be used for the POST tokens endpoint to exchange your user credentials for a JWT token. If you use this method, the credentials are sent to the token-generating endpoint which will return a JSON Web Token the returned JWT Token should then be used for subsequent API calls.
* The **JWT bearer token** (JwtAuth) is the preferred authentication method. The JWT **will expire** after a pre-configured period specified by a tenant administrator through the IAM console in the Illumina portal. If the token was generated by using a username and password then it **can be refreshed** using the POST /tokens:refresh endpoint as long as it has not expired.
* **Appt-to-app tokens** (PsTokenAuth) are only supported by the /data:transferOwnership endpoint

## Authenticating for Examples

In the [examples](/connected-analytics/api-access/getting-started/api-introduction.md) you will encounter in the next chapters, we will use API keys as authentication method. This is a simple authentication method, though the JWT bearer token is more secure due to the shorter lifespan. **To generate an API key, refer to** [**this**](https://help.connected.illumina.com/account-management/platform-home#api-keys) **section.** This key is then used in your Python code to authenticate the API calls. **It is best practice to regularly update your API keys.**

API keys are valid for a single user, so any information you request is for that user to which the key belongs. Create a dedicated API user so you can manage the access rights for the API by managing those user rights.

## API Key Security

{% hint style="warning" %}
Once the API key generation window is closed, the key contents will not be accessible through the domain login page, so be sure to store it securely for future reference.
{% endhint %}

{% hint style="warning" %}
For security reasons, **never use accounts with administrator level access** to generate API keys. Create a specific CLI user with basic permissions instead. This will minimize the possible impact of compromised keys.
{% endhint %}

{% hint style="danger" %}
When **keys are compromised or no longer in use, they must be revoked**. This is done through the [domain login URL](https://ilmn.login.illumina.com/platform-home/#/home) by navigating to the User menu item on the left and selecting "API Keys", followed by selecting the key and using the trash icon next to it.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.bioinsight.illumina.com/connected-analytics/api-access/getting-started/api-authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
