Skip to main content
POST
Create a rule set
Creates a named, ordered container for rules. The key is immutable and unique within the program. Omit position to append. To choose its position, use first, last, before, or after. Relative placement requires reference_id. Every set with an applicable ACTIVE rule participates in evaluation. Set position controls execution priority only. The response includes the resulting rule_configuration_version.
See Rule sets for assignment and execution order.

Authorizations

Authorization
string
header
default:sk_...
required

Send your API key as Authorization: Bearer <key>.

Headers

Idempotency-Key
string

Unique key (1-255 printable ASCII characters) to make retries safe. Repeating the same request with the same key within 24 hours replays the original response (Idempotent-Replayed: true).

Maximum string length: 255

Path Parameters

program_id
string<uuid>
required

The program's id.

Body

application/json

Rule-set fields

Creates a rule set in a program.

key
string
required

Immutable program-scoped key. Must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, or underscores.

Minimum string length: 1
Example:

"holiday-promo"

name
string
required

Operator-facing display name.

Minimum string length: 1
Example:

"Holiday Promotion"

position
object

Where to place the rule set in the program. Omit position to add it at the end.

Response

Rule set created

A rule set: an ordered group of rules in a program.

created_at
string<date-time>

When this rule set was created.

Example:

"2027-01-15T10:30:00Z"

id
string<uuid>

The id of the rule set. Use it in rule_set_id fields and paths.

Example:

"d4735e3a-265e-4f16-b1a5-4c8e9d6f0a04"

key
string

Immutable program-scoped key.

Example:

"holiday-promo"

name
string

Operator-facing display name.

Example:

"Holiday Promotion"

order
integer

Execution position among participating sets; lower executes first. This does not control participation, stacking, replacement, or suppression.

Example:

1

program_id
string<uuid>

Program that owns this rule set.

Example:

"8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01"

rule_configuration_version
integer

Resulting program rule-configuration revision. Present on mutation responses.

Example:

4

updated_at
string<date-time>

When this rule set was last modified.

Example:

"2027-01-15T10:30:00Z"