ACTIVE for that context.
Lifecycle
- Activate (
POST /api/admin/rulesets/{id}/activate) transitions aDRAFTtoACTIVEand automatically moves the previous active ruleset for that context toINACTIVE. - Rollback (
POST /api/admin/rulesets/{id}/rollback) reactivates anINACTIVEruleset, reverting to a known-good configuration.
The single-active-per-context guarantee is enforced, so two rulesets can
never be active for the same context simultaneously.
Contexts
Contexts let you run different rule strategies for different flows — for examplecheckout, subscription, or
default. The decision request’s context field selects which active ruleset applies. If a request names a
context that has no active ruleset, Specter falls back to the active ruleset for the default context. If
neither exists, no rules are evaluated and the decision is ALLOW.
Editing
Because onlyDRAFT rulesets are editable, the safe change workflow is:
1
Create a draft
POST /api/admin/rulesets (scope admin:rulesets:create) with your rules.2
Refine
PATCH /api/admin/rulesets/{id} (scope admin:rulesets:write) to adjust
the draft.3
Activate
POST /api/admin/rulesets/{id}/activate to make it live. The previous
active ruleset becomes inactive.4
Roll back if needed
POST /api/admin/rulesets/{id}/rollback to reactivate the previous ruleset.Related
Rule engine
The rule types and evaluation model inside a ruleset.