Skip to content

Rule.io SDK


Rule.io SDK / client/src / SetEmailAutomationPayload

Interface: SetEmailAutomationPayload

Defined in: client/src/resources/automations/automations.types.ts:218

Payload for AutomationsClient.setEmailAutomation (full replacement).

All fields are required — the API replaces the entire automation body. Omitted fields revert to API defaults, not the previous values.

The message type is fixed to 'email' by the method. If the automation does not yet exist it is created as an email automation.

Example ​

typescript
await client.automations.setEmailAutomation(automationId, {
  name: 'Welcome email',
  active: true,
  trigger: { type: 'TAG', id: tagId },
  sendoutType: 'transactional',
  tagActionsOnFinish: [{ tagId: tagId, action: 'add' }],
});

Properties ​

active ​

active: boolean

Defined in: client/src/resources/automations/automations.types.ts:226

Whether the automation is active. Required.

Pass false to create/replace as paused.


name ​

name: string

Defined in: client/src/resources/automations/automations.types.ts:220

Automation name. Required.


sendoutType ​

sendoutType: AutomationSendoutType

Defined in: client/src/resources/automations/automations.types.ts:239

Sendout type. Required.

'marketing' = standard marketing email. 'transactional' = triggered transactional email.


tagActionsOnFinish ​

tagActionsOnFinish: AutomationFinishTagEntry[]

Defined in: client/src/resources/automations/automations.types.ts:248

Tags to attach to or remove from subscribers once the automation completes for them. Required, like the other fields — pass [] if the automation should have no finish tags.

Each tagId can appear at most once — the API rejects a request that both adds and removes the same tag.


trigger ​

trigger: AutomationTrigger

Defined in: client/src/resources/automations/automations.types.ts:232

Trigger configuration. Required.

type must be uppercase ('TAG' or 'SEGMENT').