1. Customer Segments 客户分群
EventLightning CDP
  • Content tags 内容标签
    • List or get content tags / 查询内容标签
      GET
    • Create or reuse content tag / 创建或复用内容标签
      POST
    • Update content tag / 更新内容标签
      PUT
    • Delete content tag / 删除内容标签
      DELETE
    • List or get content tag groups / 查询内容标签组
      GET
    • Create or reuse content tag group / 创建或复用内容标签组
      POST
  • Authentication 认证
    • Get access token / 获取访问令牌
      POST
  • Customers 客户
    • Get customer / 查询客户
      GET
    • Create or update customer / 创建或更新客户
      POST
  • Tags 标签
    • List or get tag groups / 查询标签组
      GET
    • Create or reuse tag group / 创建或复用标签组
      POST
    • List or get static tags / 查询静态标签
      GET
    • Create or reuse static tag / 创建或复用静态标签
      POST
    • Update static tag / 更新静态标签
      PUT
    • Delete static tag / 删除静态标签
      DELETE
  • Customer Tags 客户标签
    • Add customer tags / 添加客户标签
      POST
    • Remove customer tags / 移除客户标签
      POST
    • Query customer tags / 查询客户标签
      POST
  • Events 客户事件
    • 查询客户事件
      GET
    • Create customer event / 创建客户事件
      POST
  • Related Entities 关联实体
    • 查询关联实体
    • Create or update related entity / 创建或更新关联实体
  • Customer Segments 客户分群
    • Add customer segments / 添加客户群组
      POST
    • Remove customer segments / 移除客户群组
      POST
    • List or get segment groups / 查询客户分群组
      GET
    • Create or reuse segment group / 创建或复用客户分群组
      POST
    • Query customer segments / 查询客户群组
      POST
  • 数据模型
    • OAuthToken
    • OAuthError
    • SuccessEnvelope
    • AudienceGroupDetail
    • TagDetail
    • TagMembershipDetail
    • SegmentMembershipDetail
    • CustomerEventResponse
    • CodeResponse
    • CustomerDetailResponse
    • Identification
    • CustomerSaveResponse
    • DynamicBody
    • TagWrite
    • CustomerSelectors
    • AudienceGroupDetailResponse
    • CustomerTagQuery
    • AudienceGroupListResponse
    • CustomerTagChange
    • TagDetailResponse
    • CustomerSegmentQuery
    • TagListResponse
    • CustomerSegmentChange
    • CustomerTagMembershipResponse
    • CustomerTagChangeResponse
    • CustomerSegmentMembershipResponse
    • CustomerSegmentChangeResponse
    • RelatedEntityResponse
    • ErrorEnvelope
  1. Customer Segments 客户分群

Create or reuse segment group / 创建或复用客户分群组

POST
/api/v1/segment-groups

Purpose#

Create or reuse a customer-segment group and optionally set its parent.

Execution logic#

1.
The request body must be a non-empty object and label must be present as a string.
2.
Parent resolution gives parent_group_id precedence over parent_label. parent_group_id must decode to an existing customer-segment group. parent_label performs an exact label lookup within customer-segment groups.
3.
Creation is serialized by group type and label. If a group with the same type and exact label exists, it is reused instead of duplicated.
4.
The resolved parent is assigned to both new and reused groups. Therefore, supplying a different parent changes the existing group's parent; omitting both parent fields resolves to no parent and can clear an existing parent. The entity is saved only when it is new or the parent actually changes.
5.
The response returns encoded group_id, label, encoded parent_group_id (0 for none), plus created and changed.

Errors and authorization#

Malformed IDs, missing parents, parents of another group type, and invalid field types return a client error. Bearer authentication and this endpoint's REST permission are required.

中文说明#

用途#

创建或复用一个客户标签分组,并可设置其父分组。

执行逻辑#

1.
请求体必须是非空对象,且必须提供字符串类型的 label。
2.
父分组解析时 parent_group_id 优先于 parent_label。parent_group_id 必须能解码并指向已存在的客户标签分组;parent_label 则在客户标签分组类型内按名称精确匹配。
3.
创建过程按“分组类型 + 名称”串行化;相同类型、相同精确名称的分组已存在时会复用,不会重复创建。
4.
解析出的父级会同时应用于新分组和复用分组。因此传入不同父级会修改已有分组的父级;两个父级字段都省略时会解析为无父级,并可能清除已有父级。只有新建或父级确实变化时才保存。
5.
响应返回编码 group_id、label、编码 parent_group_id(无父级为 0),以及 created、changed。

错误与权限#

ID 格式错误、父分组不存在、父分组类型不符或字段类型无效均返回客户端错误。接口需要 Bearer 认证及对应 REST 权限。

请求参数

Body 参数application/json必填

示例
{
  "label": "VIP 客户",
  "parent_group_id": "{{parent_group_id}}"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/api/v1/segment-groups' \
--header 'Content-Type: application/json' \
--data '{
  "label": "VIP 客户",
  "parent_group_id": "{{parent_group_id}}"
}'

返回响应

🟢200成功
application/json
Group saved / 标签组保存成功
Bodyapplication/json

示例
{
    "code": 200,
    "data": {
        "group_id": "string",
        "label": "string",
        "parent_group_id": "string",
        "created": 0,
        "changed": 0
    }
}
🟠400请求有误
🟠401没有权限
🟠403禁止访问
🔴500服务器错误
修改于 2026-09-21 10:46:07
上一页
List or get segment groups / 查询客户分群组
下一页
Query customer segments / 查询客户群组
Built with