---
title: "Get the complete rule configuration"
method: GET
path: "/v1/programs/{program_id}/rule-configuration"
tags: ["Rules"]
---

# Get the complete rule configuration

`GET /v1/programs/{program_id}/rule-configuration`

## Request

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

Return rule sets, ACTIVE and SUSPENDED rules, and rule budgets from one consistent read. Pass rule_configuration_version with reorder, move, preview, and rollback requests to reject conflicting edits. Archived rules are excluded.

## Path parameters

- `program_id` string, uuid, required

## Response `200`

The program's rule sets and rules, and the current rule_configuration_version

- RuleConfigurationResponse: A program's complete rule configuration and its version.
  - `program_id` string, uuid: Program whose configuration was read.
  - `rule_configuration_version` integer: Program rule-configuration version. Pass it to version-guarded writes to reject conflicting edits.
  - `rule_sets` RuleSetConfigurationResponse[]: Rule sets in execution order, each with its ACTIVE and SUSPENDED rules in local order.
    - `rule_set` RuleSetResponse: A rule set: an ordered group of rules in a program.
      - `created_at` string, date-time: When this rule set was created.
      - `id` string, uuid: The id of the rule set. Use it in `rule_set_id` fields and paths.
      - `key` string: Immutable program-scoped key.
      - `name` string: Operator-facing display name.
      - `order` integer: Execution position among participating sets; lower executes first. This does not control participation, stacking, replacement, or suppression.
      - `program_id` string, uuid: Program that owns this rule set.
      - `rule_configuration_version` integer: Resulting program rule-configuration revision. Present on mutation responses.
      - `updated_at` string, date-time: When this rule set was last modified.
    - `rules` RuleResponse[]: ACTIVE and SUSPENDED rules in execution order. Archived rules are excluded.
      - `actions` object[]: Actions to execute when the condition matches
      - `active_from` string, date-time: Start of the rule's active window (RFC 3339, null if always active). Checked against the event's event_timestamp, inclusive.
      - `active_to` string, date-time: End of the rule's active window (RFC 3339, null if no end date). Checked against the event's event_timestamp, exclusive.
      - `budgets` BudgetResponse[]: Budget constraints applied to this rule
        - `asset_id` string, uuid: Asset this budget constrains
        - `consumed` string: Amount credited in the current budget period. Returned only for PROGRAM budgets; PARTICIPANT usage differs for each recipient.
        - `cron_expression` string: Cron expression for CRON-based resets, evaluated in UTC (e.g., first of every month)
        - `interval` string: Duration for INTERVAL-based resets
        - `limit` string: Maximum allowed spend for this budget period (per participant for a PARTICIPANT budget)
        - `next_reset_at` string, date-time: Next scheduled reset. Omitted for lifetime budgets and PARTICIPANT budgets.
        - `schedule_type` 'CRON' | 'INTERVAL': How the budget resets. Omitted for lifetime budgets.
        - `scope` 'PROGRAM' | 'PARTICIPANT': Whether the limit caps all credits of this asset from the rule (PROGRAM) or each recipient's credits (PARTICIPANT).
      - `condition` string: CEL expression that determines when the rule fires
      - `created_at` string, date-time: When this rule was created (RFC 3339)
      - `deleted_at` string, date-time: When this rule was archived (null if not archived)
      - `description` string: Human-readable summary of what this rule does
      - `id` string, uuid: Unique identifier for this rule
      - `name` string: The name people see for the rule.
      - `order` integer: Evaluation position within the containing rule set (lower = first; ACTIVE and SUSPENDED rules occupy unique positions)
      - `program_id` string, uuid: Program this rule belongs to
      - `rule_configuration_version` integer: Resulting program rule-configuration revision. Present on mutation responses.
      - `rule_set_id` string, uuid: Rule set that contains this rule and scopes its order and stop_after_match behavior
      - `status` 'ACTIVE' | 'SUSPENDED' | 'ARCHIVED': The rule's lifecycle state.
      - `stop_after_match` boolean: When true, no subsequent rules in this set evaluate after this one matches; other sets continue
      - `updated_at` string, date-time: When this rule was last modified (RFC 3339)
      - `warnings` RuleWarning[]: Non-blocking advisories about the rule's condition or action expressions, such as unknown state-key typos or deprecated CEL aliases. Present on create/update only; never blocks the save.
        - `client_ref` string: The `client_ref` of the rule, when the rule is new.
        - `code` string: What the warning is about. On a rule: `unknown_state_key` (a key no rule writes), `deprecated_alias`, or `possible_unmarked_expression` (a literal that looks like CEL without `${{ }}`). On a simulation: `missing_participant_context`. On a configuration preview, also `stop_after_match_has_no_following_rule`, `unconditional_stop_shadows_following_rules`, or `later_rule_set_retained_empty`.
        - `key` string: The referenced key, as written in the condition.
        - `kind` string: Kind of reference: `counter`, `tag`, `attribute`, or `alias`.
        - `message` string: Human-readable explanation (includes the suggestion when one exists).
        - `rule_id` string: Rule identity is populated for complete-configuration validation. The single-rule authoring surfaces omit these fields.
        - `rule_set_id` string: The id of the rule set that holds the rule.
        - `scope` string: Where the referenced state belongs: `participant`, `program`, or `group`.
        - `suggestion` string: Closest known key, when a near-match exists. Empty otherwise.

## Other responses

- `400`: program_id is not a UUID (code: validation_error)
- `401`: The API key is missing or not valid. See [Authentication](https://docs.scrip.dev/authentication).
- `404`: Program not found (code: program_not_found)
- `429`: Too many requests. Wait the number of seconds in the `Retry-After` header, then retry. See [Limits and durations](https://docs.scrip.dev/limits#rate-limits).
- `500`: Something failed on Scrip's side. Retry the request, and quote `request_id` if it keeps failing. [Errors](https://docs.scrip.dev/errors) lists every code, and the [API introduction](https://docs.scrip.dev/api-reference/introduction) describes the error format.

---

[API](https://skmtc.dev/scrip/apis/scrip-api.md) · [All operations](https://skmtc.dev/scrip/apis/scrip-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scrip/apis/scrip-api/revisions/c52d35da8d97?raw)
