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

# Get your account_id

> Fetch your account_id and managed account IDs using the Accounts API with a bearer token.

## An account\_id is used in API request URLs.

Use the Accounts API to fetch your own account\_id and any managed accounts that you've created. You’ll need a bearer token from your client credentials first.

**1. Authenticate and get a bearer token**

Create client credentials in the Brale dashboard, then exchange them for a bearer token.

```bash theme={null}
curl --request POST \
  --url https://auth.brale.xyz/oauth2/token \
  --header 'Authorization: Basic ${BASE_64_OF(client_id:client_secret)}' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials
```

Response includes `access_token` and `token_type` (Bearer). Use `Authorization: Bearer ${access_token}` for subsequent calls.

**2. List your accounts**

Call `GET /accounts` with your bearer token to fetch account\_ids:

```bash theme={null}
curl --request GET \
  --url https://api.brale.xyz/accounts \
  --header "Authorization: Bearer ${ACCESS_TOKEN}"
```

Example response:

```json theme={null}
{
  "accounts": [
    "2Js1YFqlfxgNqC2KTPEjrWIwKU7",   // Your primary account_id
    "2VcUIIsgARwVbEGlIYbhg6fGG57"    // Managed client account_id (if applicable)
  ]
}
```

**3. Select the right account\_id for downstream calls**

* Use your primary account\_id for operations on your own balances and resources.
* If you manage client accounts (managed accounts), use the client’s account\_id in path parameters for downstream endpoints (e.g., transfers, addresses).
* Do not send account\_id in the request body or querystring—only in the path where required.

> [!TIP]
>
> If you only see one account\_id returned, that’s your primary account. Managed client accounts will appear in the same list once created.
