Skip to content

Validate

POST /{tenantId}/{productId}/validate

Re-checks an activated instance and returns a fresh lease. The SDK calls this periodically and on launch. Uses the common headers & path parameters.

FieldTypeRequiredDescription
license_keystringyesThe license key
instance_idstringyesThe instance_id returned by activate
app_version / sdk_version / platformstringnoTelemetry
Terminal window
curl -X POST https://api.keylight.dev/acme/notes/validate \
-H "Content-Type: application/json" \
-H "X-Keylight-SDK-Key: $KEYLIGHT_SDK_KEY" \
-d '{
"license_key": "ACME-XXXX-XXXX-XXXX-XXXX",
"instance_id": "5f7e7b9a-1c2d-4e3f-9a8b-7c6d5e4f3a2b"
}'
{
"valid": true,
"license_expires_at": null,
"lease": { "kid": "k1", "status": "active", "entitlements": ["pro"], "...": "" }
}

A time-limited license past its expiry but configured to fall back (not hard-expire) returns 200 with valid: false and a lease whose status is "fallback".

A hard-expired license returns a signed expired lease so the SDK can update local state at once:

{
"valid": false,
"error": "License expired",
"lease": { "kid": "k1", "status": "expired", "...": "" }
}
StatusCondition
400Invalid JSON body
401Missing / invalid SDK key
403Tenant state blocks validation
404Tenant / product / license not found
422License revoked, or instance not found / deactivated
429Quota exceeded
500Tenant not fully configured

Suspended tenants can still validate by design — active apps keep rotating leases through the grace window so end users aren’t disrupted.