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

# Authentication

> API keys, scopes, OAuth tokens and customer session tokens.

Every request to `/api/v1` carries a bearer token:

```
Authorization: Bearer sk_live_...
```

There are three kinds of credential. Pick the narrowest one that works.

| Credential | Use it for | Lasts |
| - | - | - |
| **Organization access token** (`sk_live_...`) | Your own backend talking to your own account | Until it expires or you revoke it |
| **OAuth access token** | An app that acts for *other* merchants' accounts. See [OAuth apps](https://docs.sleetpay.com/guides/oauth.md) | 1 hour (refreshable) |
| **Customer session token** (`mor_cst_...`) | Sending one customer into their portal, already signed in. See [Customer portal](https://docs.sleetpay.com/guides/portal.md) | 1 hour |

## Scopes

Each API key carries explicit scopes and an optional expiry. A request that needs a scope the key lacks answers `403`; an expired or revoked key answers `401`. Create keys in **Dashboard > API keys** and tick only what the server needs.

| Scope | Allows |
| - | - |
| `products:read` | List products and prices |
| `checkouts:write`, `checkouts:read` | Create and read checkouts |
| `customers:write`, `customers:read` | Create customers, read customers and their entitlements |
| `orders:read` | List orders |
| `subscriptions:read`, `subscriptions:write` | Read subscriptions; cancel, pause, resume, change seats, revoke |
| `seats:read`, `seats:write` | Read, assign and revoke seats |
| `license_keys:read` | List license keys |
| `customer_sessions:write` | Mint customer portal sessions |
| `events:write`, `meters:read`, `balance:read` | Usage ingestion and balances |
| `credits:write` | Transfer prepaid credits between customers |

> [!WARNING]
>
> **Legacy keys**
>
> Keys created before scopes existed show as "legacy" in the dashboard and keep only `events:write`, `meters:read` and `balance:read`. They never silently gain new powers.

## Keep keys safe

* Server-side only. Anything in a browser bundle or mobile app is public.
* One key per service, scoped to that service.
* Rotate by creating the new key, deploying it, then revoking the old one.
* Load keys from environment variables or your secret manager, never from source control.

## Public endpoints

License key validation, activation and deactivation take no API key: the `organization_id` plus the secret license `key` are the credentials, so they are safe to call from your customers' software. See [License keys](https://docs.sleetpay.com/guides/license-keys.md).


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