Skip to main content

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​

FieldTypeRequiredDescription
actionParamsdict[str, Any]
actionType<enum EventRuleActionType✓
activeBooleanDefault: True
calendarEventTypeIdInteger
calendarIdInteger
conditionsString
dataTypeIdInteger
delayIntegerDefault: 0
eventType<enum EventRuleEventType✓
journeyStepIdInteger
nameString
objectType<enum EventRuleObjectType✓
orderIntegerDefault: 0
routineIdInteger
taskIdInteger
triggerParamsdict[str, Any]
uuidString
workflowRevisionIdInteger

Example:

{
"objectType": null,
"eventType": null,
"actionType": null,
"active": true,
"delay": 0,
"order": 0
}

CursorPaginatedResponse[RuleExecutionResponse]​

FieldTypeRequiredDescription
hasMoreBoolean✓
itemsArray<RuleExecutionResponse>✓
nextCursorString
pageSizeInteger✓

Example:

{
"items": [],
"hasMore": false,
"pageSize": 0
}

EventActionMapping​

FieldTypeRequiredDescription
actionsArray✓
eventTypeString✓

Example:

{
"eventType": "string",
"actions": []
}

EventActionMappingsResponse​

FieldTypeRequiredDescription
mappingsArray<EventActionMapping>✓

Example:

{
"mappings": []
}

EventRuleResponse​

FieldTypeRequiredDescription
actionParamsDict[str, Any]✓
actionSetLockedBooleanDefault: False
actionType<enum EventRuleActionType✓
activeBoolean✓
appConnectionIdInteger
calendarEventTypeIdInteger✓
calendarIdInteger✓
celBlockedAtDateTime
conditionsString✓
createdAtDateTime✓
dataTypeIdInteger✓
dataTypeNameString
delayInteger✓
errorString✓
errorMessageString✓
eventType<enum EventRuleEventType✓
failedAtDateTime✓
idInteger✓
journeyIdInteger
journeyStepIdInteger✓
nameString✓
objectType<enum EventRuleObjectType✓
orderInteger✓
routineIdInteger✓
taskIdInteger✓
taskNameString
taskWorkflowIdInteger
triggerParamsDict[str, Any]✓
updatedAtDateTime✓
uuidString✓
workflowRevisionIdInteger✓

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]​

FieldTypeRequiredDescription
itemsArray<EventRuleResponse>✓
pageInteger✓
pageSizeInteger✓
totalInteger✓
totalPagesInteger✓

Example:

{
"items": [],
"total": 0,
"page": 0,
"pageSize": 0,
"totalPages": 0
}

RuleExecutionResponse​

FieldTypeRequiredDescription
actionSlugString✓
completedAtDateTime
createdAtDateTime✓
deliveryStatusLiteral[pending, delivered, delivery_failed]
detailsDict[str, Any]
dispatchKeyString
durationMsInteger
errorCodeString
errorMessageString
idInteger✓
messagesEmittedInteger✓
ruleEventRuleResponse | null
ruleIdInteger✓
statusString✓
taskSwitchedBoolean✓
triggerFingerprintString
triggerTypeString✓
validationErrorsArray✓

Example:

{
"id": 0,
"ruleId": 0,
"triggerType": "string",
"actionSlug": "string",
"status": "string",
"messagesEmitted": 0,
"taskSwitched": false,
"validationErrors": [],
"createdAt": "2024-01-01T00:00:00Z"
}

TestWebhookRequest​

FieldTypeRequiredDescription
payloaddict[str, Any]
signingSecretString
webhookUrlString✓

Example:

{
"webhookUrl": "string"
}

TestWebhookResponse​

FieldTypeRequiredDescription
durationMsInteger✓
errorMessageString
responseBodyString
statusCodeInteger
successBoolean✓

Example:

{
"success": false,
"durationMs": 0
}

UpdateEventRuleRequest​

FieldTypeRequiredDescription
actionParamsdict[str, Any]
activeBoolean
conditionsString
delayInteger
nameString
orderInteger
triggerParamsdict[str, Any]

Example:

{}

Endpoints​

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: 1
  • pageSize (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:

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: 100
  • sortBy (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]


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:

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:

Response: See TestWebhookResponse