Skip to main content

Validation Rules API

The Validation Rules API manages reusable input validation rules for epilot journeys and entity attributes.

Quick Startโ€‹

# List available operations
epilot validation-rules

# Call an operation
epilot validation-rules getValidationRules

Common Flagsโ€‹

FlagDescription
-p key=valueSet a named parameter
-d '{...}'Request body JSON
-H 'Key: Value'Custom header
-t, --token <token>Bearer token for authentication
--profile <name>Use a named profile
-s, --server <url>Override server base URL
-i, --includeInclude response headers in output
--jsonOutput raw JSON (no formatting)
-v, --verboseVerbose output (show request details)
--jsonata <expr>JSONata expression to transform response
--definition <file>Override OpenAPI spec file/URL
--guidedPrompt for all parameters interactively
--no-interactiveDisable interactive prompts

Operationsโ€‹

Validation Rules

  • getValidationRules โ€” Returns all validation rules belonging to the authenticated user's organization.
  • createValidationRule โ€” Creates a new validation rule for the authenticated organization.
  • getValidationRuleById โ€” Retrieves a specific validation rule by its unique ID.
  • updateValidationRule โ€” Partially updates an existing validation rule by ID. Only the fields provided in the request body are updated.
  • deleteValidationRule โ€” Permanently deletes a validation rule by ID. Any journeys or entity attributes referencing this rule should be updated b
  • addUsedByReference โ€” Adds a single used_by reference to an existing validation rule.
  • removeUsedByReference โ€” Removes a specific used_by reference from an existing validation rule.

getValidationRulesโ€‹

Returns all validation rules belonging to the authenticated user's organization.

GET /v1/validation-rules

Sample Call

epilot validation-rules getValidationRules

With JSONata filter:

epilot validation-rules getValidationRules --jsonata 'results[0]'
Sample Response
{
"results": [
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}
]
}

createValidationRuleโ€‹

Creates a new validation rule for the authenticated organization.

POST /v1/validation-rules

Request Body (required)

Sample Call

epilot validation-rules createValidationRule

With request body:

epilot validation-rules createValidationRule \
-d '{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
]
}'

Using stdin pipe:

cat body.json | epilot validation-rules createValidationRule

With JSONata filter:

epilot validation-rules createValidationRule --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}

getValidationRuleByIdโ€‹

Retrieves a specific validation rule by its unique ID.

GET /v1/validation-rules/{ruleId}

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesThe unique identifier of the validation rule to retrieve.

Sample Call

epilot validation-rules getValidationRuleById \
-p ruleId=rule-abc123

Using positional args for path parameters:

epilot validation-rules getValidationRuleById rule-abc123

With JSONata filter:

epilot validation-rules getValidationRuleById -p ruleId=rule-abc123 --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}

updateValidationRuleโ€‹

Partially updates an existing validation rule by ID. Only the fields provided in the request body are updated.

PATCH /v1/validation-rules/{ruleId}

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesThe unique identifier of the validation rule to update.

Request Body

Sample Call

epilot validation-rules updateValidationRule \
-p ruleId=rule-abc123

With request body:

epilot validation-rules updateValidationRule \
-p ruleId=rule-abc123 \
-d '{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
]
}'

Using positional args for path parameters:

epilot validation-rules updateValidationRule rule-abc123

Using stdin pipe:

cat body.json | epilot validation-rules updateValidationRule -p ruleId=rule-abc123

With JSONata filter:

epilot validation-rules updateValidationRule -p ruleId=rule-abc123 --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}

deleteValidationRuleโ€‹

Permanently deletes a validation rule by ID. Any journeys or entity attributes referencing this rule should be updated b

DELETE /v1/validation-rules/{ruleId}

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesThe unique identifier of the validation rule to delete.

Sample Call

epilot validation-rules deleteValidationRule \
-p ruleId=rule-abc123

Using positional args for path parameters:

epilot validation-rules deleteValidationRule rule-abc123

With JSONata filter:

epilot validation-rules deleteValidationRule -p ruleId=rule-abc123 --jsonata '$'

addUsedByReferenceโ€‹

Adds a single used_by reference to an existing validation rule.

POST /v1/validation-rules/{ruleId}/used-by

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesThe unique identifier of the validation rule to update.

Request Body

Sample Call

epilot validation-rules addUsedByReference \
-p ruleId=rule-abc123 \
-d '{"type":"journey","source_id":"journey-xyz789"}'

Using positional args for path parameters:

epilot validation-rules addUsedByReference rule-abc123

Using stdin pipe:

cat body.json | epilot validation-rules addUsedByReference -p ruleId=rule-abc123

With JSONata filter:

epilot validation-rules addUsedByReference -p ruleId=rule-abc123 --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}

removeUsedByReferenceโ€‹

Removes a specific used_by reference from an existing validation rule.

DELETE /v1/validation-rules/{ruleId}/used-by

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesThe unique identifier of the validation rule to update.

Request Body

Sample Call

epilot validation-rules removeUsedByReference \
-p ruleId=rule-abc123 \
-d '{"type":"journey","source_id":"journey-xyz789"}'

Using positional args for path parameters:

epilot validation-rules removeUsedByReference rule-abc123

Using stdin pipe:

cat body.json | epilot validation-rules removeUsedByReference -p ruleId=rule-abc123

With JSONata filter:

epilot validation-rules removeUsedByReference -p ruleId=rule-abc123 --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"source_id": "journey-xyz789"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"contexts": [
{
"schema": "contract"
}
],
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}