跳到主要内容

GET /api/private/v1/customers

分页查询当前项目中的客户列表。

查询参数

参数类型说明
pagenumber页码,默认 1
pageSizenumber每页条数,默认 10,最大 100
searchstring按用户名或任意标识值模糊搜索

成功响应

{
"ok": true,
"requestId": "req_123",
"data": {
"data": [
{
"id": 1,
"username": "customer_001",
"projectId": "clx_project",
"enabled": true,
"temporary": false,
"identifiers": [
{ "id": 11, "type": "email", "value": "user@example.com" },
{ "id": 10, "type": "username", "value": "customer_001" }
],
"createdAt": "2026-03-01T00:00:00.000Z",
"updatedAt": "2026-03-01T00:00:00.000Z"
}
],
"total": 1,
"page": 1,
"pageSize": 10,
"totalPages": 1
}
}

POST /api/private/v1/customers

创建客户,并自动分配当前项目下所有免费套餐。

请求体

{
"username": "customer_001",
"enabled": true,
"password": "secret",
"identifiers": [
{ "type": "email", "value": "user@example.com" },
{ "type": "external_user_id", "value": "u_1001" }
]
}
字段类型必填说明
usernamestring8 到 16 位
enabledboolean默认 true
passwordstring创建密码凭证
identifiersarray额外客户标识列表,username 系统标识会自动镜像生成
identifiers[].typestring标识类型,如 emailexternal_user_id,最大 16 个字符
identifiers[].valuestring标识值,最大 128 个字符

成功响应

{
"ok": true,
"requestId": "req_124",
"data": {
"id": 2,
"username": "customer_002",
"projectId": "clx_project",
"enabled": true,
"temporary": false,
"identifiers": [
{ "id": 13, "type": "external_user_id", "value": "u_1002" },
{ "id": 12, "type": "username", "value": "customer_002" }
],
"createdAt": "2026-03-21T00:00:00.000Z",
"updatedAt": "2026-03-21T00:00:00.000Z"
}
}

HTTP 状态码为 201。创建成功后,系统会自动为该客户分配当前项目下所有免费套餐。