GET /api/private/v1/customers/:username
读取指定客户的详细信息。
路径参数
| 参数 | 说明 |
|---|---|
username | 客户用户名 |
成功响应
返回完整客户记录,并附带 credentials 元数据数组:
{
"ok": true,
"requestId": "req_123",
"data": {
"id": 1,
"username": "customer_001",
"projectId": "clx_project",
"enabled": true,
"temporary": false,
"createdAt": "2026-03-01T00:00:00.000Z",
"updatedAt": "2026-03-21T00:00:00.000Z",
"credentials": [
{ "id": 9, "type": 0, "createdAt": "2026-03-01T00:00:00.000Z" }
]
}
}
PATCH /api/private/v1/customers/:username
更新指定客户。
请求体
{
"username": "customer_002",
"enabled": false,
"password": "new-secret"
}
所有字段都可选:
| 字段 | 类型 | 说明 |
|---|---|---|
username | string | 新用户名,8 到 16 位 |
enabled | boolean | 是否启用 |
password | string | 新密码,更新或创建密码凭证 |
成功响应
返回更新后的客户对象。
DELETE /api/private/v1/customers/:username
删除指定客户。
成功响应
{
"ok": true,
"requestId": "req_123",
"data": { "success": true }
}
可能错误
404 CUSTOMER_NOT_FOUND