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

# Authentication

> Authenticate to the StackOne Platform API with API keys and scopes.

The Platform API authenticates with a StackOne API key. [Generate one in the dashboard](/embed/api-keys).

## How requests authenticate

Every request uses two values:

* **`Authorization`**: Basic auth with your API key as the username, no password. Keys have the format `v1.{region}.xxxxx`.
* **`x-account-id`**: identifies the end user's linked account, for endpoints that act on a specific account's data.

Pass these when calling any endpoint, such as the [List Accounts endpoint](/platform/api-reference/v2/accounts/list-accounts).

An API key's scopes control which endpoints it can access. See [API Keys](/embed/api-keys#scopes) for the scope reference and key management.

### Encoding the Authorization header

The header value is base64 of `{api_key}:`, the key followed by a colon, since Basic auth expects a password half even when it is empty. `curl -u "$STACKONE_API_KEY:"` builds it for you. To encode it yourself:

<Tabs>
  <Tab title="macOS / Linux">
    ```bash theme={null}
    echo -n "{stackone_api_key}:" | base64
    ```
  </Tab>

  <Tab title="Windows (PowerShell)">
    ```powershell theme={null}
    [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("{stackone_api_key}:"))
    ```
  </Tab>

  <Tab title="Windows (Command Prompt)">
    ```cmd theme={null}
    powershell -Command "[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(\"{stackone_api_key}:\"))"
    ```
  </Tab>
</Tabs>


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