Docs
Automations

Create Automation

Create an email sequence started by a new contact or by your app's events.

POST/automations

Body Parameters

namestringrequired
Name.
triggerobjectrequired
{ type: 'contact.created', audience_id? } or { type: 'event', event: 'user.signed_up' }.
stepsobject[]
{ type: 'email', from, subject, html } or { type: 'email', from, template_id } or { type: 'delay', minutes | hours | days }.
status'active' | 'paused'
Default paused.
const res = await fetch('https://postwaves.online/automations', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer pw_xxxxxxxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Onboarding",
    "status": "active",
    "trigger": {
      "type": "event",
      "event": "user.signed_up"
    },
    "steps": [
      {
        "type": "email",
        "from": "hello@yourdomain.com",
        "subject": "Welcome {{{FIRST_NAME}}}",
        "html": "<p>Glad you're here</p>"
      },
      {
        "type": "delay",
        "days": 2
      },
      {
        "type": "email",
        "from": "hello@yourdomain.com",
        "subject": "Tips to get started",
        "html": "<p>…</p>"
      }
    ]
  }),
});
const data = await res.json();
Try itPOST/automations

No key yet? Create one in the dashboard.