Skip to content

API overview ​

Base URLhttps://api.sunlicense.com
FormatJSON over HTTPS
VersioningIn the path (/api/v1/…); /api/v2/license/validate is the SDK endpoint

Authentication ​

There are three kinds of credentials, for different jobs:

CredentialWhere you get itWorks on
API key (slk_…)Dashboard → API keysValidation API only. Safe to ship inside your app: it cannot read or change licenses
Session token (JWT)POST /api/v1/auth/loginManagement API, with the permissions of your role. Lasts 12 hours
Personal access token (slp_…)Dashboard → Settings → Personal access tokensManagement API, acting as you but only with the scopes you gave it. Lasts until it expires (7 days to a year, or never) or you revoke it. For scripts, CI and AI assistants
Guest token (slp_…)POST /api/v1/auth/guest, no account needed (guest accounts)A personal access token of a new organization's Owner with every permission, for coding agents. Keeps working after the organization is claimed

Send any of them as Authorization: Bearer <token>.

Personal access tokens ​

A personal access token acts as the member who created it, limited to its scopes (the same permissions roles are made of). A route works only if both your current role and the token allow it, so demoting or disabling a member limits or stops their tokens too.

  • A token missing a route's scope gets 403 with code: "missing_scope".
  • Tokens can't manage tokens, change your password, link Discord or reach the admin console; those answer 403 with code: "access_token_not_allowed". Sign in for them.
  • A revoked token stops working within 30 seconds. Unknown, expired and revoked tokens get 401.
  • We store only a hash: the token is shown once, when you create it. Keep it out of code and screenshots.
  • A guest account's token may also ask for its claim link and dashboard sign-in link; until the account is claimed, anything outbound or hosted answers 403 with code: "guest_unclaimed".

Errors ​

Errors use RFC 9457 problem details:

json
{ "type": "about:blank", "title": "Forbidden", "status": 403, "detail": "Your Free plan allows 1 products. Upgrade to add more." }
StatusMeaning
400Invalid request (on /api/v2/license/validate: license rejected)
401Missing, invalid or expired credentials
403Your role lacks the permission, or your plan does not include it
404Not found (also for resources that belong to another organization)
409Conflict, for example reinstating a revoked license
429Rate limited: 20 requests/second, bursts of 40, per API key on the license routes and per IP address everywhere else (and for API keys that don't exist)
503Temporarily unavailable; use the offline license

Health ​

GET /api/v1/system/health (no authentication) returns each component's status. The public status page is status.sunlicense.com.

GET /api/v1/system/status (no authentication) returns what the status page reports: an overall state (operational, degraded, outage or unknown) and, per group, each service's status (up, down, pending, maintenance), 24-hour uptime (uptime24h, a fraction) and last check. It is read from the status page and cached for a minute; stale: true means the status page couldn't be reached and this is its last answer.

Send feedback

Found something broken, or have an idea? It goes straight to our board.

The first line becomes the title.
Images (optional, up to 5: paste, drop or capture)
Check each image before sending, and remove any that show something private.

We also receive this page's address and your browser version.

Ctrl Enter to send