--- title: Segment - GraphQL Admin description: >- A group of [customers](https://shopify.dev/docs/api/admin-graphql/latest/objects/Customer) that meet specific criteria defined through [ShopifyQL query](https://shopify.dev/docs/api/shopifyql/segment-query-language-reference) conditions. Common use cases for segments include customer analytics, targeted marketing campaigns, and automated discount eligibility. The segment's [`query`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment#field-query) field contains ShopifyQL conditions that determine membership, such as purchase history, location, or engagement patterns. Tracks when the segment was created with [`creationDate`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment#field-creationDate) and when it was last modified with [`lastEditDate`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment#field-lastEditDate). api_version: 2025-10 api_name: admin type: object api_type: graphql source_url: html: 'https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment' md: 'https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment.md' --- # Segment object Requires `read_customers` access scope. Also: The user must not have restricted access. A group of [customers](https://shopify.dev/docs/api/admin-graphql/latest/objects/Customer) that meet specific criteria defined through [ShopifyQL query](https://shopify.dev/docs/api/shopifyql/segment-query-language-reference) conditions. Common use cases for segments include customer analytics, targeted marketing campaigns, and automated discount eligibility. The segment's [`query`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment#field-query) field contains ShopifyQL conditions that determine membership, such as purchase history, location, or engagement patterns. Tracks when the segment was created with [`creationDate`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment#field-creationDate) and when it was last modified with [`lastEditDate`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment#field-lastEditDate). ## Fields * creation​Date [Date​Time!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime) non-null The date and time when the segment was added to the store. * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) non-null A globally-unique ID. * last​Edit​Date [Date​Time!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime) non-null The date and time when the segment was last updated. * name [String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) non-null The name of the segment. * query [String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String) non-null A precise definition of the segment. The definition is composed of a combination of conditions on facts about customers. *** ## Map ### Fields and connections with this object * {}[DiscountCustomerSegments.segments](https://shopify.dev/docs/api/admin-graphql/latest/objects/DiscountCustomerSegments#field-DiscountCustomerSegments.fields.segments) * {}[PriceRuleCustomerSelection.segments](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleCustomerSelection#field-PriceRuleCustomerSelection.fields.segments) * <->[SegmentConnection.nodes](https://shopify.dev/docs/api/admin-graphql/latest/connections/SegmentConnection#returns-nodes) * {}[SegmentEdge.node](https://shopify.dev/docs/api/admin-graphql/latest/objects/SegmentEdge#field-SegmentEdge.fields.node) *** ## Queries * [segment](https://shopify.dev/docs/api/admin-graphql/latest/queries/segment) query Retrieves a customer [`Segment`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment) by ID. Segments are dynamic groups of customers that meet specific criteria defined through [ShopifyQL queries](https://shopify.dev/docs/api/shopifyql/segment-query-language-reference). Use segments for targeted marketing campaigns, analyzing customer behavior, or creating personalized experiences. Each segment includes its name, creation date, and the query that defines which [`Customer`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Customer) objects belong to it. * [segments](https://shopify.dev/docs/api/admin-graphql/latest/queries/segments) query Returns a paginated list of [`Segment`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Segment) objects for the shop. Segments are dynamic groups of customers that meet specific criteria defined through [ShopifyQL queries](https://shopify.dev/docs/api/shopifyql/segment-query-language-reference). You can filter segments by search query and sort them by creation date or other criteria. The query supports standard [pagination](https://shopify.dev/docs/api/usage/pagination-graphql) arguments and returns a [`SegmentConnection`](https://shopify.dev/docs/api/admin-graphql/latest/objects/SegmentConnection) containing segment details including names, creation dates, and the query definitions that determine segment membership. *** ## \Segment Queries ### Queried by * \[segment](https://shopify.dev/docs/api/admin-graphql/latest/queries/segment) * \[segments](https://shopify.dev/docs/api/admin-graphql/latest/queries/segments) *** ## Mutations * [segment​Create](https://shopify.dev/docs/api/admin-graphql/latest/mutations/segmentCreate) mutation Creates a segment. * [segment​Update](https://shopify.dev/docs/api/admin-graphql/latest/mutations/segmentUpdate) mutation Updates a segment. *** ## <\~> Segment Mutations ### Mutated by * <\~>[segment​Create](https://shopify.dev/docs/api/admin-graphql/latest/mutations/segmentCreate) * <\~>[segment​Update](https://shopify.dev/docs/api/admin-graphql/latest/mutations/segmentUpdate) *** ## Interfaces * [Node](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/Node) interface *** ## ||-Segment Implements ### Implements * ||-[Node](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/Node)