Skip to content

Rule.io SDK


Rule.io SDK / client/src / SetEmailAutomationPayload

Interface: SetEmailAutomationPayload

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

Payload for AutomationsClient.setEmailAutomation (full replacement).

All four 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',
});

Properties

active

active: boolean

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

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:166

Automation name. Required.


sendoutType

sendoutType: AutomationSendoutType

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

Sendout type. Required.

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


trigger

trigger: AutomationTrigger

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

Trigger configuration. Required.

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