Skip to content

Rule.io SDK


Rule.io SDK / client/src / UpdateEmailCampaignPayload

Interface: UpdateEmailCampaignPayload

Defined in: client/src/resources/campaigns/campaigns.types.ts:293

Payload for CampaignsClient.updateEmailCampaign (partial update via read-modify-write).

All fields are optional — only the fields you include are changed. The client fetches the existing record, merges your changes over it, and writes the complete merged body back to the API.

Example

typescript
// Change only the name
await client.campaigns.updateEmailCampaign(campaignId, { name: 'Spring Newsletter 2025' });

// Set recipients
await client.campaigns.updateEmailCampaign(campaignId, {
  tags: [{ id: 42, negative: false }],
  segments: [],
});

Properties

name?

optional name?: string

Defined in: client/src/resources/campaigns/campaigns.types.ts:295

New campaign name.


segments?

optional segments?: CampaignRecipientSegment[]

Defined in: client/src/resources/campaigns/campaigns.types.ts:306

New segment recipient filters. Replaces all existing segment filters.


sendoutType?

optional sendoutType?: CampaignSendoutType

Defined in: client/src/resources/campaigns/campaigns.types.ts:302

New sendout type.

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


subscribers?

optional subscribers?: number[]

Defined in: client/src/resources/campaigns/campaigns.types.ts:308

New individual subscriber IDs. Replaces all existing subscriber targets.


tags?

optional tags?: CampaignRecipientTag[]

Defined in: client/src/resources/campaigns/campaigns.types.ts:304

New tag recipient filters. Replaces all existing tag filters.