Triggers API
Triggers define what event fires the email sequence, who receives it, and optional targeting rules. All endpoints require authentication.
Trigger object
| Field | Type | Description |
|---|---|---|
id | Int | Unique identifier (read-only) |
title | String | Trigger name |
description | String | Optional description |
campaign_id | String | Parent campaign ID |
event | String | Event identifier — see Available Events |
cancellation_event | String[] | Array of event identifiers that cancel this trigger |
events | String[] | Event identifiers for event (read-only, same as event wrapped in an array) |
triggering_events | String[] | Alias for events (read-only) |
cancellation_events | String[] | Identifiers for cancellation_event items (read-only) |
is_active | Boolean | Whether the trigger is active |
sender_email | String | Sender email address (leave empty to use store default) |
sender_name | String | Sender display name (leave empty to use store default) |
active_from | String | Start date for trigger activity (YYYY-MM-DD HH:MM:SS), or "" for no limit — do not pass null, use "" |
active_to | String | End date for trigger activity (YYYY-MM-DD HH:MM:SS), or "" for no limit — do not pass null, use "" |
store_ids | Int[] | Restrict to specific store views; empty array = all stores |
is_admin | Int | 1 sends a copy to the admin email, 0 does not |
admin_email | String | Admin copy recipient |
event_params | String | JSON-encoded event parameters (see Available Events) |
rule_serialized | String | JSON-encoded audience condition tree (flat path-key format — see Notes); "" = no filter |
trigger_type | String | Always "" — reserved field |
schedule | String | Always "" — reserved field |
ga_source | String | Google Analytics utm_source |
ga_medium | String | Google Analytics utm_medium |
ga_name | String | Google Analytics utm_campaign |
ga_term | String | Google Analytics utm_term (paid keyword or audience segment) |
ga_content | String | Google Analytics utm_content (link variant for A/B testing) |
copy_email | String | BCC this address on every email sent by this trigger; "" to disable |
created_at | String | Creation timestamp (read-only) |
updated_at | String | Last update timestamp (read-only) |
cancellation_event, events, triggering_events, and cancellation_events are read-only arrays returned on GET. Use the cancellation_event field on POST/PUT to set cancellation events.
List triggers
GET /rest/V1/mst-email/triggers
Supports filtering and pagination.
Get trigger
GET /rest/V1/mst-email/triggers/:id
Response:
{
"id": 5,
"title": "Abandoned Cart - Day 1",
"description": "",
"campaign_id": "2",
"event": "quote_abandoned",
"cancellation_event": ["order_new"],
"events": ["quote_abandoned"],
"triggering_events": ["quote_abandoned"],
"cancellation_events": ["order_new"],
"is_active": true,
"sender_email": "",
"sender_name": "",
"active_from": "",
"active_to": "",
"store_ids": [],
"is_admin": 0,
"admin_email": "",
"event_params": "{\"abandoned_after_minutes\":60}",
"rule_serialized": "{}",
"trigger_type": "",
"schedule": "",
"ga_source": "email",
"ga_medium": "follow-up",
"ga_name": "abandoned-cart",
"ga_term": "",
"ga_content": "",
"created_at": "2026-02-01 10:00:00",
"updated_at": "2026-05-15 08:45:00"
}
Errors: 404 trigger not found.
Create trigger
POST /rest/V1/mst-email/triggers
Request body:
{
"trigger": {
"title": "Post-Purchase Review Request",
"description": "",
"campaign_id": 1,
"event": "order_new",
"cancellation_event": [],
"is_active": true,
"sender_email": "",
"sender_name": "",
"active_from": "",
"active_to": "",
"store_ids": [],
"is_admin": false,
"admin_email": "",
"event_params": "{}",
"rule_serialized": "{}",
"trigger_type": "",
"schedule": ""
}
}
Response: the created trigger object with id assigned.
Update trigger
PUT /rest/V1/mst-email/triggers/:id
PUT is a partial update — send only the fields you want to change; omitted fields retain their current values. Note: store_ids is not accepted on PUT; set it only during creation.
Request body: same structure as Create trigger.
Response: the updated trigger object.
Errors: 404 trigger not found.
Delete trigger
DELETE /rest/V1/mst-email/triggers/:id
Response:
true
Errors: 404 trigger not found.
Duplicate trigger
Copies the trigger along with all its chains.
POST /rest/V1/mst-email/triggers/:id/duplicate
No request body required.
Response: the newly created trigger object.
Errors: 404 source trigger not found.
Copy trigger to campaign
Copies the trigger (and its chains) into a different campaign.
POST /rest/V1/mst-email/triggers/:id/copy
Request body:
{
"campaignId": 3
}
Pass "move": true to move the trigger instead of copying it (the original is deleted).
Response: the newly created trigger object in the target campaign.
Errors: 404 source trigger or target campaign not found.
Send test email
Sends a test email for this trigger to the specified address.
POST /rest/V1/mst-email/triggers/:id/send-test
Request body:
{
"email": "[email protected]"
}
Response:
true
Errors: 404 trigger not found, 400 invalid email address.
Notes
Cron-based events (quote_abandoned, customer_birthday, customer_no_activity, etc.) require Magento cron to be configured and running. See Available Events for the full list.
rule_serialized is a JSON-encoded Magento rule condition tree using a flat path-key structure. The easiest way to get a valid value is to configure conditions in the admin UI and then GET /rest/V1/mst-email/triggers/:id — copy the rule_serialized field and adapt it.
Expanded example — customer group is one of General or Wholesale AND order placed on or after 2026-06-01:
{
"conditions": {
"1": {
"type": "Mirasvit\\EmailEvent\\Model\\Rule\\Condition\\Combine",
"aggregator": "all",
"value": "1",
"new_child": ""
},
"1--1": {
"type": "Mirasvit\\EmailEvent\\EventData\\Condition\\CustomerCondition",
"attribute": "group_id",
"operator": "()",
"value": ["1", "3"]
},
"1--2": {
"type": "Mirasvit\\EmailEvent\\EventData\\Condition\\OrderCondition",
"attribute": "created_at",
"operator": ">=",
"value": "2026-06-01"
}
}
}
Key rules:
- Path keys:
"1"= root Combine,"1--1"= first child,"1--2"= second child,"1--1--1"= nested grandchild. - Root
"1"is always aCombinenode.aggregator:"all"= AND,"any"= OR. valueformat depends on the operator:()and!()(is one of / is not one of) take a JSON array of string IDs —["1","3"]. All other operators (==,!=,>=,<=,{},!{}) take a plain string.- Condition type class names:
Mirasvit\EmailEvent\Model\Rule\Condition\Combinefor group nodes;Mirasvit\EmailEvent\EventData\Condition\CustomerCondition,OrderCondition,QuoteCondition, etc. for leaves. - Pass
""for no conditions (trigger fires for all recipients).
event_params is a JSON-encoded string, not an object. Always serialize it:
{
"event_params": "{\"expire_after\": 3600}"
}
Retrieve the valid parameter names for each event from Available Events.