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

# Authentication

There are two methods for making an authenticated request to the Immuta API. Select a tab below for instructions.

{% tabs %}
{% tab title="API key method" %}

1. Generate your API key on the **API Keys** tab on your profile page and save the API key somewhere secure.
2. You will pass this API key in the authorization header when you make a request, as illustrated in the example below:

   ```bash
   curl \
       --request GET \
       --header "Content-Type: application/json" \
       --header "Authorization: 846e9e43c86a4ct1be14290d95127d13f" \
       https://your-immuta-url.immuta.com/data/connection/123456789
   ```

{% endtab %}

{% tab title="Bearer token method" %}

1. Generate your API key on the **API Keys** tab on your profile page and save the API key somewhere secure.
2. Pass this API key in the authorization header and make the following request to the `authentication` endpoint:

   ```bash
   curl \
       --request POST \
       --header "Content-Type: application/json" \
       https://your-immuta-url.immuta.com/bim/apikey/authenticate \
       -d '{ "apikey": "YOUR_API_KEY" }'
   ```
3. You will receive a response that includes your bearer token. Pass that bearer token in the authorization header when you make a request, as illustrated in the example below:

   ```bash
   curl \
       --request GET \
       --header "Content-Type: application/json" \
       --header "Authorization: Bearer dea464c07bd07300095caa8" \
       https://demo.immuta.com/data/connection/123456789
   ```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.immuta.com/latest/developer-guides/api-intro/authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
