Skip to main content
POST
Apply an atomic rule-configuration change set
Applies the changes from one preview. Send the preview_token and request_hash that the preview returned. The body cannot change what the preview planned. Rules and their proposed field and state definitions apply together, or none do. On success, rule_configuration_version increases by one. Only the caller who created the preview can apply it; anyone else receives 403 preview_token_mismatch. Create a new preview when this endpoint returns 409 because the preview expired or was already applied, the rule configuration changed after the preview, or a referenced resource is gone (such as an unlinked asset or a removed tier key).
See Preview and apply for reviewing and applying a configuration change.

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

The preview_token and request_hash from one preview

Commits a previewed rule configuration. Send the preview_token and request_hash from the same preview.

preview_token
string
required

The token from the preview. It works for the caller who created the preview, until its expires_at.

Minimum string length: 1
Example:

"ahSToYq-OEn3S2Q1-qOP7iebMf_xahN0KciKUSygcKs"

request_hash
string
required

The request hash from the same preview.

Required string length: 64
Pattern: ^[A-Fa-f0-9]{64}$
Example:

"3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b"

Response

The rule configuration after the change

The rule configuration after a preview was applied, and the id of the change.

change_id
string<uuid>

Applied preview/change identifier.

field_definitions
object[]

Fields to save with the rule change.

rule_configuration
object

Complete applied configuration at its new revision.

state_definitions
object[]

Counters and tags to save with the rule change.