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:

{
"name": "string" // String, optional,
"uuid": "string" // String, optional,
"objectType": null // <enum EventRuleObjectType,
"eventType": null // <enum EventRuleEventType,
"conditions": "string" // String, optional,
"actionType": null // <enum EventRuleActionType,
"actionParams": {} // dict[str, Any], optional,
"triggerParams": {} // dict[str, Any], optional,
"active": false // Boolean, optional, default: True,
"taskId": 0 // Integer, optional,
"dataTypeId": 0 // Integer, optional,
"routineId": 0 // Integer, optional,
"workflowRevisionId": 0 // Integer, optional,
"calendarId": 0 // Integer, optional,
"calendarEventTypeId": 0 // Integer, optional,
"journeyStepId": 0 // Integer, optional,
"delay": 0 // Integer, optional, default: 0,
"order": 0 // Integer, optional, default: 0
}

EventRuleResponse

FieldTypeRequiredDescription
actionParamsDict[str, Any]
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 // Integer,
"uuid": "string" // String,
"objectType": null // <enum EventRuleObjectType,
"name": "string" // String,
"eventType": null // <enum EventRuleEventType,
"conditions": "string" // String,
"actionType": null // <enum EventRuleActionType,
"actionParams": {} // Dict[str, Any],
"triggerParams": {} // Dict[str, Any],
"active": false // Boolean,
"createdAt": "2024-01-01T00:00:00Z" // DateTime,
"updatedAt": "2024-01-01T00:00:00Z" // DateTime,
"taskId": 0 // Integer,
"taskName": "string" // String, optional,
"taskWorkflowId": 0 // Integer, optional,
"dataTypeId": 0 // Integer,
"dataTypeName": "string" // String, optional,
"routineId": 0 // Integer,
"workflowRevisionId": 0 // Integer,
"calendarId": 0 // Integer,
"calendarEventTypeId": 0 // Integer,
"journeyStepId": 0 // Integer,
"journeyId": 0 // Integer, optional,
"appConnectionId": 0 // Integer, optional,
"error": "string" // String,
"errorMessage": "string" // String,
"failedAt": "2024-01-01T00:00:00Z" // DateTime,
"celBlockedAt": "2024-01-01T00:00:00Z" // DateTime, optional,
"delay": 0 // Integer,
"order": 0 // Integer
}

UpdateEventRuleRequest

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

Example:

{
"name": "string" // String, optional,
"conditions": "string" // String, optional,
"actionParams": {} // dict[str, Any], optional,
"triggerParams": {} // dict[str, Any], optional,
"active": false // Boolean, optional,
"delay": 0 // Integer, optional,
"order": 0 // Integer, optional
}

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.

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.

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)

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)

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