---
title: "Segment"
description: "Customer Segment"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/segment'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/segment.md'
---
# Segment

Customer Segment

- **Required Scopes:** `read_customers`, `write_customers`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Object

## Type Signature

`Segment`

## Fields

* `creationDate`

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

  Creation time

* `id`

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

  Global id

* `lastEditDate`

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

  Latest editing time

* `name`

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

  Segment name

* `query`

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

  Query condition value

## Schema Definition

```graphql
type Segment { 
	creationDate: Date!
	id: ID!
	lastEditDate: Date
	name: String!
	query: String! 
}
```

## Field from

* [SegmentUpdatePayload](https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/segment-update-payload.md).segment

  The updated segment.

* [SegmentCreatePayload](https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/segment-create-payload.md).segment

  Segments created

* [SegmentEdge](https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/segment-edge.md).node

  segment information

* [SegmentConnection](https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/segment-connection.md).nodes

  node list

* [Query](https://developer.shopline.com/docs/admin-graph-ql-api/customers/queries/segment.md).segment

  根据id查询分组

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

