Appearance
Campaigns
These tools build and manage email campaigns: create a campaign with its content in one step, change its subject or audience, add variants for specific segments or tags, copy it, or delete it. Campaigns are always created as drafts, and these tools never send or schedule anything.
For a step-by-step flow, use the Create an email campaign workflow.
How a campaign is built
A campaign in Rule is made of four linked parts:
Campaign name, audience (tags and segments), sendout type, labels
└── Message subject, preview text, sender
└── Variant (dynamic set)
│ the default content, or content for one tag or segment
└── Template the email's content and layout- A campaign has one message.
- A message has one default variant, shown to everyone, and can have more variants, each shown only to subscribers in a chosen tag or segment (its trigger). In the API, variants are called dynamic sets.
- Each variant has its own template: the email content itself. See Email templates.
Which tool to use
| You want to… | Use |
|---|---|
| Create a new campaign with its email | create-campaign |
| See a campaign, its audience and its email | get-campaign |
| Rename it, or change its audience or labels | update-campaign |
| Change the subject, preview text or sender | update-message |
| Add a variant for a segment or tag | create-dynamic-set |
| Change or switch off a variant | update-dynamic-set |
| Duplicate a campaign, in the same or another account | copy-campaign |
| Delete a campaign, its message or one variant | delete-campaign, delete-message, delete-dynamic-set |
| Change the email's content | get-email-template and update-email-template |
| See what the email looks like | preview-email-template |
Good to know
- Drafts only. New campaigns are drafts. The name, sendout type and audience can only be changed while a campaign is a draft. The subject, sender and variants can be changed while it is a draft or scheduled. Labels can be changed at any time.
- Email only. Content can only be created for email campaigns.
create-campaigncan create an empty SMS campaign, but its content has to be written in Rule. - Unsubscribe link. A marketing email must contain an unsubscribe link (a link to
[Link:Unsubscribe]). Transactional emails do not need one. - Deleting is permanent and removes everything below: deleting a campaign also deletes its message, variants and templates.
- No automatic clean-up. If a tool that creates several parts fails half-way, the parts already created are kept and listed in the answer, so you can see exactly what exists.
- Every tool also takes the optional
account_id(see Accounts). It is left out of the tables below.
Campaigns
list-campaigns
Lists the campaigns in an account with their id, name, status, message type and dates.
| Parameter | Type | Required | Description |
|---|---|---|---|
message_type | email, text_message or rcs | No | Only campaigns of this type. Leave out to list all. |
page | number | No | Page number, starting at 1. |
per_page | number | No | Campaigns per page, from 3 to 100. Defaults to 100. |
- Rule can leave the last campaign off the last page. When that happens the answer says so, and the assistant asks again with a different page size to show it.
- Labels are always empty in this list. Use
get-campaignto see a campaign's labels. - The answer includes a link to the campaigns page in Rule.
- To see what was sent on a particular day, use
export-dispatchersinstead.
Try asking: "List my draft campaigns."
get-campaign
Shows one campaign in full: its status, audience, labels and statistics, its message and, for campaigns made in Rule's current email editor, the default email's content.
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_id | number | Yes | The campaign's id. |
- Each tag and segment in the audience has a
negativeflag. When it istrue, subscribers in that tag or segment are excluded. - A new draft without content has no message yet (
message: null). That is normal. - For campaigns made in Rule's older email editor, the content cannot be read.
- To show the email, use
preview-email-template. The campaign's ownpreview_urlonly works for someone signed in to Rule.
Try asking: "Show me campaign 1234: who is it sent to, and what does the email say?"
create-campaign
Creates a draft campaign together with its message, its default variant and the email template, in one step.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Campaign name. |
message_type | email or text_message | Yes | Email or SMS. RCS is not supported. |
template | object | Yes | Where the content comes from. See Content below. |
sendout_type | marketing or transactional | No | Defaults to marketing. |
recipients | object | No | The audience: { tag_ids, segment_ids }. List an id to include it, or { id, negative: true } to exclude it. Leave out to add the audience later. |
skip_missing_recipient_ids | boolean | No | Go on without tags or segments that do not exist. See the note below. |
label_ids | array of numbers | No | Labels to add. |
subject | string | No | Email subject line. |
pre_header | string | No | Preview text shown after the subject in the inbox. |
sender | object | No | { name, email, phone_number }, each optional. |
Content of a new campaign
- New content (
{ mode: "inline", content, name, brand_style_id }): the email is given as RCML incontentand styled with the chosen brand style, or the account's default one. It is checked before anything is created, so invalid content creates nothing. Withoutcontent, the campaign gets a simple placeholder email to finish in Rule. For SMS, Rule's default content is used. - Copy of an existing template (
{ mode: "reuse", template_id }): the template is copied, so later changes to the copy or the original do not affect each other. The template must be of the same type (email or SMS) as the campaign.
Notes
- A tag or segment that does not exist stops the call before anything is created, and the answer names the ids. Create the missing tag or segment in Rule and try again. If you tell the assistant to go on without them, the ones that exist are used and a warning lists the others. If none of the ids in a list exist, or none of those to include, the call still stops.
- For an email campaign, the answer includes a link that opens the campaign in Rule's editor.
Try asking: "Create a marketing email campaign called 'Spring sale' for the segment 'Newsletter subscribers', excluding the tag 'No offers', with a short announcement email."
update-campaign
Changes a campaign's name, sendout type, audience or labels. Only what you mention is changed.
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_id | number | Yes | The campaign's id. |
name | string | No | New name. |
sendout_type | marketing or transactional | No | New sendout type. |
recipients | object | No | { tag_ids, segment_ids }. A list you give replaces the current one; [] removes all. Leave a list out to keep it. |
skip_missing_recipient_ids | boolean | No | Go on without tags or segments that do not exist. See the note below. |
label_ids | array of numbers | No | Replaces all labels; [] removes all. |
- The name, sendout type and audience can only be changed while the campaign is a draft. For any other status the tool refuses, rather than appearing to succeed while Rule ignores the change.
- A tag or segment that does not exist stops the call, and the campaign's audience stays as it was. If you tell the assistant to go on without them, the ones that exist replace the list and a warning lists the others. If none of the ids in a list exist, or none of those to include, the call still stops, so this can never empty a list; use
[]for that. - Whether a campaign is email or SMS cannot be changed.
Try asking: "Rename campaign 1234 to 'Spring sale 2026' and add the VIP tag to its audience."
copy-campaign
Duplicates a campaign as a new draft, in the same account or in another account you have access to.
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_id | number | Yes | The campaign to copy. |
new_name | string | No | Name of the copy. Defaults to <name> (copy) in the same account, and to the original name in another account. |
source_account_id | number | No | To copy to another account: the account to copy from. Give it together with target_account_id. |
target_account_id | number | No | The account to copy to. |
target_brand_style_id | number | No | For a copy to another account: the brand style to apply. Defaults to the brand style with the same name, otherwise the target account's default. |
- The copy is always a draft and fully independent: its message, variants and templates are new.
- Labels are never copied.
- To another account (email campaigns only): the audience is not copied, since tags and segments differ per account; set it on the copy afterwards. Images are copied to the target account, and tags, segments and custom fields used inside the email are matched by name. A variant whose tag or segment has no match is copied without its condition, and is usually switched off by Rule; set its condition in Rule. A variant that Rule switched off because another active variant already uses the same tag or segment is reported too.
- Everything that could not be copied exactly is listed in
warnings.
Try asking: "Copy campaign 1234 from my Swedish account to my Norwegian account."
delete-campaign
Permanently deletes a campaign together with its message, variants and templates.
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_id | number | Yes | The campaign's id. |
- This cannot be undone.
- Not possible while the campaign is sent, sending, scheduled or pausing.
Try asking: "Delete the draft campaign 'Test campaign'."
Messages
get-message
Shows a campaign's message: subject, preview text, sender, the default email's content, and the list of its variants.
| Parameter | Type | Required | Description |
|---|---|---|---|
message_id | number | Yes | The message's id, shown by get-campaign. |
- Each variant is listed with its id, trigger, name, position, whether it is active, and its
template_id. Read a variant's content withget-email-template. - For messages made in Rule's older email editor, variants are not listed.
Try asking: "What variants does campaign 1234 have?"
create-message
Adds a message to a campaign that has none, for example when creating a campaign stopped half-way.
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_id | number | Yes | The campaign to add the message to. |
subject | string | No | Subject line. |
pre_header | string | No | Preview text. |
sender | object | No | { name, email, phone_number }. Defaults to the account's sender. |
- Only for draft email campaigns made in Rule's current editor that have no message yet.
- Rule renames a campaign after the message's subject when the message is created. The tool puts the campaign's name back, and warns you if that fails.
- Then add content with
create-dynamic-set.
Try asking: "Add a message with the subject 'Our spring offers' to campaign 1234."
update-message
Changes the subject, preview text or sender. Only what you mention is changed.
| Parameter | Type | Required | Description |
|---|---|---|---|
message_id | number | Yes | The message's id. |
subject | string | No | New subject. It can be replaced, but not removed. |
pre_header | string | No | New preview text. |
sender | object | No | { name, email, phone_number }. Only the parts you give are changed. |
- Only while the campaign is a draft or scheduled.
- For an email campaign, Rule keeps the campaign's name equal to the subject: changing the subject also renames the campaign. A different name set with
update-campaignis replaced the next time the subject changes.
Try asking: "Change the subject of campaign 1234 to 'Last chance: spring sale'."
delete-message
Permanently deletes a message with all its variants and templates. The campaign stays, without content, until you add a new message.
| Parameter | Type | Required | Description |
|---|---|---|---|
message_id | number | Yes | The message's id. |
- This cannot be undone.
- Not possible while the campaign is sending, scheduled or pausing.
Try asking: "Delete the message of campaign 1234 so I can start over."
Variants
In the API, variants are called dynamic sets. A variant without a trigger is the message's default content.
Who gets which variant. The variants are in order, with the default last. When the campaign is sent, each subscriber gets the first active variant they match; anyone who matches none gets the default. So if a subscriber can be in several of the chosen tags or segments, the order decides which email they get.
get-dynamic-set
Shows one variant: its trigger, name, whether it is active, its own subject, preview text and sender if they differ from the message, and its template_id.
| Parameter | Type | Required | Description |
|---|---|---|---|
dynamic_set_id | number | Yes | The variant's id, shown by get-message. |
- The default variant has no trigger.
- The email content is not included; read it with
get-email-templateand thetemplate_id.
Try asking: "Which segment sees variant 91011, and is it active?"
create-dynamic-set
Adds content to a message: the default variant, or a variant for one tag or segment.
| Parameter | Type | Required | Description |
|---|---|---|---|
message_id | number | Yes | The message's id. Email messages only. |
template | object | Yes | New content: { mode: "inline", name, template, brand_style_id } with the email as RCML. Or a copy of an existing template: { mode: "reuse", template_id }. |
trigger | object | No | { type: "segment" or "tag", id }: who sees this variant. Leave out to create the default. |
name | string | No | Variant name. Defaults to the name of its tag or segment. |
position | number | No | Where to put the variant among the others, counting from 1 at the top. Defaults to after the existing variants. The default always stays last. |
active | boolean | No | Whether the variant is switched on. Defaults to true. |
subject | string | No | A different subject for this variant only. |
pre_header | string | No | Different preview text for this variant only. |
sender | object | No | A different sender for this variant only. |
- Create the default first. A variant with a trigger can only be added once the message has a default.
- Normally, all variants share the message's subject, preview text and sender. Give them here only when this variant should differ.
- New content is checked and styled the same way as in
create-email-template. - Same tag or segment twice: if another active variant already uses the same tag or segment, Rule creates the new one switched off, since only the first would ever be sent. The answer tells you which variant already uses it.
Try asking: "Add a variant for the 'VIP customers' segment to campaign 1234, with a shorter email and a discount code."
update-dynamic-set
Changes a variant. Only what you mention is changed.
| Parameter | Type | Required | Description |
|---|---|---|---|
dynamic_set_id | number | Yes | The variant's id. |
message_id | number | Yes | The message the variant belongs to. Used to check the change against the other variants. |
name | string | No | New name. |
trigger | object or null | No | { type: "segment" or "tag", id } to change who sees it. null makes it the default. |
active | boolean | No | Switch the variant on or off. |
position | number | No | Move the variant, counting from 1 at the top. The default always stays last. |
subject | string | No | A subject for this variant only. |
pre_header | string | No | Preview text for this variant only. |
sender | object | No | A sender for this variant only. |
utm_campaign, utm_term | string or null | No | Tracking values for this variant's links. null removes one. |
template_id | number or null | No | Use another existing email template, or null to remove the content. |
- The tool refuses a change that would leave subscribers who match no variant without an email: giving the default a trigger, or switching it off, while other variants remain.
- Two active variants may use the same tag or segment, but only the first one is ever sent. The assistant points this out and lets you choose.
- After a change of trigger or order, the tool checks that the default is still last, and tells you how to fix it if not.
- Changing
template_iddeletes the previous template. If another variant used the same template, that variant loses its content; the answer warns you. To use new content, create it first withcreate-email-template. - Make sure
message_idis right: the tool cannot detect a wrong one. - Only while the campaign is a draft or scheduled.
Try asking: "Switch off the variant for the 'VIP customers' segment."
delete-dynamic-set
Permanently deletes one variant and its template.
| Parameter | Type | Required | Description |
|---|---|---|---|
dynamic_set_id | number | Yes | The variant's id. |
message_id | number | Yes | The message the variant belongs to. |
- This cannot be undone. The assistant tells you which template is deleted with it.
- The tool refuses if the variant does not belong to the given message.
- Rule allows deleting the default or the last variant. The tool does not block this, but warns you about what is left: a message with no content (it cannot be scheduled), variants without a default (subscribers who match none get nothing), or a variant left in the default's place.
- For a campaign, not possible while it is sending, scheduled or pausing. A sent campaign's variant can be deleted. Variants of automation emails can be deleted at any time, even while the automation is active.
Try asking: "Remove the 'VIP customers' variant from campaign 1234."