---
title: segmentUpdate - GraphQL Admin
description: Updates a segment.
api_version: unstable
api_name: admin
source_url:
  html: https://shopify.dev/docs/api/admin-graphql/unstable/mutations/segmentUpdate
  md: https://shopify.dev/docs/api/admin-graphql/unstable/mutations/segmentUpdate.md
---

# segment​Update

mutation

Requires `write_customers` access scope. Also: The user must not have restricted access.

Updates a segment.

## Arguments

* id

  [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID)

  required

  Specifies the segment to be updated.

* name

  [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)

  The new name for the segment.

* query

  [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String)

  A precise definition of the segment. The definition is composed of a combination of conditions on facts about customers such as `email_subscription_status = 'SUBSCRIBED'` with [this syntax](https://shopify.dev/api/shopifyql/segment-query-language-reference).

***

## Segment​Update​Payload returns

* segment

  [Segment](https://shopify.dev/docs/api/admin-graphql/unstable/objects/Segment)

  The updated segment.

* user​Errors

  [\[User​Error!\]!](https://shopify.dev/docs/api/admin-graphql/unstable/objects/UserError)

  non-null

  The list of errors that occurred from executing the mutation.

***

## Examples

* ### segmentUpdate reference