marketing_automations_write
Arguments
ID!
required
The automation’s
id, or its legacyId from an earlier version of the Redo API.Surgical step edits, applied in order.
Show fields
Show fields
Insert a new step.
Show fields
Show fields
ID
Insert on the outgoing edge of this parent step.
ID
Insert immediately before this child. The child must have exactly one incoming edge.
Which condition arm to attach to.
Insertable only when the trigger schema has an Email field (not SMS signup).
Insertable only when the trigger schema has a Phone field (not email signup, HSA, or extended warranty).
Insert requires an http or https destinationUrl and a payload.
Start a Commerce Agent conversation. Insertable when Commerce Agent is enabled, the trigger supports it, and the trigger schema has an Email or Phone field. Requires strategyId.
ID
Which A/B variant arm to attach to.
Remove a step.
Show fields
Show fields
ID!
required
The step’s id.
Patch an existing step.
Show fields
Show fields
ID!
required
The step’s id.
Patch the trigger. Cannot change key or schemaType.
Returns
A marketing automation: a flow that sends email or SMS to customers when a trigger fires.
Show fields
Show fields
required
Analytics for this marketing automation, grouped by what is being measured.
Show fields
Show fields
Email and SMS performance, read from the analytics warehouse: what was sent, how it was engaged with, and the orders and revenue attributed to it. Covers messages sent by the automation’s own send steps; Recover conversations are measured separately and are not included here.Requires:
marketing_automations_analytics_readShow fields
Show fields
ArgumentsFields
Int
How many days after a message an order still counts toward it, 1-30.
Last day to report on, inclusive, in the store’s timezone. The range may span at most 400 days.
First day to report on, inclusive, in the store’s timezone. Must be on or before
endDate, and the range may span at most 400 days.required
One entry per day with activity, oldest first. Quiet days are omitted rather than reported as zero.
required
Totals across the whole range. A marketing automation with no activity reports zero counts and null rates.
required
Which trigger family this marketing automation belongs to.
String
The merchant’s description of what this automation does.
Boolean!
required
Whether the automation is currently running.
ID!
required
The id of this automation.
String!
required
The automation’s legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
String!
required
The merchant-facing name of the automation.
required
The nodes that make up this automation, including graph edges as step ids. A type this API version does not model field-by-field is returned as MarketingAutomationUnknownStep.
steps with every field selected, as JSON: one element per step, with __typename. Null and invalid stored steps are []. Webhook header values and OAuth client secrets are omitted. Edits go through operations.Example
mutation {
updateMarketingAutomation(id: "...", input: { ... }, operations: { ... }) {
category
createdAt
description
enabled
id
legacyId
name
publishedAt
# ...
}
}