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

# Authentication

> Use bearer API keys for accessing the endpoints.

Protected operations accept a `UNIFI_API_KEY`:

```http theme={null}
Authorization: Bearer <credential>
```

**Q. How to obtain it?** \
**A.** Create a named key from the UniFi [web app](https://payunifi.com/app/api).

## API keys for server integrations

Create a named API key in the UniFi web app and store it in a server-side secret manager.

### Create a key in the web app

**1. Open API Keys**

Sign in, open the [API page](https://payunifi.com/app/api), and select **New API Key**. The Keys
tab shows the number of active keys allowed by the current plan.

![UniFi API Keys tab with no API keys and a New API Key action](https://mintcdn.com/test-ccbd1339/a7-7soYiK1kc9L9N/images/web-app/api_0_mobile.png?fit=max\&auto=format\&n=a7-7soYiK1kc9L9N\&q=85\&s=0d546dc099069a17b02223aca2c5a872)

Start from the empty Keys view.

![Create API key sheet asking for a unique key name](https://mintcdn.com/test-ccbd1339/a7-7soYiK1kc9L9N/images/web-app/api_1_create_api_key.png?fit=max\&auto=format\&n=a7-7soYiK1kc9L9N\&q=85\&s=f18b37939a33d14b90cdba6cffc0be5c)

Open the Create API key sheet.

**2. Name, create, and copy the key**

Enter a clear, unique name and select **Create key**. Creation uses the signed-in session and
does not require an additional authenticator check. UniFi then opens a **Shown once** sheet with
the key masked by default. Use **Copy key**, place the credential in your server-side secret
manager, and select **I've saved it** only after it is safely stored.

![Create API key sheet with marketplace entered as the key name](https://mintcdn.com/test-ccbd1339/a7-7soYiK1kc9L9N/images/web-app/api_2_set_name.png?fit=max\&auto=format\&n=a7-7soYiK1kc9L9N\&q=85\&s=fac5a3891c86718b613b7c4aafc2aca3)

Use a name that identifies the integration.

The secret is returned only by this creation request. UniFi stores a one-way hash and the Keys
table retains only the name, creation time, and revoke action. A lost key cannot be revealed;
revoke it and create a replacement.

**3. Monitor usage and revoke unused keys**

Use **Quota** to review the active plan, remaining credits, and renewal date. Delete a key when
an integration no longer needs it; deletion takes effect immediately.

![UniFi API Quota tab showing the active Free plan, remaining credits, and next renewal](https://mintcdn.com/test-ccbd1339/a7-7soYiK1kc9L9N/images/web-app/api_4_quota.png?fit=max\&auto=format\&n=a7-7soYiK1kc9L9N\&q=85\&s=3a3f1fad3b70878c4a6e286b50dde4f8)

Review plan and credit usage from Quota.

![Delete API key confirmation warning that applications using the key will lose access](https://mintcdn.com/test-ccbd1339/a7-7soYiK1kc9L9N/images/web-app/api_5_del.png?fit=max\&auto=format\&n=a7-7soYiK1kc9L9N\&q=85\&s=275eb5cec5be094b6774083a46f552a9)

Confirm before permanently revoking a key.

This is a sample curl API request for getting USDT balance on Ethereum.

```bash theme={null}
curl --request GET \
  --url https://api.payunifi.com/v1/wallet/onchain/balance/USER_ID/Ethereum/USDT \
  --header "Authorization: Bearer $UNIFI_API_KEY"
```

The credential must be authorized for the `user_id` in user-scoped routes. Never ship the key in
browser JavaScript, a public repository, a mobile binary, logs, or analytics events. Key-creation
responses use `Cache-Control: no-store`, and the same policy is preserved through the UniFi FEP.


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