Automations and events

Automations are workflows built in the dashboard: a trigger, then delays, conditions and email steps. Your backend can start them by tracking events.

Triggers

TriggerStarts when
A contact is createdIn the dashboard, by CSV import, or by the first event tracked for a new address.
A contact joins a listOnly contacts that were not already members.
Your app tracks an eventYou call POST /v1/events with the event name.

Unsubscribed contacts never start an automation, and a contact already inside an automation is not enrolled again until that run finishes.

Tracking events

Terminal
curl https://api.mailfy.uz/v1/events \
  -H "Authorization: Bearer $MAILFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@example.com",
    "event": "cart.abandoned",
    "properties": { "item": "Desk lamp", "price": 48 }
  }'
202 Accepted
{ "data": { "contactId": "…", "contactCreated": false, "automationsStarted": 1 } }

Event names use letters, digits and _ . : -. Properties (up to 50 scalar values) are available in that run’s emails as {{ item }}. Events start automations of the API key’s project only.

Automations send real marketing email, so events require a live key. Test keys get 403.

Steps

StepBehaviour
DelayWaits 1 minute to 365 days. Runs resume within about a minute of their time.
ConditionContact fields or attributes (is / is not / contains). Matching contacts take Yes, others No. Checked when the contact reaches the step.
Send emailMarketing email with one-click unsubscribe, personalized with contact attributes and event properties. Skipped if the contact has unsubscribed.

Each step runs at most once per contact, even if a worker restarts mid-run. A run that cannot continue (for example, the sending domain is no longer verified or the monthly quota is used up) stops as Failed with the reason in its history.