GET /api/v1/triggers
List all trigger rules sorted by priority descending.Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | — | Filter by status |
eventType | string | — | Filter by event type |
limit | integer | 50 | Max results (max 200) |
offset | integer | 0 | Pagination offset |
Response
POST /api/v1/triggers
Create a new trigger rule.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Trigger name |
eventType | string | Yes | Event type to match (e.g., "purchase", "page_view", "login") |
actionType | string | Yes | Action to fire: "enroll_journey", "webhook", "decision_request" |
actionConfig | object | No | Action-specific configuration |
condition | object | No | Condition to evaluate against event payload |
description | string | No | Description |
priority | integer | No | Priority (higher = evaluated first). Default: 50 |
cooldownMs | integer | No | Cooldown period in milliseconds before the trigger can fire again for the same customer. Default: 0 |
Example
201 Created
GET /api/v1/triggers/
Get trigger rule details.PUT /api/v1/triggers/
Update a trigger rule. Only provided fields are updated.| Field | Type | Description |
|---|---|---|
name | string | Updated name |
description | string | Updated description |
eventType | string | Updated event type |
condition | object | Updated condition |
actionType | string | Updated action type |
actionConfig | object | Updated action config |
cooldownMs | integer | Updated cooldown |
priority | integer | Updated priority |
status | string | Updated status |
200 OK
DELETE /api/v1/triggers/
Delete a trigger rule. Requires admin role. Response:204 No Content
POST /api/v1/triggers//test
Dry-run a trigger against a sample event payload. Returns whether the trigger would fire without actually executing the action.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
eventPayload | object | Yes | Sample event data to test against the trigger’s condition |
Response
Roles
| Endpoint | Allowed Roles |
|---|---|
GET /triggers | admin, editor |
POST /triggers | admin, editor |
PUT /triggers/{id} | admin, editor |
DELETE /triggers/{id} | admin |
POST /triggers/{id}/test | admin, editor |