Skip to content

Activate

POST /{tenantId}/{productId}/activate

Registers a new device instance for a license key and returns a signed lease. Call this the first time a customer enters their key. Uses the common headers & path parameters.

FieldTypeRequiredDescription
license_keystringyesThe raw key the customer pasted; normalized server-side
instance_namestringyesHuman-readable device label shown in the dashboard
free_tier_instance_idstringnoWhen converting from free tier, the prior anonymous instance id
app_versionstringnoTelemetry: your app version
sdk_versionstringnoTelemetry: the SDK version
platformstringnoTelemetry: the platform
Terminal window
curl -X POST https://api.keylight.dev/acme/notes/activate \
-H "Content-Type: application/json" \
-H "X-Keylight-SDK-Key: $KEYLIGHT_SDK_KEY" \
-d '{
"license_key": "ACME-XXXX-XXXX-XXXX-XXXX",
"instance_name": "MacBook Pro"
}'
{
"activated": true,
"instance_id": "5f7e7b9a-1c2d-4e3f-9a8b-7c6d5e4f3a2b",
"license_expires_at": null,
"lease": {
"kid": "k1",
"licenseKeyHash": "4e7a9c8b…",
"instanceId": "5f7e7b9a-1c2d-4e3f-9a8b-7c6d5e4f3a2b",
"issuedAt": 1713546000,
"expiresAt": 1714150800,
"status": "active",
"entitlements": ["pro"],
"signature": "MEQCIB…"
}
}
  • instance_id — Keylight-issued; store it and send it back on every validate/deactivate.
  • license_expires_at — unix seconds for a time-limited license, or null for perpetual.
  • Re-activating the same key from the same device returns the existing instance_id without consuming a new slot.

The lease object is detailed in Overview → Lease format.

StatusCondition
400Invalid JSON body
401Missing / invalid X-Keylight-SDK-Key
402Plan instance limit reached
403Tenant state or product does not allow activation
404Tenant / product / license key not found
422License revoked or expired; activation limit reached
429Quota exceeded (Retry-After header)
500Tenant not fully configured