API keys & Bearer tokens
Bearer access for scripts and CI — apps, settings, bans, tiers, users, and the rest of the dashboard API.
What they are
Developer API keys look like sdk_live_…. They are full-account credentials: there are no scopes. A valid key authenticates as you on every requireAuth route — the same surfaces as the dashboard.
They do not authenticate client license validation or end-user register / login / upgrade. Those use the public client paths in License control.
Bearer coverage
With a Bearer token you can:
- Apps — create, list, get, delete (
DELETE /apps/:id),PATCH /apps/:id/settings(version, status, HWID lock,requireLicenseToRegister,responseMessages— custom text appears as sealed validatemessage, or as plaintexterror/ validatemessage; see API reference) - Bans —
GET /apps/:id/bans,DELETE /apps/:id/bans/:banId; ban viaPOST /licenses/:id/banwithscopelicense|hwid|hwid_and_ip - Licenses — create (optional
subscriptionTier, default0), blind create, delete, extend;POST/PATCH /licenses/:id/tierto set any integer tier ≥ 0;POST /licenses/:id/reset-hwidto clear the device binding (keeps status and expiry) - Users —
POST /apps/:id/users(create end-user; optionallicenseKey, still respectsrequireLicenseToRegister);GET /apps/:id/users(username, email, linked license, tier);POST /apps/:id/users/:userId/reset-hwidto clearlastHwidand unbind any linked license - Logs, metrics, account mask/mode/vault, API key CRUD,
/auth/me
Dashboard
Create, copy (once), list, and revoke keys under Settings → API keys. Plaintext is shown only at creation; afterward you only see a prefix and metadata (last_used_at, revoked).
HTTP: create, list, revoke
All require an existing session cookie or another API key.
{
"name": "ci-bot"
}{
"success": true,
"key": {
"id": "<uuid>",
"name": "ci-bot",
"apiKey": "sdk_live_…",
"keyPrefix": "sdk_live_abcd1234…",
"createdAt": "…"
},
"warning": "API key plaintext is shown once. Store it securely; only the hash is retained."
}{ "success": true, "keys": [ /* prefix + metadata only */ ] }{ "success": true }Using the Bearer header
Authorization: Bearer sdk_live_<token> Content-Type: application/json
curl -X POST https://api.sdkey.dev/api/v1/licenses/create \
-H 'Authorization: Bearer sdk_live_....' \
-H 'Content-Type: application/json' \
-d '{"applicationId":"<uuid>","amount":1,"durationSeconds":2592000,"subscriptionTier":1}'curl -X PATCH https://api.sdkey.dev/api/v1/apps/<appId>/settings \
-H 'Authorization: Bearer sdk_live_....' \
-H 'Content-Type: application/json' \
-d '{"hwidLockEnabled":true,"requireLicenseToRegister":true,"version":"1.0.1"}'curl -X DELETE https://api.sdkey.dev/api/v1/apps/<appId> \ -H 'Authorization: Bearer sdk_live_....'
curl -X POST https://api.sdkey.dev/api/v1/licenses/<licenseId>/ban \
-H 'Authorization: Bearer sdk_live_....' \
-H 'Content-Type: application/json' \
-d '{"scope":"hwid_and_ip"}'curl -X POST https://api.sdkey.dev/api/v1/licenses/<licenseId>/tier \
-H 'Authorization: Bearer sdk_live_....' \
-H 'Content-Type: application/json' \
-d '{"subscriptionTier":2}'curl -X POST https://api.sdkey.dev/api/v1/licenses/<licenseId>/reset-hwid \ -H 'Authorization: Bearer sdk_live_....'
curl -X POST https://api.sdkey.dev/api/v1/apps/<appId>/users \
-H 'Authorization: Bearer sdk_live_....' \
-H 'Content-Type: application/json' \
-d '{"username":"alice","password":"securepass","email":"[email protected]","licenseKey":"XXXX-...."}'curl -X POST https://api.sdkey.dev/api/v1/apps/<appId>/users/<userId>/reset-hwid \ -H 'Authorization: Bearer sdk_live_....'
curl 'https://api.sdkey.dev/api/v1/apps/<appId>/users?limit=50' \ -H 'Authorization: Bearer sdk_live_....'
curl https://api.sdkey.dev/api/v1/apps/ \ -H 'Authorization: Bearer sdk_live_....'
Auth resolution
If both a sdkey_session cookie and a Bearer token are present, the cookie wins. Failed Bearer attempts are rate-limited (30 / min / IP).
Security
- Server stores SHA-256 of the key only
- Copy the plaintext immediately — it cannot be recovered later
- Revoke immediately if a key leaks
- Prefer short-lived keys per environment (CI vs laptop)