Authorize
Scope
This page defines authorize-time admission behavior and lease issuance rules.
Inputs and prerequisites
- Realm and billing account context must be present.
Idempotency-Keyis required.- Caller identity subject is required.
feature_codemust be a valid identifier.estimated_quantity_minoris optional and must be non-negative when provided.
Decision sequence
- Enforce seat constraints (when seat features are configured).
- Resolve feature and feature family.
- Enforce entitlement for the feature/family.
- Resolve active policy windows for the current bundle.
- Evaluate quota/rate admission.
- Evaluate budget/funding feasibility in prepaid mode.
- Issue lease and return lease token + window bounds.
Lease issuance rules
- A lease is issued only if feature is active, entitlement allows access, and at least one quota window exists for the feature.
- Unknown features may be auto-registered when auto-registry is enabled; otherwise authorize rejects unknown features.
- Lease metadata carries:
- feature and feature family
- quota/rate window metadata
- optional labels and seat id
- hint snapshot for replay consistency
- Lease TTL follows the deployment policy for gate session duration.
Idempotency behavior
- Reusing the same key with the same request hash returns the existing lease response.
- Reusing the same key with a different request hash returns conflict (
409).
Budget and funding semantics
- If caller provides
budget_id, authorize evaluates current budget headroom snapshot. - In prepaid mode, insufficient grant coverage or budget coverage is surfaced via hints and may block with
402depending on condition. - Funding and budget hints are muted in non-prepaid billing modes.
Hint semantics at authorize
Common hint families:
quota.remainingrate.limitfunding.xusd_shortfallbudget.shortfallpricing.not_configuredpricing.meter_price_missingpricing.contract_term_invalid
Recommended handling for these hints is documented in Hints and failure semantics.
Failure semantics
400: missing required transport input (for example idempotency key).401: missing auth context.402: blocked by quota/budget/funding policy.403: entitlement denied/required.409: idempotency conflict.422: invalid input or missing feature policy configuration.429: rate limit rejection.
Verify checklist
- Same idempotency key + same payload returns the same lease.
- Changing payload under same idempotency key returns
409. - Denied entitlement never returns an active lease token.
- Quota/rate/funding hints match expected account state.