Skip to main content

Validation Rules API

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โ€‹

Gets all validation rules by organization Id

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",
"schema_slug": "string",
"source_id": "string"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"_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

POST /v1/validation-rules

Request Body

Sample Call

epilot validation-rules createValidationRule

With request body:

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

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",
"schema_slug": "string",
"source_id": "string"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"_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 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=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot validation-rules getValidationRuleById 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot validation-rules getValidationRuleById -p ruleId=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"schema_slug": "string",
"source_id": "string"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}

updateValidationRuleโ€‹

Updates an existing validation rule partially by ID

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=123e4567-e89b-12d3-a456-426614174000

With request body:

epilot validation-rules updateValidationRule \
-p ruleId=123e4567-e89b-12d3-a456-426614174000 \
-d '{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"schema_slug": "string",
"source_id": "string"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
}
}'

Using positional args for path parameters:

epilot validation-rules updateValidationRule 123e4567-e89b-12d3-a456-426614174000

Using stdin pipe:

cat body.json | epilot validation-rules updateValidationRule -p ruleId=123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot validation-rules updateValidationRule -p ruleId=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"schema_slug": "string",
"source_id": "string"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}

deleteValidationRuleโ€‹

Deletes a validation rule by ID

DELETE /v1/validation-rules/{ruleId}

Parameters

NameInTypeRequiredDescription
ruleIdpathstringYesThe unique identifier of the validation rule to delete.

Sample Call

epilot validation-rules deleteValidationRule \
-p ruleId=123e4567-e89b-12d3-a456-426614174000

Using positional args for path parameters:

epilot validation-rules deleteValidationRule 123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot validation-rules deleteValidationRule -p ruleId=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'

addUsedByReferenceโ€‹

Adds a single reference to the usedBy array of a 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=123e4567-e89b-12d3-a456-426614174000 \
-d '{"type":"journey","schema_slug":"string","source_id":"string"}'

Using positional args for path parameters:

epilot validation-rules addUsedByReference 123e4567-e89b-12d3-a456-426614174000

Using stdin pipe:

cat body.json | epilot validation-rules addUsedByReference -p ruleId=123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot validation-rules addUsedByReference -p ruleId=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"schema_slug": "string",
"source_id": "string"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}

removeUsedByReferenceโ€‹

Removes a specific reference from the usedBy array of a 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=123e4567-e89b-12d3-a456-426614174000 \
-d '{"type":"journey","schema_slug":"string","source_id":"string"}'

Using positional args for path parameters:

epilot validation-rules removeUsedByReference 123e4567-e89b-12d3-a456-426614174000

Using stdin pipe:

cat body.json | epilot validation-rules removeUsedByReference -p ruleId=123e4567-e89b-12d3-a456-426614174000

With JSONata filter:

epilot validation-rules removeUsedByReference -p ruleId=123e4567-e89b-12d3-a456-426614174000 --jsonata '$'
Sample Response
{
"title": "string",
"placeholder": "string",
"used_by": [
{
"type": "journey",
"schema_slug": "string",
"source_id": "string"
}
],
"rule": {
"type": "regex",
"conditions": {
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
},
{
"all": [
{
"fact": "inputValue",
"operator": "regexMatch",
"value": "string",
"params": {
"errorMessage": "string"
}
}
]
}
]
}
},
"_schema_version": "string",
"_id": "string",
"_organization_id": "string",
"created_at": "string",
"updated_at": "string",
"created_by": "string",
"updated_by": "string"
}