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

# duplicateCampaign

> Copy a campaign into a new draft: its audience, tags, sender, follow-up email and send settings, and a new copy of each email or SMS variant. The copy has no schedule and sends nothing until `updateCampaign` schedules it. Returns null if no campaign with that id is owned by the caller.

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

**Store must have one of:** `EMAIL_SMS`

## Arguments

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

The campaign's `id`, or its `legacyId` from an earlier version of the Redo API.

**name** `String`

The copy's name. Defaults to the original's name followed by " (Copy)".

## Returns

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

A one-off marketing send to a set of segments, on a single channel.

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

**Fields**

**series** `[\[MessageAnalyticsPoint!\]!](/docs/api-reference/v3/reference/marketing/message-analytics-point)` *required*

One entry per day with activity, oldest first. Quiet days are omitted rather than reported as zero.

**totals** `[MessageAnalyticsTotals!](/docs/api-reference/v3/reference/marketing/message-analytics-totals)` *required*

Totals across the whole range. A campaign with no activity reports zero counts and null rates.

**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)

**fields**

**contentBackgroundColor** `String!` *required*

The content canvas background, as set under Email styles in the email builder.

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

When the template was created.

**emailBackgroundColor** `String!` *required*

The email background, as set under Email styles in the email builder.

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

The id of this template.

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

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

**linkColor** `String`

The default link color, as set under Email styles in the email builder. Null when the merchant left it unset.

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

The merchant-facing name of the template.

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

Render this template, to see what recipients get. Use a width of about 375 for a phone.

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

**fields**

**Arguments**

**eventId** `ID`

Render with this recent event's data instead of sample data: a 24-character hex event id. A well-formed id that can't be found falls back to sample data.

**width** `Int`

Viewport width of the screenshot, 320-1200 pixels.

**previewText** `String`

The preview text shown after the subject in an inbox. Null when the merchant left it unset.

**sections** `[\[EmailTemplateSection!\]!](/docs/api-reference/v3/reference/marketing/email-template-section)` *required*

The blocks that make up the email body, in order. Nested column children keep their own ids. A type this API version does not model field-by-field is returned as EmailTemplateUnknownSection.

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

`sections` with every field selected, as JSON: one element per root block, in order, with `__typename` and nested column children. Empty or unreadable stored sections are \[]. Edits go through operations.

**subject** `String!` *required*

The subject line **as authored**, before per-recipient substitution. A subject containing `{{ }}` placeholders is filled in per customer at send time, and some sends prepend a prefix, so this is not necessarily the subject any one customer saw. Empty when the template has no subject of its own.

**trigger** `[MarketingTrigger!](/docs/api-reference/v3/reference/marketing/marketing-trigger)` *required*

The trigger context this template is valid for. Immutable after create. UNKNOWN when the stored trigger is not modeled in this API version.

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

When the template was last edited. Templates stay editable after the campaigns that used them have finished, so compare this against a campaign's `finishedAt` to tell whether the content here is still what that campaign actually sent.

**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)

**fields**

**autoShortenLinks** `Boolean!` *required*

Whether links in the body are shortened at send time.

**content** `String!` *required*

The SMS body **as authored**, before per-recipient substitution.

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

When the template was created.

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

The id of this template.

**images** `[\[SmsTemplateImage!\]!](/docs/api-reference/v3/reference/marketing/sms-template-image)` *required*

Images sent with the message as MMS, in order. Dynamic product images and contact cards set in the editor are not listed.

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

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

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

The merchant-facing name of the template.

**trigger** `[MarketingTrigger!](/docs/api-reference/v3/reference/marketing/marketing-trigger)` *required*

The trigger context this template is valid for. Immutable after create. UNKNOWN when the stored trigger is not modeled in this API version.

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

When the template was last edited.

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

## Example

```graphql theme={null}
mutation {
  duplicateCampaign(id: "...", name: "...") {
    canceledAt
    channel
    createdAt
    errorCode
    failedAt
    id
    legacyId
    name
    # ...
  }
}
```


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