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

# API key and access

> Create a Bearer token and HMAC secret, verify your connection to the exchanger, check key permissions, and restrict source IPs for the integration.

To connect to Exchanger API, you need the exchanger's address, a Bearer token, and an HMAC secret. Sign in to your exchanger account to create the key. Your application sends the token and uses the secret to sign every private request.

## Create a key

1. Sign in to your exchanger account and open **Settings → API**. If the tab is missing, ask the operator to [enable API access for your account](https://exchanger-api.iexexchanger.com/en/guides/admin/api-keys.md).
2. Select **Create key** and save both credentials in your server's secret store.
3. Make your [first request](https://exchanger-api.iexexchanger.com/en/start/quickstart.md) on the exchanger's HTTPS origin. `GET /api/v3/ping` checks the address. `GET /api/v3/private/ping` verifies your token and [HMAC v2 signature](https://exchanger-api.iexexchanger.com/en/start/authentication.md) without an additional scope.

The **API** tab shows how many keys you have and when you can create another. The exchanger sets the limit and the waiting period between key creations.

![The API tab in the customer account with the Create key button](https://mintcdn.com/iexexchanger-api/-K5P3ShradX9ImPV/images/admin/create-api-key.png?fit=max\&auto=format\&n=-K5P3ShradX9ImPV\&q=85\&s=9df943ef266a47bce33ce1b4de1233b4)

Customer account, Settings → API (Russian interface)

[Open the screenshot of the API tab](https://exchanger-api.iexexchanger.com/images/admin/create-api-key.png)

In **New key created**, select **Copy token** and **Copy secret**. Save both values before refreshing the page.

> [accordion] Where to copy your token and HMAC secret
>
> ![The New key created section with fields for the Bearer token and HMAC secret and their copy buttons](https://mintcdn.com/iexexchanger-api/-K5P3ShradX9ImPV/images/admin/api-key-issued.png?fit=max\&auto=format\&n=-K5P3ShradX9ImPV\&q=85\&s=85a16dd2fe2a5172aa6d8cb42efcfafd)
>
> The example credentials are masked in this screenshot
>
> [Open the screenshot showing where to find the token and secret](https://exchanger-api.iexexchanger.com/images/admin/api-key-issued.png)

Use a public API key created in **Settings → API** for `/api/v3/private/*`. It consists of a Bearer token and a separate HMAC secret. If you have an older key that cannot be rotated, create a new public API key. Your sign-in credentials are for your exchanger account.

On a separate test installation, create a separate key and use that installation's HTTPS address. To check form data without creating an order on the connected exchanger, use the [simulation](https://exchanger-api.iexexchanger.com/en/api-reference/sandbox/post-private-sandbox-exchange-orders-simulate.md) with `public-api:sandbox:run`.

## Check permissions

A new key receives the exchanger's default scopes. Open each operation in the [API reference](https://exchanger-api.iexexchanger.com/en/api.md) and check its `x-required-scopes`. When the list has several scopes, any one of them is sufficient.

| What to check | Where to look |
| - | - |
| The scopes on your key | `GET /api/v3/private/client` returns `result.api_token.scopes`. If your key can use diagnostics, `GET /api/v3/private/health/client` returns `result.health.token.scopes`. |
| Which scope a request needs | In a `403 scope_denied` response, check `error.details.required_scopes`. |
| Which scopes exist | `GET /api/v3/private/scopes` returns the catalog in `result.scopes`. It requires `public-api:scopes:read` or the compatible `account` scope. |

Ask the operator to change the key's scopes if you need an additional operation. Share the key ID and the methods your application calls.

## Restrict source IP addresses

1. Open the key's settings and fill in **IP allow-list**. Enter your server or gateway's public outbound IPv4 or IPv6 address. CIDR ranges are supported.
2. Enter up to 25 entries, one per line. An empty list permits requests from any source IP that meets the other access requirements.
3. Call private ping from your integration server. On `403 ip_not_allowed`, compare `error.details.ip` with your allow-list. If the response instead gives `error.details.reason: "tor_access_denied"`, check the exchange’s access policy with the operator.

## Rotate or disable a key

If the key has a set expiration, it appears in `result.health.token.expires_at` in the signed `GET /api/v3/private/health/client` response. A `null` value means the key has no set expiration date. The API checks the account and key states on each request.

1. For a planned replacement, select **Rotate key** and save the new token and secret. The new key inherits the scopes and IP restrictions.
2. Replace both values in your application and verify private ping. The old key works until the rotation window ends or it expires, whichever comes first.
3. After switching credentials, turn off **Key enabled** for the old key or delete it. If the credentials are exposed, cut off access immediately. Ask an administrator to revoke the key permanently if needed.

When asking for help, share the key ID, request ID, and `error.code`. Keep the token and secret on the server and out of logs and browser code.


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