> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MessageDecision

> One decision about whether Redo may, or will, message a shopper, and why. Kept for one year.

**Required scopes:** [`customers_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-customers_read)

**automation** `[MarketingAutomation](/docs/api-reference/v3/reference/marketing/marketing-automation)`

The marketing automation the decision belongs to, if any.

**fields**

**analytics** `[MarketingAutomationAnalytics!](/docs/api-reference/v3/reference/marketing/marketing-automation-analytics)` *required*

Analytics for this marketing automation, grouped by what is being measured.

**fields**

**messaging** `[MarketingAutomationMessagingAnalytics!](/docs/api-reference/v3/reference/marketing/marketing-automation-messaging-analytics)` *required*

Email and SMS performance: 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, Commerce Agent steps included. Each order is credited to the last marketing or Commerce Agent message before it, so a later message from outside the automation takes the credit.

**Requires:** [`marketing_automations_analytics_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-marketing_automations_analytics_read)

**fields**

**Arguments**

**attributionWindowDays** `Int`

Deprecated. How many days after a message an order still counts toward it, 1-30, in place of the store's own windows. **(Deprecated)**

**audience** `[MarketingAudience](/docs/api-reference/v3/reference/marketing/marketing-audience)`

Report only messages to this audience, and the orders and revenue credited to them. Omit it for both. Credit is assigned across both audiences first, so the two add up to the unsplit figures. `delivered`, `failures` and `unsubscribes` aren't recorded per audience: deliveries and failures count toward `SUBSCRIBERS`, and `unsubscribes` reports the whole send's. Rates divided by `delivered` are therefore not comparable between the two audiences.

**endDate** `[Date!](/docs/api-reference/v3/reference/common/date)` *required*

Last day to report on, inclusive, in the store's timezone. The range may span at most 400 days.

**startDate** `[Date!](/docs/api-reference/v3/reference/common/date)` *required*

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.

**steps** `[\[MarketingAutomationStepAnalytics!\]](/docs/api-reference/v3/reference/marketing/marketing-automation-step-analytics)`

Per-step performance: what each step sent, how shoppers engaged and replied, and the orders and revenue credited to it. Credit is the same as `messaging`'s, split by the step whose message won, so don't add the two together; credit to a message with no step isn't listed here. Lists only steps with activity in the range.

