---
title: "segmentMigrations"
description: "Saved segment list"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/customers/queries/segment-migrations'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/customers/queries/segment-migrations.md'
---
# segmentMigrations

Saved segment list

- **Required Scopes:** `read_customers`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`SegmentMigrationConnection`

## Required Permissions

* `read_customers`

An access token is required to call this API. Refer to [Authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md) for more information about how to obtain the token.

## Arguments

* `savedSearchId`

  [String](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/string.md)

  Migration through the saved search id search segment .

* `after`

  [String](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/string.md)

  Returns elements following the specified cursor. The `first` argument must also be specified when using this argument.

* `before`

  [String](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/string.md)

  Returns elements preceding the specified cursor. The `last` argument must also be specified when using this argument.

* `first`

  [Int](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/int.md)

  Returns the first n elements in the list. 

* `last`

  [Int](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/int.md)

  Returns the last n elements in the list. 

* `reverse`

  [Boolean](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/boolean.md)

  Whether to reverse the order of the list. 
  
  ● true: reverse
  
  ● false: do not reverse
  
  Default value: false

## Returns

* `edges`

  [[SegmentMigrationEdge!]](https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/segment-migration-edge.md)

  edges list

* `nodes`

  [[SegmentMigration]](https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/segment-migration.md)

  node list

* `pageInfo`

  [PageInfo!](https://developer.shopline.com/docs/admin-graph-ql-api/common-objects/objects/page-info.md)

  Information to aid in pagination.

## Code Example

```graphql
 {
	segmentMigrations(savedSearchId, after, before, first, last, reverse ) 
		 {
			# SegmentMigrationConnection fields
		}
}
```

## Examples

### segment migrations

Query the merchant’s saved segment list

**Request:**

```json
query {
  segmentMigrations(first: 3, after:null,reverse:false,savedSearchId:null) {
    edges {
      cursor
      node {
        id
        savedSearchId
      }
    }
    nodes {
        id
        savedSearchId
    }
    pageInfo {
        endCursor
        hasNextPage
        hasPreviousPage
        startCursor
    }
  }
}

```

**Response:**

```json
{
  "data": {
    "data": {
      "segmentMigrations": {
        "edges": [
          {
            "cursor": "39C77C6A85E202FDAAB6A0D829D4F007",
            "node": {
              "id": "gid://shopline/SegmentMigration/GROUP5582449353606848831",
              "savedSearchId": "GROUP5582449353606848831"
            }
          },
          {
            "node": {
              "id": "gid://shopline/SegmentMigration/GROUP5582449353892061504",
              "savedSearchId": "GROUP5582449353892061504"
            },
            "cursor": "AF52536A1951B28A30AAE8825A2B69B9"
          },
          {
            "cursor": "E002CE0E792FBA4E98672D39851FDFD6",
            "node": {
              "id": "gid://shopline/SegmentMigration/GROUP5582449354143719745",
              "savedSearchId": "GROUP5582449354143719745"
            }
          }
        ],
        "nodes": [
          {
            "id": "gid://shopline/SegmentMigration/GROUP5582449353606848831",
            "savedSearchId": "GROUP5582449353606848831"
          },
          {
            "savedSearchId": "GROUP5582449353892061504",
            "id": "gid://shopline/SegmentMigration/GROUP5582449353892061504"
          },
          {
            "id": "gid://shopline/SegmentMigration/GROUP5582449354143719745",
            "savedSearchId": "GROUP5582449354143719745"
          }
        ],
        "pageInfo": {
          "hasPreviousPage": false,
          "startCursor": "39C77C6A85E202FDAAB6A0D829D4F007",
          "endCursor": "E002CE0E792FBA4E98672D39851FDFD6",
          "hasNextPage": true
        }
      }
    }
  }
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

