Rule Sets

Create a rule set

Create a named rule set. Omit position to append, or use first/last/before/after placement. Positions are renumbered to 1..N with no gaps. All sets containing applicable ACTIVE rules participate; position controls execution priority only. The response includes the resulting rule_configuration_version.

post/v1/programs/{program_id}/rule-sets

Request

  • Base URL: https://api.scrip.dev
  • URL: https://api.scrip.dev/v1/programs/{program_id}/rule-sets
  • Auth: HTTP bearer

Path parameters

program_idstring uuid required

The program's id.

Headers

Idempotency-Keystring

A key you choose to make this request safe to retry: 1 to 255 printable ASCII characters. Send the same key with the same request to get the first response again, marked Idempotent-Replayed: true. Routes that return a secret once, and claim links, do not replay a response. Event ingest uses the key as the event's identity.

Request body

keystring required

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

namestring required

Operator-facing display name.

Example request

{
  "key": "holiday-promo",
  "name": "Holiday Promotion",
  "position": {
    "placement": "before",
    "reference_id": "c9f0f895-fb98-4b39-9f86-1e5a0d3e2b04"
  }
}

Response

Rule set created

created_atstring date-time

When this rule set was created.

idstring uuid

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

keystring

Immutable program-scoped key.

namestring

Operator-facing display name.

orderinteger

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

program_idstring uuid

Program that owns this rule set.

rule_configuration_versioninteger

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

updated_atstring date-time

When this rule set was last modified.

Example response

{
  "created_at": "2027-01-15T10:30:00Z",
  "id": "d4735e3a-265e-4f16-b1a5-4c8e9d6f0a04",
  "key": "holiday-promo",
  "name": "Holiday Promotion",
  "order": 1,
  "program_id": "8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01",
  "rule_configuration_version": 4,
  "updated_at": "2027-01-15T10:30:00Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.