Skip to main content
POST
/
automations
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.automations.create({
  name: 'Welcome series',
  status: 'disabled',
  steps: [
    {
      key: 'start',
      type: 'trigger',
      config: { eventName: 'user.created' },
    },
    {
      key: 'welcome',
      type: 'send_email',
      config: {
        templateId: '34a080c9-b17d-4187-ad80-5af20266e535',
      },
    },
  ],
  edges: [{ from: 'start', to: 'welcome' }],
});
{
  "object": "automation",
  "id": "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd"
}
Automations are currently in private alpha and only available to a limited number of users. APIs might change before GA.To use the methods on this page, you must upgrade your Resend SDK:
npm install resend@6.10.0-preview-workflows.3
Contact us if you’re interested in testing this feature.

Body Parameters

name
string
required
The name of the automation.
status
string
The status of the automation. Possible values are enabled or disabled. Defaults to disabled.
steps
Step[]
The steps that compose the automation graph. Must be provided together with edges. See Step Properties for full object definition.
edges
Edge[]
The edges connecting steps in the automation graph. Must be provided together with steps. See Edge Properties for full object definition.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.automations.create({
  name: 'Welcome series',
  status: 'disabled',
  steps: [
    {
      key: 'start',
      type: 'trigger',
      config: { eventName: 'user.created' },
    },
    {
      key: 'welcome',
      type: 'send_email',
      config: {
        templateId: '34a080c9-b17d-4187-ad80-5af20266e535',
      },
    },
  ],
  edges: [{ from: 'start', to: 'welcome' }],
});
{
  "object": "automation",
  "id": "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd"
}