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

# segmentDuplicate

> Copy a dynamic segment's conditions into a new dynamic segment. Returns null if no owned segment matches the id. Fails with UNSUPPORTED_SEGMENT_TYPE for static and persona segments.

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

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

## Arguments

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

The `id` (or `legacyId`) of the dynamic segment to copy.

**name** `String`

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

## Returns

**segmentDuplicate** `[Segment](/docs/api-reference/v3/reference/marketing/segment)`

A group of customers that campaigns and automations send to.

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

## Example

```graphql theme={null}
mutation {
  segmentDuplicate(id: "...", name: "...") {
    conditions
    countsRefreshedAt
    createdAt
    description
    emailSubscriberCount
    id
    legacyId
    memberCount
    # ...
  }
}
```


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