Skip to main content
See also: Qualification Rules concept and configuration for what this API powers, when to call it, and how it is configured.
Qualification rules define conditions that offers must satisfy before they can be recommended to a customer. Rules are evaluated during the qualification stage of a Decision Flow and can be scoped globally or to a specific segment, channel, category, sub-category, offer, or placement.
See the Qualification Rules feature page for UI guidance and conceptual overview.

Base path


List qualification rules

Returns a paginated list of qualification rules, ordered by priority (highest first), then creation date (newest first).

Query parameters

Each row in the response is enriched with a decisioningStage field — the classified stage (one of eligibility, fit, match, ranking) — so the UI can render the three-section layout without re-running the classifier client-side. Legacy stage values (qualificationeligibility, applicabilityfit, suitabilitymatch) are mapped automatically.

Response 200


Create a qualification rule

Creates a new qualification rule. Requires the admin role.

Request body

Rule types and config schemas

Each ruleType validates against a typed config schema at the API boundary — misspelled or missing required fields are rejected with 400. Every rule type’s config additionally accepts an optional onMissing field ("skip" | "block", default "skip") controlling the missing-data path: "skip" fail-opens (rule skipped, warning recorded in the decision trace); "block" fail-closes (candidate rejected with Required attribute "<attr>" not present). See Missing data: onMissing.

Example request

Response 201

Returns the created qualification rule object.

Validation

All fields are validated via Zod schemas (CreateQualificationRuleSchema is a discriminated union on ruleType):
  • name: 1-255 characters, must be unique per tenant.
  • ruleType: Must be one of the six enum values; config is then validated against the typed schema for that variant. attribute_condition (reads a customer attribute) and offer_attribute (reads an offer field) share an identical operator set, including not_in, contains, and not_contains (the negation of contains — true when a list attribute does not include the value, e.g. customer.opt_outs not_contains "all").
  • in / not_in require an array value. These operators evaluate array membership, so a scalar ("value": "gold" instead of ["gold"]) silently turns the gate into a no-op — not_in would then pass every candidate and in would block every candidate, the opposite of the author’s intent. The API rejects a scalar value for these two operators with 400 and a message naming the failure. Use ["gold","platinum"].
  • scope: Must be one of the eight enum values (global, segment, channel, category, subcategory, offer, creative, placement).
  • priority: Integer, 0-100.
  • stage: Must be eligibility, fit, match, or ranking.

Error codes


Update a qualification rule

Updates an existing qualification rule. Only provided fields are changed. Requires the admin role.

Request body

All fields from the create schema are accepted as optional, plus:

Example request

Response 200

Returns the updated qualification rule object.

Delete a qualification rule

Soft-deletes a qualification rule by ID. The record is marked as deleted but retained in the database for audit purposes. The response includes warnings if the rule is still referenced by any Decision Flow’s draftConfig.

Query parameters

Response 200

This endpoint uses soft-delete — the record is not physically removed from the database. It is excluded from GET results by default. To include soft-deleted records, pass ?includeDeleted=true on the GET request.
Unlike most DELETE endpoints that return 204, this endpoint returns 200 with a body so it can communicate ghost-reference warnings. The API checks all Decision Flows in the tenant for references to this rule ID in their draftConfig.stages.filter.qualificationRuleIds array.

Error codes


Role requirements


Soft-delete and audit

Qualification rules use soft-delete with audit snapshots. When a rule is deleted:
  1. The deletedAt timestamp is set (record is retained).
  2. An audit snapshot is captured with the full state before deletion.
  3. Ghost reference warnings are returned if the rule is still referenced by any Decision Flow.
Updates also create audit snapshots via auditedUpdate, incrementing the version field on each change. This provides a full change history for compliance and debugging. To include soft-deleted rules in GET responses, add ?includeDeleted=true to the query string.
Multi-scope rules are evaluated differently: global-scoped rules are evaluated in the Decision Flow’s Qualify node, while entity-scoped rules (offer, category, channel, creative) are automatically evaluated per-candidate during the recommend pipeline.

Decisioning Gates

Learn more about configuring decisioning gates in the platform UI.