Skip to main content
POST
/
v1
/
rules
/
validate
Validate a CEL condition
curl --request POST \
  --url https://api.scrip.dev/v1/rules/validate \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data @- <<EOF
{
  "condition": "event.type == 'purchase' && event.amount > 100"
}
EOF
{
  "message": "CEL condition is valid",
  "note": "Validation checks syntax only. Field references are not verified against an event schema.",
  "valid": true
}

Documentation Index

Fetch the complete documentation index at: https://docs.scrip.dev/llms.txt

Use this file to discover all available pages before exploring further.

Checks whether a CEL expression is syntactically valid without creating a rule. Pass the condition string in the request body. The response returns a valid boolean and a message with details. This endpoint only validates syntax. It does not verify that field references correspond to actual data in your events or participant state. For example, event.amount > 100 will pass validation even if your events never include an amount field. Use the simulate endpoint to test a rule against realistic data.
For usage patterns and examples, see the Writing Rules guide.

Authorizations

X-API-Key
string
header
required

API key passed in the X-API-Key header.

Body

application/json

Condition to validate

condition
string
required

CEL expression to validate

Minimum string length: 1
Example:

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

Response

Validation result

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