**Requires:** [`marketing_automations_analytics_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-marketing_automations_analytics_read)

**fields**

**Arguments**

**attributionWindowDays** `Int`

Deprecated. How many days after a message an order still counts toward it, 1-30, in place of the store's own windows. **(Deprecated)**

**audience** `[MarketingAudience](/docs/api-reference/v3/reference/marketing/marketing-audience)`

Report only messages to this audience, and the orders and revenue credited to them. Omit it for both. Credit is assigned across both audiences first, so the two add up to the unsplit figures. `delivered`, `failures` and `unsubscribes` aren't recorded per audience: deliveries and failures count toward `SUBSCRIBERS`, and `unsubscribes` reports the whole send's. Rates divided by `delivered` are therefore not comparable between the two audiences.

**endDate** `[Date!](/docs/api-reference/v3/reference/common/date)` *required*

Last day to report on, inclusive, in the store's timezone. The range may span at most 400 days.

**startDate** `[Date!](/docs/api-reference/v3/reference/common/date)` *required*

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.

**category** `[MarketingAutomationCategory!](/docs/api-reference/v3/reference/marketing/marketing-automation-category)` *required*

Which trigger family this marketing automation belongs to.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the automation was created.

**description** `String`

The merchant's description of what this automation does.

**enabled** `Boolean!` *required*

Whether the automation is currently running.

**id** `ID!` *required*

The id of this automation.

**legacyId** `String!` *required*

The automation's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.

**name** `String!` *required*

The merchant-facing name of the automation.

**publishedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the current version was published. Null while it has only ever been a draft.

**steps** `[\[MarketingAutomationStep!\]!](/docs/api-reference/v3/reference/marketing/marketing-automation-step)` *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.

**stepsJson** `[\[JSON!\]!](/docs/api-reference/v3/reference/common/json)` *required*

`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.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the automation was last updated.

**automationRunId** `String`

The automation run the decision was part of.

**automationStepId** `String`

The automation step that decided.

**campaign** `[Campaign](/docs/api-reference/v3/reference/marketing/campaign)`

The campaign the decision belongs to, if any.

**fields**

**analytics** `[CampaignAnalytics!](/docs/api-reference/v3/reference/marketing/campaign-analytics)` *required*

Analytics for this campaign, grouped by what is being measured.

**fields**

**messaging** `[CampaignMessagingAnalytics!](/docs/api-reference/v3/reference/marketing/campaign-messaging-analytics)` *required*

Email and SMS performance: what was sent, how it was engaged with, and the orders and revenue attributed to it. Each order is credited to the last marketing or Commerce Agent message before it, Commerce Agent replies to the campaign included, so a later message from outside the campaign takes the credit.

**Requires:** [`campaigns_analytics_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-campaigns_analytics_read)

**fields**

**Arguments**

**attributionWindowDays** `Int`

Deprecated. How many days after a message an order still counts toward it, 1-30, in place of the store's own windows. **(Deprecated)**

**audience** `[MarketingAudience](/docs/api-reference/v3/reference/marketing/marketing-audience)`

Report only messages to this audience, and the orders and revenue credited to them. Omit it for both. Credit is assigned across both audiences first, so the two add up to the unsplit figures. `delivered`, `failures` and `unsubscribes` aren't recorded per audience: deliveries and failures count toward `SUBSCRIBERS`, and `unsubscribes` reports the whole send's. Rates divided by `delivered` are therefore not comparable between the two audiences.

**endDate** `[Date!](/docs/api-reference/v3/reference/common/date)` *required*

Last day to report on, inclusive, in the store's timezone. The range may span at most 400 days.

**startDate** `[Date!](/docs/api-reference/v3/reference/common/date)` *required*

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.

**canceledAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the merchant canceled the campaign, if they did.

**channel** `[MarketingChannel!](/docs/api-reference/v3/reference/marketing/marketing-channel)` *required*

The channel this campaign sends on.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the campaign was created.

**emailVariants** `[\[CampaignEmailVariant!\]!](/docs/api-reference/v3/reference/marketing/campaign-email-variant)` *required*

The email content this campaign sends, oldest arm first. A campaign that is not split-testing has exactly one entry; there is no separate `subject` on the campaign because a split test has more than one.

**fields**

**abTestWeight** `Float!` *required*

The share of recipients this variant was sent to. A campaign with a single variant weights it 1.

**position** `Int!` *required*

This variant's position within the campaign, starting at 0. Stable, so it names an arm of a split test across reports.

**template** `[EmailTemplate](/docs/api-reference/v3/reference/marketing/email-template)`

The content this variant sent. Null when the template has since been deleted.

**Requires:** [`marketing_templates_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-marketing_templates_read)

**errorCode** `[CampaignErrorCode](/docs/api-reference/v3/reference/marketing/campaign-error-code)`

Why the campaign failed, when it did.

**excludedSegments** `[\[Segment!\]!](/docs/api-reference/v3/reference/marketing/segment)` *required*

The segments held out of this campaign.

**Requires:** [`segments_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-segments_read)

**fields**

**conditions** `[JSON](/docs/api-reference/v3/reference/common/json)`

Dynamic segment condition tree. Null for static and persona segments.

**countsRefreshedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the member counts were last recalculated. They are not live.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the segment was created.

**description** `String`

The merchant's description of who this segment is for.

**emailSubscriberCount** `Int`

Members subscribed to email marketing as of `countsRefreshedAt`.

**id** `ID!` *required*

The id of this segment.

**legacyId** `String!` *required*

The segment's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.

**memberCount** `Int`

Customers in the segment as of `countsRefreshedAt`. Null until it has first been counted.

**name** `String!` *required*

The merchant-facing name of the segment.

**smsSubscriberCount** `Int`

Members subscribed to SMS marketing as of `countsRefreshedAt`.

**type** `[SegmentType!](/docs/api-reference/v3/reference/marketing/segment-type)` *required*

How membership of this segment is determined.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the segment was last updated.

**failedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the campaign failed to send, if it did.

**followUpConfig** `[CampaignFollowUpConfig](/docs/api-reference/v3/reference/marketing/campaign-follow-up-config)`

Follow-up email configuration when one was enabled.

**fields**

**delayMs** `Float`

Delay after the original send before the follow-up goes out.

**enabled** `Boolean!` *required*

Whether a follow-up send is configured.

**engagementPeriod** `[CampaignFollowUpEngagementPeriod](/docs/api-reference/v3/reference/marketing/campaign-follow-up-engagement-period)`

Engagement window, in days, used to pick recipients.

**originalCampaignLegacyId** `String`

Legacy Mongo ObjectId of the campaign this follow-up was created from.

**subjectLine** `String`

Subject line for the follow-up email.

**fromAddress** `[EmailAddress](/docs/api-reference/v3/reference/marketing/email-address)`

The from address recorded when the campaign sent. Null for drafts and for SMS campaigns.

**fields**

**email** `String!` *required*

The mailbox address.

**name** `String!` *required*

The display name shown alongside the address.

**fromSender** `[EmailSender](/docs/api-reference/v3/reference/marketing/email-sender)`

The From mailbox chosen for this campaign. Null when the store default should be used, and for SMS.

**Requires:** [`campaigns_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-campaigns_read)

**fields**

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the address was added.

**email** `String!` *required*

The mailbox address.

**id** `ID!` *required*

The id of this sender address. Pass it to `updateCampaign`.

**name** `String!` *required*

The display name shown alongside the address.

**id** `ID!` *required*

The id of this campaign.

**legacyId** `String!` *required*

The campaign's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.

**name** `String!` *required*

The merchant-facing name of the campaign.

**replyToAddress** `[EmailAddress](/docs/api-reference/v3/reference/marketing/email-address)`

The reply-to address recorded when the campaign sent. Null when none was set.

**fields**

**email** `String!` *required*

The mailbox address.

**name** `String!` *required*

The display name shown alongside the address.

**replyToSender** `[EmailSender](/docs/api-reference/v3/reference/marketing/email-sender)`

The Reply-To mailbox chosen for this campaign. Null when the store default should be used.

**Requires:** [`campaigns_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-campaigns_read)

**fields**

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the address was added.

**email** `String!` *required*

The mailbox address.

**id** `ID!` *required*

The id of this sender address. Pass it to `updateCampaign`.

**name** `String!` *required*

The display name shown alongside the address.

**scheduledAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the campaign is scheduled to start sending. Null for drafts, and for campaigns scheduled in each recipient's local time.

**scheduledAtTimeZone** `String`

IANA time zone the merchant picked when scheduling a single UTC instant. Null for drafts and local-time sends.

**scheduledLocalFallbackTimeZone** `String`

IANA time zone used when a recipient has no time zone, for local-time sends. Null when `scheduledAt` is set.

**scheduledLocalTime** `String`

For campaigns scheduled in each recipient's local time, the wall-clock time they send at, as `YYYY-MM-DDTHH:mm:ss`. Null when `scheduledAt` is set.

**segments** `[\[Segment!\]!](/docs/api-reference/v3/reference/marketing/segment)` *required*

The segments this campaign was sent to.

**Requires:** [`segments_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-segments_read)

**fields**

**conditions** `[JSON](/docs/api-reference/v3/reference/common/json)`

Dynamic segment condition tree. Null for static and persona segments.

**countsRefreshedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the member counts were last recalculated. They are not live.

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the segment was created.

**description** `String`

The merchant's description of who this segment is for.

**emailSubscriberCount** `Int`

Members subscribed to email marketing as of `countsRefreshedAt`.

**id** `ID!` *required*

The id of this segment.

**legacyId** `String!` *required*

The segment's legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.

**memberCount** `Int`

Customers in the segment as of `countsRefreshedAt`. Null until it has first been counted.

**name** `String!` *required*

The merchant-facing name of the segment.

**smsSubscriberCount** `Int`

Members subscribed to SMS marketing as of `countsRefreshedAt`.

**type** `[SegmentType!](/docs/api-reference/v3/reference/marketing/segment-type)` *required*

How membership of this segment is determined.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the segment was last updated.

**sentAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the campaign finished sending. Null until it has finished.

**smsVariants** `[\[CampaignSmsVariant!\]!](/docs/api-reference/v3/reference/marketing/campaign-sms-variant)` *required*

The SMS content this campaign sends, oldest arm first. Empty for email campaigns.

**fields**

**abTestWeight** `Float!` *required*

The share of recipients this variant was sent to. A campaign with a single variant weights it 1.

**position** `Int!` *required*

This variant's position within the campaign, starting at 0.

**template** `[SmsTemplate](/docs/api-reference/v3/reference/marketing/sms-template)`

The content this variant sent. Null when the template has since been deleted.

**Requires:** [`marketing_templates_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-marketing_templates_read)

**status** `[CampaignStatus!](/docs/api-reference/v3/reference/marketing/campaign-status)` *required*

Derived lifecycle status from schedule, send, failure, and cancellation timestamps.

**tags** `[String!]!` *required*

Tags the merchant applied to this campaign, in the order they applied them. Free-form and merchant-defined — Redo attaches no meaning to them, so they are the place a store's own categorisation (a promotion name, a season, a product line) is kept. Empty when the campaign is untagged.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the campaign was last updated.

**channel** `[MarketingChannel](/docs/api-reference/v3/reference/marketing/marketing-channel)`

The channel of the message decided on. Null when the decision wasn't about one channel.

**customer** `[Customer](/docs/api-reference/v3/reference/customers/customer)`

The customer record Redo used. Null when Redo decided from a phone number or email alone.

**fields**

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the customer record was created.

**customFields** `[JSON](/docs/api-reference/v3/reference/common/json)`

Merchant-defined custom field values, keyed by each field's name. Null when the customer has no custom fields set.

**email** `String`

The customer's primary email address.

**firstName** `String`

The customer's first name.

**id** `ID!` *required*

The id of this customer.

**lastName** `String`

The customer's last name.

**legacyId** `String!` *required*

The customer's legacy identifier (the source Mongo ObjectId), accepted anywhere an `id` is.

**location** `[CustomerLocation](/docs/api-reference/v3/reference/customers/customer-location)`

The customer's current location, if known.

**fields**

**city** `String`

The city, town, or village.

**country** `String`

The country name.

**countryCode** `String`

The country code.

**ianaTimeZoneName** `String`

The IANA time zone name for the location (e.g. America/New\_York).

**latitude** `Float`

The latitude of the location, if geocoded.

**longitude** `Float`

The longitude of the location, if geocoded.

**postalCode** `String`

The postal or ZIP code.

**state** `String`

The state, province, or region name.

**stateCode** `String`

The state, province, or region code.

**street1** `String`

The first line of the street address.

**street2** `String`

The second line of the street address.

**phoneNumber** `String`

The customer's primary phone number.

**supportTickets** `[SupportTicketConnection!](/docs/api-reference/v3/pagination)` *required*

The help desk tickets this customer is the primary contact on any thread of, newest first. Every ticket whose `customer` is this customer is here.

**Requires:** [`support_tickets_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_tickets_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns tickets after it.

**before** `String`

Backward pagination cursor — returns tickets before it.

**first** `Int`

Forward pagination: returns the first N tickets (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N tickets (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**Fields**

**edges** `[\[SupportTicketEdge!\]!](/docs/api-reference/v3/pagination)` *required*

The list of edges (each a node plus its pagination `cursor`).

**nodes** `[\[SupportTicket!\]!](/docs/api-reference/v3/reference/support/support-ticket)` *required*

The nodes in this page, without the edge/cursor wrapper — a convenience over `edges`.

**pageInfo** `[PageInfo!](/docs/api-reference/v3/pagination)` *required*

Pagination metadata for the current page.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the customer record was last updated.

**definitionKind** `[MessageDecisionDefinitionKind!](/docs/api-reference/v3/reference/marketing/message-decision-definition-kind)` *required*

What the decision belongs to.

**definitionUpdatedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the campaign or automation had last been edited as of this decision, so you can tell which version decided. Null when unknown.

**id** `ID!` *required*

The id of this decision.

**identifiers** `[String!]!` *required*

The shopper's identifiers the decision used, like `email:jane@example.com` or `phoneNumber:+15555550100`.

**inputs** `[JSON!](/docs/api-reference/v3/reference/common/json)` *required*

The facts the decision used, like the quiet hours window. Their shape depends on the reason.

**occurredAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When Redo decided.

**outcome** `[MessageDecisionOutcome!](/docs/api-reference/v3/reference/marketing/message-decision-outcome)` *required*

Which way the decision went.

**reason** `[MessageDecisionReason!](/docs/api-reference/v3/reference/marketing/message-decision-reason)` *required*

Why the decision went that way.

**reasonDescription** `String!` *required*

What `reason` means, in plain words.

**references** `[String!]!` *required*

Other Redo objects the decision used, like `subscribe-keyword:<id>`.

**sendId** `String`

The one message to one shopper the decision was about. Every decision about that message shares it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.