NATSoauth.app.secrets-rotate轮换应用密钥
Try it 面板需要启用 JavaScript。
生成新 clientSecret,旧密钥立即失效。
Request Payload
消息格式:JSON
| Name | Data Type | Required | Description |
|---|---|---|---|
| appId | string | Yes | 应用 ID |
type RequestBody = {
/** 应用 ID */
appId: string
}{
"appId": "01JD8SNST2N5U6X1BU9YBHK4C7J"
}Response Payload
回复使用统一信封 {id, code, messages, result},其 result:
| Name | Data Type | Required | Description |
|---|---|---|---|
| clientId | string | Yes | 客户端标识(不变) |
| clientSecret | string | No | 新密钥(仅此一次完整返回;管理侧重置场景不返回调用方) |
| rotatedAt | string | Yes | 轮换时间 |
type ResponseBody = {
/** 客户端标识(不变) */
clientId: string
/** 新密钥(仅此一次完整返回;管理侧重置场景不返回调用方) */
clientSecret?: string
/** 轮换时间 */
rotatedAt: string
}{
"clientId": "cli_9f2ka81mdx",
"clientSecret": "cs_8Wn3tXcV6mB1qL5rY9uH2eK4",
"rotatedAt": "2026-10-14T14:00:00Z"
}Response Code
回复使用统一信封 {id, code, messages, result},其 code 字段:
| code | Meaning | Notes |
|---|---|---|
| 0 | 成功 | 轮换应用密钥 |
| 2702 | 应用已封禁 |
Examples
{ "appId": "01JD8SNST2N5U6X1BU9YBHK4C7J" }
{
"id": "01JD8SWNBM1O8PL",
"code": 0,
"messages": [],
"result": {
"clientId": "cli_9f2ka81mdx",
"clientSecret": "cs_8Wn3tXcV6mB1qL5rY9uH2eK4",
"rotatedAt": "2026-10-14T14:00:00Z"
}
}