MisarMisar Docs
MisarMailMisarBlogMisarReachMisarPostMisarDevMisarCoderMisarSEOMisar PlatformMisar SSO
API Reference

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

MethodPathDescription
GET/api/automationsList automation workflows
POST/api/automationsCreate a workflow
GET/api/automations/:idGet a single workflow (with steps + stats)
PATCH/api/automationsUpdate 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:

TriggerFires when
signupA contact signs up
tag_addedA tag is added to a contact
tag_removedA tag is removed from a contact
email_openedA contact opens an email
link_clickedA contact clicks a tracked link
dateA configured date/time is reached
apiTriggered via the API (default when no trigger is set)
segment_enteredA contact enters a segment
form_submittedA 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

GET/mail/automations

List automation workflows for the authenticated account.

Query parameters

pageintegerquerydefault: 1

Page number.

limitintegerquerydefault: 20

Results per page (max 50).

statusdraft | active | pausedquery

Filter by status.

sortBycreated_at | name | updated_atquerydefault: updated_at

Sort field.

sortOrderasc | descquerydefault: desc

Sort direction.

Response fields

successboolean

true 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.

paginationobject

page, limit, total, and totalPages.

Request
curl "https://api.misar.io/mail/automations?page=1&limit=20" \
  -H "Cookie: session=..."
200 — OK
{
  "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

POST/mail/automations

Create a new workflow. New workflows are created with status draft. If trigger is omitted, trigger_type defaults to api.

Request body

namestringbodyrequired

1–100 characters.

descriptionstringbody

Max 1000 characters.

triggerobjectbody

{ type, config? }. type is one of the trigger types above; config is an optional object of trigger-specific parameters.

stepsarraybody

Ordered list of steps (max 50). Each step is { type, config }.

flow_dataobjectbody

Optional visual flow-editor state (nodes, edges, viewport).

Response fields

successboolean

true when the workflow was created.

dataobject

The created workflow, including id, name, trigger_type, status, and timestamps.

Request
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": "..." } }
    ]
  }'
201 — Created
{
  "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

GET/mail/automations/:id

Returns a single workflow with its ordered steps and enrollment stats.

Path parameters

idstringpathrequired

UUID of the workflow.

Response fields

successboolean

true when the request succeeded.

dataobject

The full workflow object plus steps (ordered array) and stats (totalEnrolled, active, completed, paused).

Request
curl https://api.misar.io/mail/automations/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Cookie: session=..."
200 — OK
{
  "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

PATCH/mail/automations

Update 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

idstringbodyrequired

UUID of the workflow to update.

namestringbody

1–100 characters.

descriptionstringbody

Max 1000 characters.

statusdraft | active | pausedbody

New status.

triggerobjectbody

{ type, config? }.

stepsarraybody

Replacement steps (max 50). Each { type, config }.

flow_dataobjectbody

Visual flow-editor state.

Request
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" }'
200 — OK
{
  "success": true,
  "data": {
    "id":     "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name":   "Welcome Series",
    "status": "active"
  }
}

Delete an automation

DELETE/mail/automations

Delete 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

idstringqueryrequired

UUID of the workflow to delete.

Response fields

successboolean

true when the workflow was deleted.

Request
curl -X DELETE "https://api.misar.io/mail/automations?id=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Cookie: session=..."
200 — OK
{ "success": true }

Status values

StatusMeaning
draftCreated but not enrolling contacts
activeRunning — contacts are enrolled on trigger
pausedTemporarily stopped — no new enrollments

Status codes

CodeMeaning
200Request succeeded
201Workflow created
400Validation failed, or missing/invalid id
401Not authenticated
402Automation quota reached for your plan (Free: 2, Pro: 20, Max: unlimited)
404Workflow not found
422Follow-up sequence guardrail violated