1. Events 客户事件
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. Events 客户事件

Create customer event / 创建客户事件

POST
/api/v1/customer-events

Purpose#

Create a customer event or update an existing event selected by the event deduplication key.

Customer and event logic#

1.
The request must be a non-empty JSON object. body, when present, must be an object; content_tag_ids, when present, must be an array.
2.
customer_id takes precedence over identification. A customer ID is decoded; an identification requires non-empty string key/value and exact matching. If the matched customer is inactive, the resolver follows merge links to the final active customer; missing, cyclic, invalid, inactive-terminal, or excessively long chains fail. An event always requires a resolved customer.
3.
event_setting_id, event_created, and customer are required. System-reserved event setting IDs are rejected. body is validated by the configured event-property definitions; optional external_id and content_tag_ids are assigned.
4.
Persistence is serialized by a deduplication lock. If external_id is non-empty, it alone is the lookup key across events. Otherwise the key is (customer_id, event_setting_id, event_created). The first matching record ID is reused and saved as an update; no match creates a new event. Consequently, resubmitting the same key can overwrite the matched event's supplied fields rather than create another event.
5.
Normal event save hooks enqueue downstream Elasticsearch synchronization. The response returns the resulting event/customer IDs, time, setting, tags, and normalized body.

Errors and authorization#

Invalid customer selectors, reserved/missing event settings, missing event time, or invalid properties return a client error. Bearer authentication and this endpoint's REST permission are required.

中文说明#

用途#

创建客户事件,或按事件去重键更新已有事件。

客户与事件逻辑#

1.
请求必须是非空 JSON 对象;body 如有值必须是对象,content_tag_ids 如有值必须是数组。
2.
customer_id 优先于 identification。客户 ID 会解码;身份标识要求非空字符串 key、value 并精确匹配。若匹配客户已停用,解析器会沿合并链找到最终启用客户;记录缺失、循环、无效、终点仍停用或链过长均失败。事件必须解析到客户。
3.
event_setting_id、event_created 和客户必填;系统保留的事件类型 ID 被拒绝。body 按事件属性配置校验,可选 external_id、content_tag_ids 会写入事件。
4.
保存按去重键加锁串行执行。external_id 非空时,它单独作为跨事件查询键;否则使用 (customer_id, event_setting_id, event_created)。找到首条匹配时复用其 ID 并更新,找不到则新建。因此重复提交同一键可能覆盖匹配事件中本次提供的字段,而不是新增一条。
5.
正常事件保存钩子会创建后续 Elasticsearch 同步;响应返回最终事件/客户 ID、时间、事件类型、标签和标准化后的 body。

错误与权限#

客户选择器无效、事件类型缺失或为系统保留、事件时间缺失、属性无效均返回客户端错误。接口需要 Bearer 认证及对应 REST 权限。

请求参数

Body 参数application/json必填

示例
{
  "customer_id": "{{customer_id}}",
  "event_setting_id": "event_signup",
  "event_created": 1756944000,
  "external_id": "evt-001",
  "content_tag_ids": [
    "1234567890123456",
    "1234567890123457"
  ],
  "body": {
    "source": "api"
  }
}

请求示例代码

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-events' \
--header 'Content-Type: application/json' \
--data '{
  "customer_id": "{{customer_id}}",
  "event_setting_id": "event_signup",
  "event_created": 1756944000,
  "external_id": "evt-001",
  "content_tag_ids": [
    "1234567890123456",
    "1234567890123457"
  ],
  "body": {
    "source": "api"
  }
}'

返回响应

🟢200成功
application/json
Event saved / 事件保存成功
Bodyapplication/json

示例
{
    "code": 200,
    "data": {
        "event_id": "string",
        "customer_id": "string",
        "event_created": 0,
        "event_setting_id": "string",
        "content_tag_ids": [
            "string"
        ],
        "body": {
            "property1": "string",
            "property2": "string"
        }
    }
}
🟠400请求有误
🟠401没有权限
🟠403禁止访问
🔴500服务器错误
🟠429请求过多
修改于 2026-09-22 08:53:52
上一页
查询客户事件
下一页
查询关联实体
Built with