API Contract
Use this page when you need the compatibility-sensitive behaviors that SDKs, automation, and external integrations should rely on.
Who This Is For
- SDK authors and maintainers
- developers building long-lived integrations
- AI agents that need stable behavioral rules beyond route discovery
When To Use This
Read this page when envelope shape, renewal rules, scope semantics, or runtime signature behavior matters more than feature walkthroughs.
Treat api/openapi.yaml as the schema and transport source of truth. Treat this page as the public explanation of the behaviors that should remain stable enough for generated clients and external integrations.
How It Works
Envelope rules
These response shapes are foundational:
- management success responses use
{data, meta} - runtime success responses use
{data, signature, meta} 204 No Contentroutes intentionally return no body- errors use
{error, meta}
Consumers should not flatten away the difference between management and runtime envelopes.
Scope disclosure
Management operations publish least-privilege requirements via x-required-scopes in api/openapi.yaml.
Important rules:
x-required-scopesis the minimum non-admin scope set for that operationadminsatisfies every management route403 TOKEN_SCOPE_DENIEDmeans the token did not satisfy that operation’s scope requirement
License origin linkage
License creation stores validated order_id and subscription_id links on the license record.
Behavior that matters:
- if
order_idis supplied and already linked to a subscription,subscription_idis inferred when omitted - order and subscription records must belong to the same product as the license
- if both are supplied, they must match each other
GET /api/v1/licensessupportsorder_id,subscription_id,expires_before, andexpires_afterfilters
Renewal semantics
Renewal rules are intentionally explicit:
- only
subscription,time_limited, andtriallicenses are renewable - renewals are idempotent per license plus
Idempotency-Key - provide exactly one of
expires_atorextend_by_days - renewal basis is the current stored expiry when still active, otherwise current server time
- renewals keep suspended licenses suspended
- renewal-time
order_idandsubscription_idare validated and written to audit metadata, but do not rewrite the license’s stored origin linkage
Order and subscription semantics
Orders and subscriptions are linked external records, not a billing engine.
Stable expectations:
- subscriptions require
current_period_startandcurrent_period_end current_period_endmust be aftercurrent_period_startcanceled_atis valid only when subscription status iscanceled- orders may omit
period_startandperiod_end, but if one is present the other must be too - the service stores periods as provided and does not apply provider-specific normalization or proration
Version eligibility
Runtime version checks depend on app_version.
Stable behavior:
- if
app_versionis omitted, no version gate is evaluated - if a product has no version catalog, version gating is not enforced
- once a product has any catalog entries, unknown app versions are rejected
- eligibility cutoff uses
maintenance_expires_atfor perpetual licenses andexpires_atfor non-perpetual licenses
Signing and public-key verification
Runtime activation, validation, check, consume, deactivate, and floating responses are signed.
Stable rules:
signaturecovers the JSON bytes ofdata- public verification keys are published at
GET /api/v1/system/public-keys - retired public keys remain published after rotation so older payloads can still be verified
- offline issuance returns an encrypted envelope whose decrypted inner payload must still be signature-verified
Example
This is the minimum contract shape an integration should preserve:
{
"data": {
"license_id": "lic_123",
"status": "active"
},
"signature": {
"kid": "sig_123",
"algorithm": "Ed25519",
"value": "base64..."
},
"meta": {
"request_id": "req_123"
}
}And this is the management-side scope rule an automation should follow:
operationId: createReportExport
x-required-scopes: ["report:export"]Common Mistakes
- treating
adminas the normal scope for all automation instead of a bootstrap escape hatch - assuming orders or subscriptions imply billing-engine behavior
- assuming renewals rewrite stored order/subscription linkage
- trusting runtime
databefore checking the signature - treating additive fields as breaking contract changes