> ## 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.

# License keys

> Activate and validate license keys from your own software.

A license-key benefit issues a key to each buyer. Your desktop app, CLI or plugin checks it against SleetPay.

These three endpoints are **public**: no API key, because `organization_id` plus the secret `key` are the credentials. They are rate limited, and an unknown key and a key from another organization are indistinguishable (`404`).

```ts theme={null}
import { SleetPay } from "@sleetpay/sdk";

const app = new SleetPay(); // no apiKey

// First run on this machine: idempotent per label
const lic = await app.licenses.activate({ key, organizationId, label: hostname });

// Every launch
const check = await app.licenses.validate({ key, organizationId, activationId: lic.activation!.id });
if (check.status !== "granted") throw new Error(`License ${check.status}`);

// "Deactivate this machine"
await app.licenses.deactivate({ key, organizationId, activationId: lic.activation!.id });
```

| `status` | Meaning |
| - | - |
| `granted` | Usable |
| `revoked` | Refunded, canceled or revoked by you |
| `disabled` | Expired |

Activation answers `403` once `limit_activations` is reached or the key is revoked or expired. `activations_count` and `limit_activations` are on the license object.

Do not trust a cached "valid" forever: validate at launch and on a schedule, and decide how long to allow offline use.

## Server-side listing

With an API key that has `license_keys:read`: `sleetpay.licenseKeys.list({ customerId })`.

## Related

* [API reference](https://docs.sleetpay.com/api-reference/introduction.md)


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