Skip to main content
POST
Validate a CEL condition
Checks whether a CEL expression is valid without creating a rule. Returns a valid boolean and a message with details. Pass an optional program_id to validate references against a specific program: tier keys and asset symbols in the expression are checked against that program’s configuration, and the response includes non-blocking vocabulary warnings. Pass an optional draft actions array to run the same checks on action expressions (template syntax, CEL compilation, references) before creating the rule. Field references to event.* are not validated because events are schemaless. For example, event.amount > 100 passes even if your events never include an amount field. Use Simulate a draft rule to test a draft rule against sample data.
For usage patterns and examples, see the Writing rules guide.

Authorizations

Authorization
string
header
default:sk_...
required

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

Body

application/json

Condition to validate

A rule condition and actions to check for errors without saving them.

condition
string
required

CEL expression to validate

Minimum string length: 1
Example:

"event.type == 'purchase' && event.amount > 100"

actions
Rule action (draft) · object[]

Optional draft actions to validate alongside the condition.

program_id
string<uuid>

Optional program ID to validate tier keys, asset compatibility, and unknown state-key warnings against.

Example:

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

rule_id
string<uuid>

Optional ID of the existing rule being edited (excludes its prior state keys when checking for unknown-key warnings).

Example:

"c9f0f895-fb98-4b39-9f86-1e5a0d3e2b03"

Response

Validation result

Whether a condition and its actions are valid, with any warnings.

message
string

Human-readable validation result or error detail

Example:

"CEL condition is valid"

note
string

Additional context about validation scope (present only on success)

Example:

"Validation checks syntax only. Field references are not verified against an event schema."

valid
boolean

Whether the condition is syntactically valid

Example:

true

warnings
object[]

Advisories that never affect validity, such as a counter, tag or attribute key that no rule in the program writes (likely a typo), an event field that no recent event has (sent with a program_id), or a deprecated CEL alias.