Automations
Trigger-based email workflows that run automatically on contact events
Automations are trigger-based workflows that act on contacts automatically when a trigger fires. Each workflow has one trigger and an ordered list of steps (send an email, wait, tag, branch, and more).
Authentication
All automation endpoints use session (cookie-based) authentication. They are intended for dashboard use and do not accept API keys. Base URL: https://api.misar.io/mail.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/automations | List automation workflows |
POST | /api/automations | Create a workflow |
GET | /api/automations/:id | Get a single workflow (with steps + stats) |
PATCH | /api/automations | Update a workflow (id in body) |
DELETE | /api/automations?id= | Delete a workflow (id in query) |
Trigger types
A workflow's trigger.type must be one of:
| Trigger | Fires when |
|---|---|
signup | A contact signs up |
tag_added | A tag is added to a contact |
tag_removed | A tag is removed from a contact |
email_opened | A contact opens an email |
link_clicked | A contact clicks a tracked link |
date | A configured date/time is reached |
api | Triggered via the API (default when no trigger is set) |
segment_entered | A contact enters a segment |
form_submitted | A contact submits a form |
Trigger-specific parameters are passed in the optional trigger.config object.
Step types
Each step has a type and a config object. Valid type values:
send_email · wait · add_tag · remove_tag · condition · update_contact · webhook · ab_split · goal
Follow-up guardrails
To protect deliverability, a workflow may contain at most 5 send_email steps, and every follow-up email (after the first) must be preceded by a wait step of at least 2 days. Violations return 422 (code: "FOLLOW_UP_LIMIT" on create, code: "SEQUENCE_VIOLATION" on update).
List automations
/mail/automationsList automation workflows for the authenticated account.
Query parameters
pageintegerquerydefault: 1Page number.
limitintegerquerydefault: 20Results per page (max 50).
statusdraft | active | pausedqueryFilter by status.
sortBycreated_at | name | updated_atquerydefault: updated_atSort field.
sortOrderasc | descquerydefault: descSort direction.
Response fields
successbooleantrue when the request succeeded.
dataArray<Automation>The page of workflows. Each includes id, name, description, trigger_type, trigger_config, status, total_enrolled, total_completed, flow_data, created_at, and updated_at.
paginationobjectpage, limit, total, and totalPages.
curl "https://api.misar.io/mail/automations?page=1&limit=20" \
-H "Cookie: session=..."{
"success": true,
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Welcome Series",
"description": "Onboard new signups",
"trigger_type": "signup",
"trigger_config": {},
"status": "active",
"total_enrolled": 142,
"total_completed": 118,
"flow_data": null,
"created_at": "2026-02-01T09:00:00Z",
"updated_at": "2026-02-10T12:00:00Z"
}
],
"pagination": { "page": 1, "limit": 20, "total": 8, "totalPages": 1 }
}Create an automation
/mail/automationsCreate a new workflow. New workflows are created with status draft. If trigger is omitted, trigger_type defaults to api.
Request body
namestringbodyrequired1–100 characters.
descriptionstringbodyMax 1000 characters.
triggerobjectbody{ type, config? }. type is one of the trigger types above; config is an optional object of trigger-specific parameters.
stepsarraybodyOrdered list of steps (max 50). Each step is { type, config }.
flow_dataobjectbodyOptional visual flow-editor state (nodes, edges, viewport).
Response fields
successbooleantrue when the workflow was created.
dataobjectThe created workflow, including id, name, trigger_type, status, and timestamps.
curl -X POST https://api.misar.io/mail/automations \
-H "Cookie: session=..." \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome Series",
"description": "Onboard new signups",
"trigger": { "type": "signup" },
"steps": [
{ "type": "send_email", "config": { "template_id": "..." } },
{ "type": "wait", "config": { "value": 2, "unit": "days" } },
{ "type": "send_email", "config": { "template_id": "..." } }
]
}'{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Welcome Series",
"trigger_type": "signup",
"status": "draft",
"created_at": "2026-02-01T09:00:00Z",
"updated_at": "2026-02-01T09:00:00Z"
}
}Get an automation
/mail/automations/:idReturns a single workflow with its ordered steps and enrollment stats.
Path parameters
idstringpathrequiredUUID of the workflow.
Response fields
successbooleantrue when the request succeeded.
dataobjectThe full workflow object plus steps (ordered array) and stats (totalEnrolled, active, completed, paused).
curl https://api.misar.io/mail/automations/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Cookie: session=..."{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Welcome Series",
"status": "active",
"steps": [],
"stats": { "totalEnrolled": 142, "active": 12, "completed": 118, "paused": 12 }
}
}Update an automation
/mail/automationsUpdate a workflow. The workflow id is passed in the request body (not the path). Send only the fields you want to change. Passing steps replaces the workflow's steps.
Request body
idstringbodyrequiredUUID of the workflow to update.
namestringbody1–100 characters.
descriptionstringbodyMax 1000 characters.
statusdraft | active | pausedbodyNew status.
triggerobjectbody{ type, config? }.
stepsarraybodyReplacement steps (max 50). Each { type, config }.
flow_dataobjectbodyVisual flow-editor state.
curl -X PATCH https://api.misar.io/mail/automations \
-H "Cookie: session=..." \
-H "Content-Type: application/json" \
-d '{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "active" }'{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Welcome Series",
"status": "active"
}
}Delete an automation
/mail/automationsDelete a workflow. Pass the id as a query parameter. If the workflow is currently active it is auto-paused before deletion; its steps and enrollments are removed too.
Query parameters
idstringqueryrequiredUUID of the workflow to delete.
Response fields
successbooleantrue when the workflow was deleted.
curl -X DELETE "https://api.misar.io/mail/automations?id=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "Cookie: session=..."{ "success": true }Status values
| Status | Meaning |
|---|---|
draft | Created but not enrolling contacts |
active | Running — contacts are enrolled on trigger |
paused | Temporarily stopped — no new enrollments |
Status codes
| Code | Meaning |
|---|---|
200 | Request succeeded |
201 | Workflow created |
400 | Validation failed, or missing/invalid id |
401 | Not authenticated |
402 | Automation quota reached for your plan (Free: 2, Pro: 20, Max: unlimited) |
404 | Workflow not found |
422 | Follow-up sequence guardrail violated |