Documentation Index
Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
Use this file to discover all available pages before exploring further.
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
{
"data": [
{
"id": "trigger_001",
"name": "High-Value Purchase Trigger",
"eventType": "purchase",
"actionType": "enroll_journey",
"actionConfig": { "journeyId": "journey_001" },
"condition": { "field": "amount", "operator": "greater_than", "value": 500 },
"priority": 80,
"cooldownMs": 86400000,
"status": "active",
"createdAt": "2026-02-20T10:00:00.000Z"
}
],
"pagination": { "total": 12, "limit": 50, "offset": 0, "hasMore": false }
}
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", "fire_recommend", "webhook", "update_attribute" |
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
curl -X POST https://playground.kaireonai.com/api/v1/triggers \
-H "Content-Type: application/json" \
-H "X-Tenant-Id: my-tenant" \
-d '{
"name": "High-Value Purchase Trigger",
"eventType": "purchase",
"actionType": "enroll_journey",
"actionConfig": { "journeyId": "journey_001" },
"condition": { "field": "amount", "operator": "greater_than", "value": 500 },
"priority": 80,
"cooldownMs": 86400000
}'
Response: 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 |
Response: 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
{
"wouldFire": true,
"reason": "All conditions matched"
}
{
"wouldFire": false,
"reason": "Condition did not match the provided payload"
}
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 |
See also: Triggers