Event Rules
Tags: automation, events, rules
Event-driven automation rules
In the product: Actions
Resources
Request and response models used by the endpoints on this page.
CreateEventRuleRequest
| Field | Type | Required | Description |
|---|---|---|---|
actionParams | dict[str, Any] | ||
actionType | <enum EventRuleActionType | ✓ | |
active | Boolean | Default: True | |
calendarEventTypeId | Integer | ||
calendarId | Integer | ||
conditions | String | ||
dataTypeId | Integer | ||
delay | Integer | Default: 0 | |
eventType | <enum EventRuleEventType | ✓ | |
journeyStepId | Integer | ||
name | String | ||
objectType | <enum EventRuleObjectType | ✓ | |
order | Integer | Default: 0 | |
routineId | Integer | ||
taskId | Integer | ||
triggerParams | dict[str, Any] | ||
uuid | String | ||
workflowRevisionId | Integer |
Example:
{
"objectType": null,
"eventType": null,
"actionType": null,
"active": true,
"delay": 0,
"order": 0
}
CursorPaginatedResponse[RuleExecutionResponse]
| Field | Type | Required | Description |
|---|---|---|---|
hasMore | Boolean | ✓ | |
items | Array<RuleExecutionResponse> | ✓ | |
nextCursor | String | ||
pageSize | Integer | ✓ |
Example:
{
"items": [],
"hasMore": false,
"pageSize": 0
}
EventActionMapping
| Field | Type | Required | Description |
|---|---|---|---|
actions | Array | ✓ | |
eventType | String | ✓ |
Example:
{
"eventType": "string",
"actions": []
}
EventActionMappingsResponse
| Field | Type | Required | Description |
|---|---|---|---|
mappings | Array<EventActionMapping> | ✓ |
Example:
{
"mappings": []
}
EventRuleResponse
| Field | Type | Required | Description |
|---|---|---|---|
actionParams | Dict[str, Any] | ✓ | |
actionSetLocked | Boolean | Default: False | |
actionType | <enum EventRuleActionType | ✓ | |
active | Boolean | ✓ | |
appConnectionId | Integer | ||
calendarEventTypeId | Integer | ✓ | |
calendarId | Integer | ✓ | |
celBlockedAt | DateTime | ||
conditions | String | ✓ | |
createdAt | DateTime | ✓ | |
dataTypeId | Integer | ✓ | |
dataTypeName | String | ||
delay | Integer | ✓ | |
error | String | ✓ | |
errorMessage | String | ✓ | |
eventType | <enum EventRuleEventType | ✓ | |
failedAt | DateTime | ✓ | |
id | Integer | ✓ | |
journeyId | Integer | ||
journeyStepId | Integer | ✓ | |
name | String | ✓ | |
objectType | <enum EventRuleObjectType | ✓ | |
order | Integer | ✓ | |
routineId | Integer | ✓ | |
taskId | Integer | ✓ | |
taskName | String | ||
taskWorkflowId | Integer | ||
triggerParams | Dict[str, Any] | ✓ | |
updatedAt | DateTime | ✓ | |
uuid | String | ✓ | |
workflowRevisionId | Integer | ✓ |
Example:
{
"id": 0,
"uuid": "string",
"objectType": null,
"name": "string",
"eventType": null,
"conditions": "string",
"actionType": null,
"actionParams": {},
"triggerParams": {},
"active": false,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"taskId": 0,
"dataTypeId": 0,
"routineId": 0,
"workflowRevisionId": 0,
"calendarId": 0,
"calendarEventTypeId": 0,
"journeyStepId": 0,
"error": "string",
"errorMessage": "string",
"failedAt": "2024-01-01T00:00:00Z",
"delay": 0,
"order": 0,
"actionSetLocked": false
}
PaginatedResponse[EventRuleResponse]
| Field | Type | Required | Description |
|---|---|---|---|
items | Array<EventRuleResponse> | ✓ | |
page | Integer | ✓ | |
pageSize | Integer | ✓ | |
total | Integer | ✓ | |
totalPages | Integer | ✓ |
Example:
{
"items": [],
"total": 0,
"page": 0,
"pageSize": 0,
"totalPages": 0
}
RuleExecutionResponse
| Field | Type | Required | Description |
|---|---|---|---|
actionSlug | String | ✓ | |
completedAt | DateTime | ||
createdAt | DateTime | ✓ | |
deliveryStatus | Literal[pending, delivered, delivery_failed] | ||
details | Dict[str, Any] | ||
dispatchKey | String | ||
durationMs | Integer | ||
errorCode | String | ||
errorMessage | String | ||
id | Integer | ✓ | |
messagesEmitted | Integer | ✓ | |
rule | EventRuleResponse | null | ||
ruleId | Integer | ✓ | |
status | String | ✓ | |
taskSwitched | Boolean | ✓ | |
triggerFingerprint | String | ||
triggerType | String | ✓ | |
validationErrors | Array | ✓ |
Example:
{
"id": 0,
"ruleId": 0,
"triggerType": "string",
"actionSlug": "string",
"status": "string",
"messagesEmitted": 0,
"taskSwitched": false,
"validationErrors": [],
"createdAt": "2024-01-01T00:00:00Z"
}
TestWebhookRequest
| Field | Type | Required | Description |
|---|---|---|---|
payload | dict[str, Any] | ||
signingSecret | String | ||
webhookUrl | String | ✓ |
Example:
{
"webhookUrl": "string"
}
TestWebhookResponse
| Field | Type | Required | Description |
|---|---|---|---|
durationMs | Integer | ✓ | |
errorMessage | String | ||
responseBody | String | ||
statusCode | Integer | ||
success | Boolean | ✓ |
Example:
{
"success": false,
"durationMs": 0
}
UpdateEventRuleRequest
| Field | Type | Required | Description |
|---|---|---|---|
actionParams | dict[str, Any] | ||
active | Boolean | ||
conditions | String | ||
delay | Integer | ||
name | String | ||
order | Integer | ||
triggerParams | dict[str, Any] |
Example:
{}
Endpoints
GET /api/v2/w/{workspace_uuid}/event-rules- ListPOST /api/v2/w/{workspace_uuid}/event-rules- CreateGET /api/v2/w/{workspace_uuid}/event-rules/actions/available- AvailableGET /api/v2/w/{workspace_uuid}/event-rules/executions- ExecutionsPOST /api/v2/w/{workspace_uuid}/event-rules/reorder- ReorderGET /api/v2/w/{workspace_uuid}/event-rules/search- SearchDELETE /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}- Delete Event Rule IdGET /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}- Get Event Rule IdPUT /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}- Update Event Rule IdPOST /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}/reset-cel-block- Reset Cel BlockPOST /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}/test-webhook- Test Webhook
List
GET /api/v2/w/{workspace_uuid}/event-rules
Description:
List all event rules, paginated. Requires automations:read scope.
Authorization: Requires automations:read scope
Parameters:
page(Integer) — default: 1, min: 1pageSize(Integer) — default: 25, min: 1, max: 500
Response: See PaginatedResponse[EventRuleResponse]
Create
POST /api/v2/w/{workspace_uuid}/event-rules
Description:
Create a new event rule. Requires automations:admin scope.
Authorization: Requires automations:admin scope
Parameters:
request- See CreateEventRuleRequest
Response: See EventRuleResponse
Available
GET /api/v2/w/{workspace_uuid}/event-rules/actions/available
Description:
Get all available event-action mappings.
Returns a list of event types and their valid action types. This endpoint provides the validation rules for frontend to use. Customer-scoped actions are included only when this workspace's feature flags grant them.
Authorization: Requires automations:read scope
Response: See EventActionMappingsResponse
Executions
GET /api/v2/w/{workspace_uuid}/event-rules/executions
Description:
List all rule executions for the workspace with cursor-based pagination. Requires automations:read scope.
@phi_audit(..., bulk=True) because RuleExecutionResponse.validationErrors
and errorMessage are unconstrained action-authored strings: an action that
renders member field values into a failure message durably stores them here,
so the field is classified PHI-capable in
docs/security/pii_and_phi_storage_locations.md. Reads over that surface
need the HIPAA §164.312(b) bulk-access record (actor, query parameters, record
count, timestamp) that automations:read alone does not produce (#24223).
Authorization: Requires automations:read scope
Parameters:
cursor(String)pageSize(Integer) — min: 1, max: 100sortBy(ExecutionSortField)sortOrder(SortOrder)ruleId(Integer)status(String)triggerType(String)actionSlug(String)objectType(EventRuleObjectType)eventType(EventRuleEventType)actionType(EventRuleActionType)workflowRevisionId(Integer)
Response: See CursorPaginatedResponse[RuleExecutionResponse]
Reorder
POST /api/v2/w/{workspace_uuid}/event-rules/reorder
Description:
Reorder event rules by updating their order field based on the provided list of IDs. Requires automations:admin scope.
Authorization: Requires automations:admin scope
Parameters:
rule_ids(Array)
Response: dict[str, str]
Search
GET /api/v2/w/{workspace_uuid}/event-rules/search
Description:
Search for event rules matching the given criteria. Requires automations:read scope.
Authorization: Requires automations:read scope
Parameters:
objectType(EventRuleObjectType)eventType(EventRuleEventType)actionType(EventRuleActionType)taskId(Integer)dataTypeId(Integer)routineId(Integer)workflowRevisionId(Integer)calendarId(Integer)calendarEventTypeId(Integer)journeyStepId(Integer)includeDisabled(Boolean)
Response: List of EventRuleResponse
Delete Event Rule Id
DELETE /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}
Description:
Delete an event rule. Requires automations:admin scope.
Authorization: Requires automations:admin scope
Parameters:
event_rule_id(Integer)
Response: dict[str, str]
Get Event Rule Id
GET /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}
Description:
Get a specific event rule by ID. Requires automations:read scope.
Authorization: Requires automations:read scope
Parameters:
event_rule_id(Integer)
Response: See EventRuleResponse
Update Event Rule Id
PUT /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}
Description:
Update an existing event rule. Requires automations:admin scope.
Authorization: Requires automations:admin scope
Parameters:
event_rule_id(Integer)request- See UpdateEventRuleRequest
Response: See EventRuleResponse
Reset Cel Block
POST /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}/reset-cel-block
Description:
Clear the cel_blocked_at circuit-breaker flag on an event rule.
When a rule's CEL condition fails N consecutive times the circuit breaker
trips: cel_blocked_at is set and evaluation is skipped. Call this
endpoint after saving a corrected expression, or to manually re-enable a
rule that was blocked by a transient error.
Requires automations:admin scope.
Authorization: Requires automations:admin scope
Parameters:
event_rule_id(Integer)
Response: See EventRuleResponse
Test Webhook
POST /api/v2/w/{workspace_uuid}/event-rules/{event_rule_id}/test-webhook
Description:
Send a one-off test webhook without updating rule health or webhook logs.
Authorization: Requires automations:write scope
Parameters:
event_rule_id(Integer)request- See TestWebhookRequest
Response: See TestWebhookResponse