PUT/api/v1/admin/attempt-config更新登录评分配置
Try it 面板需要启用 JavaScript。
整体更新评分配置;对更新后新创建的尝试生效,进行中的尝试沿用创建时配置。
Request
| Name | Data Type | Required | Description |
| Authorization | string | Yes | 会话令牌认证,格式 `Bearer <sessionToken>` |
| Content-Type | string | Yes | 请求体内容类型(默认值 "application/json") |
type RequestHeaders = {
/** 会话令牌认证,格式 `Bearer <sessionToken>` */
Authorization: string
/** 请求体内容类型,默认值 "application/json" */
Content-Type: string
}
{
"Authorization": "Bearer st_7c1f9e05b28d4a63",
"Content-Type": "application/json"
}
Body
| Name | Data Type | Required | Description |
| scoreThreshold | number | Yes | 签发会话所需累加分数阈值 |
| factorScores | object | Yes | 各因素分值 |
| ticketTtlSeconds | number | Yes | 尝试工单有效期(秒) |
type RequestBody = {
/** 签发会话所需累加分数阈值 */
scoreThreshold: number
/** 各因素分值 */
factorScores: Record<string, unknown>
/** 尝试工单有效期(秒) */
ticketTtlSeconds: number
}
{
"scoreThreshold": 80,
"factorScores": {
"password": 40,
"otp": 60,
"mfa": 60,
"captcha": 20
},
"ticketTtlSeconds": 600
}
Response
Body
| Name | Data Type | Required | Description |
| scoreThreshold | number | Yes | 签发会话所需累加分数阈值 |
| factorScores | object | Yes | 各因素分值 |
| ticketTtlSeconds | number | Yes | 尝试工单有效期(秒) |
| updatedAt | string | Yes | 本次更新时间 |
type ResponseBody = {
/** 签发会话所需累加分数阈值 */
scoreThreshold: number
/** 各因素分值 */
factorScores: Record<string, unknown>
/** 尝试工单有效期(秒) */
ticketTtlSeconds: number
/** 本次更新时间 */
updatedAt: string
}
{
"scoreThreshold": 80,
"factorScores": {
"password": 40,
"otp": 60,
"mfa": 60,
"captcha": 20
},
"ticketTtlSeconds": 600,
"updatedAt": "2026-10-14T17:30:00Z"
}
HTTP Code
| HTTP Status |
Meaning |
Notes |
| 200 |
成功 |
返回更新后的配置 |
| 400 |
评分配置无效 |
任一因素分值大于阈值,将出现无法满足的组合 |
Response Code
响应使用统一信封 {id, code, messages, result},其 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回更新后的配置 |
| 2904 |
评分配置无效 |
任一因素分值大于阈值(将出现无法满足的组合) |
Examples
PUT /api/v1/admin/attempt-config
Authorization: Bearer st_7c1f9e05b28d4a63
Content-Type: application/json
{
"scoreThreshold": 80,
"factorScores": { "password": 40, "otp": 60, "mfa": 60, "captcha": 20 },
"ticketTtlSeconds": 600
}
{
"id": "01JD8STP9T3A6FDF",
"code": 0,
"messages": [],
"result": {
"scoreThreshold": 80,
"factorScores": { "password": 40, "otp": 60, "mfa": 60, "captcha": 20 },
"ticketTtlSeconds": 600,
"updatedAt": "2026-10-14T17:30:00Z"
}
}