---
title: "segmentUpdate"
description: "更新细分信息"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/mutations/segment-update'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/mutations/segment-update.md'
---
# segmentUpdate

更新细分信息

- **Required Scopes:** `write_customers`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Type Signature

`SegmentUpdatePayload`

## Required Permissions

* `write_customers`

接口访问需要令牌，具体如何获取令牌请参考：[身份认证](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md)

## Arguments

* `id`

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

  指定要更新的细分。

* `name`

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

  细分的新名称。

* `query`

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

  查询条件,json字符串

## Returns

* `segment`

  [Segment](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/segment.md)

  更新分段的信息

* `userErrors`

  [[BusinessCustomerUserError]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/customers/objects/business-customer-user-error.md)

  错误信息

## Code Example

```graphql
mutation segmentUpdate($id: ID! $name: String! $query: String! ) {
	segmentUpdate(id: $id, name: $name, query: $query ) 
		 {
			# SegmentUpdatePayload fields
		}
		
	}

```

## Variables

```json
{
  "id": {},
  "name": {},
  "query": {}
}
```

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

