1. Customers 客户
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 客户
    • Collect customer and link visitor / 采集客户信息并关联访客
      POST
    • 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 关联实体
    • 查询关联实体
      GET
    • Create or update related entity / 创建或更新关联实体
      POST
  • Customer Segments 客户分群
    • Add customer segments / 添加客户群组
    • Remove customer segments / 移除客户群组
    • Query customer segments / 查询客户群组
  • Segments 分群
    • List or get segment groups / 查询客户分群组
    • Create or reuse segment group / 创建或复用客户分群组
    • List or get static segments / 查询静态分群
    • Create or reuse static segment / 创建或复用静态分群
    • Update static segment / 更新静态分群
    • Delete static segment / 删除静态分群
  • 数据模型
    • SegmentWrite
    • SegmentDetail
    • SegmentDetailResponse
    • SegmentListResponse
    • ContentTagDetail
    • ContentTagDetailResponse
    • ContentTagListResponse
    • OAuthToken
    • OAuthError
    • SuccessEnvelope
    • AudienceGroupDetail
    • TagDetail
    • TagMembershipDetail
    • SegmentMembershipDetail
    • CustomerEventResponse
    • CodeResponse
    • CustomerDetailResponse
    • Identification
    • CustomerSaveResponse
    • DynamicBody
    • TagWrite
    • CustomerSelectors
    • AudienceGroupDetailResponse
    • CustomerTagQuery
    • AudienceGroupListResponse
    • CustomerTagChange
    • TagDetailResponse
    • CustomerSegmentQuery
    • CustomerSegmentChange
    • TagListResponse
    • CustomerTagMembershipResponse
    • CustomerTagChangeResponse
    • CustomerSegmentMembershipResponse
    • CustomerSegmentChangeResponse
    • RelatedEntityResponse
    • ErrorEnvelope
  1. Customers 客户

Create or update customer / 创建或更新客户

POST
/api/v1/customer

Purpose#

Create a customer or update/merge existing customers found by the submitted identities.

Execution logic#

1.
The JSON body must be a non-empty object. identifications, when present, must be an object/array accepted by the customer identity model; body, when present, must be an object. At least one valid identification must remain after validation.
2.
Submitted identifications and customer properties are validated against the configured identity/property definitions. allow_empty controls whether empty submitted property values are retained for processing.
3.
The service locks the customer ID and submitted identity keys, matches existing customers only by submitted identities, then creates, updates, or merges under the same critical section. Profile mobile/email values do not select a customer, even when they equal an existing customer profile value. Identity matching is mandatory and cannot be disabled.
4.
With auto_merge=false (default), the request updates the first matching customer in configured identity-priority order or creates a new customer. Submitted identities belonging to other matched customers are discarded without merging; new-identity uniqueness conflicts are reported in conflict_identifications.
5.
With auto_merge=true, all matched candidates are considered in the configured identification-priority order, not request order. The chosen target remains active. Each compatible source is merged once; its identities/body are incorporated, it becomes inactive and points to the target, and a merge event is emitted.
6.
Before accepting a source, unique identity types are checked against the target and all previously accepted sources. If a source conflicts, the entire source is skipped: it stays active, emits no merge event, is absent from merged_customers, and its identities do not reserve uniqueness for later candidates. conflict_identifications describes conflicts from newly submitted identities, not these skipped source customers.
7.
After filtering, validation, and normalization, an update that changes nothing is not saved, reports no change, and does not enqueue a customer Elasticsearch synchronization job.

Option effects#

auto_merge: only the exact query string true enables multi-customer merging.
allow_empty: only the exact query string true allows empty property values to participate; otherwise empty values are filtered according to the existing property rules.

Response, side effects, and errors#

The response identifies the resulting customer and reports creation/change, merged customers, and submitted-identity conflicts. Successful writes trigger the normal customer persistence hooks and downstream Elasticsearch synchronization. Invalid structures, identity/property values, or unresolved conflicts return a client error. Bearer authentication and this endpoint's REST permission are required.

中文说明#

用途#

创建客户,或者根据本次提交的身份标识更新/合并已有客户。

执行逻辑#

1.
JSON 请求体必须是非空对象;identifications 如有值,必须符合客户身份模型接受的对象/数组结构;body 如有值必须是对象。校验后至少要保留一个有效身份标识。
2.
身份标识和客户属性会按照系统配置的身份/属性定义校验。allow_empty 决定空属性值是否进入后续处理。
3.
服务会对客户 ID 和本次提交的身份键加锁,只按提交的身份查找已有客户,再在同一临界区内创建、更新或合并。profile 中的手机/邮箱不参与客户匹配,即使与已有客户的 profile 值相同。身份匹配是固定规则,不能关闭。
4.
auto_merge=false(默认)时,按系统配置的身份优先级更新第一个匹配客户,或创建新客户。属于其他已匹配客户的提交身份被丢弃,不合并;新提交身份的唯一性冲突写入 conflict_identifications。
5.
auto_merge=true 时,所有匹配候选按系统配置的身份优先级排序处理,而不是按请求中的顺序。选定目标客户保持启用;每个兼容来源客户只合并一次,其身份和属性并入目标,来源客户停用并指向目标,同时产生客户合并事件。
6.
接受每个来源客户前,会用目标客户和此前已接受来源中的唯一身份类型检查冲突。若某来源冲突,则整名来源客户跳过:保持启用、不产生合并事件、不出现在 merged_customers,其身份也不会占用唯一类型从而影响后续候选。conflict_identifications 只表示本次新提交身份的冲突,不表示这些被跳过的来源客户。
7.
经过过滤、校验和标准化后,如果更新没有任何实际变化,则不保存,返回未变化,也不会创建客户 Elasticsearch 同步任务。

选项影响#

auto_merge:只有查询参数的精确字符串 true 才启用多客户合并。
allow_empty:只有精确字符串 true 才允许空属性值进入处理;否则按现有属性规则过滤空值。

响应、副作用与错误#

响应返回最终客户,并报告是否创建/变化、已合并客户及新提交身份冲突。实际写入会触发正常客户保存钩子和后续 Elasticsearch 同步。结构、身份或属性值无效以及不能处理的冲突返回客户端错误。接口需要 Bearer 认证及对应 REST 权限。

请求参数

Query 参数

Body 参数application/json必填

示例
{
  "identifications": [
    {
      "key": "el_email",
      "value": "developer@example.invalid"
    }
  ],
  "body": {}
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/api/v1/customer?allow_empty=undefined&auto_merge=undefined' \
--header 'Content-Type: application/json' \
--data-raw '{
  "identifications": [
    {
      "key": "el_email",
      "value": "developer@example.invalid"
    }
  ],
  "body": {}
}'

返回响应

🟢200成功
application/json
Customer saved / 客户保存成功
Bodyapplication/json

示例
{
    "code": 200,
    "data": {
        "customer_id": "string",
        "new_identifications": [
            {
                "key": "el_email",
                "value": "user@example.com",
                "name": "string"
            }
        ],
        "conflict_identifications": [
            {
                "key": "el_email",
                "value": "user@example.com",
                "name": "string"
            }
        ],
        "merged_customer_ids": [
            "string"
        ],
        "is_new": true
    }
}
🟠400请求有误
🟠401没有权限
🟠403禁止访问
🔴500服务器错误
🟠429请求过多
修改于 2026-09-30 17:43:20
上一页
Get customer / 查询客户
下一页
List or get tag groups / 查询标签组
Built with