# Authentication

The API supports authentication via `ApiKey` (Strongly Recommended) `HTTPBasic` (Up for deprecation), `TokenAuth` (Up for Deprecation). Except for the `/get_token` (up for deprecation) endpoint, which only supports HTTP Basic authentication.

* `ApiKey` (**Strongly Recommended**) authentication allows you to use API keys generated in your Cloud Profile. This method is the only one that will work in all cases whether your user is part of more than one organizations, or whether your organization uses Single Sign-On (SSO) authentication. Provide your API Key ID and API Key Secret as `X-API-KEY-ID` and `X-API-KEY-SECRET` headers, respectively. If you do not know how to generate your API Key and Secret pair follow the [Configure and run Soda Library](https://docs.soda.io/soda-library/configure.html#configure-and-run-soda-library) instructions.
* `HTTPBasic` **(Up for deprecation)** authentication requires you to provide your username and password as a Base64 encoded `Authorization` header. Send your HTTP requests with an `Authorization` header that contains the word `Basic` followed by a space and a base64-encoded string `username:password`.
* `TokenAuth` **(Up for deprecation)** requires that you obtain a Soda token from the `/get_token` endpoint using your username and password in accordance with the HTTPBasic Authentication framework. This token has an expiration of 30 minutes. The `/get_token` endpoint makes this clear to you (see endpoint documentation below). You can then use this token to authenticate with any of the other endpoints.


---

# Agent Instructions: 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:

```
GET https://docs.soda.io/soda-documentation/soda-v3/reporting-api-v1/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
