| action | description | Allowed reasons |
|---|---|---|
| enable | 重新激活当前状态为 disabled(已禁用)的密钥。执行后,密钥将恢复至 registered(已注册)状态,可不受限制地正常使用。 | client_request |
| disable | 根据客户请求封禁密钥。执行后,相关密钥将转为 disabled(已禁用)状态,无法用于任何操作。 | client_request |
原因的选择取决于操作发起方,且必须包含在 API 请求体中。
该功能目前处于 Beta 阶段,可能有所调整。目前暂不支持在生产环境中使用。
Authorization: Bearer ********************curl --location 'https://api.cobre.co/v1/accounts//keys//key_action' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"action": "disable",
"reason": "client_request"
}'{
"id": "key_TQjvIO8UFf1bv81",
"alias": "My first Cobre Key",
"connectivity": {
"status": "registered",
"description": ""
},
"previous_action": {
"action_requested": "disable",
"action_code": "",
"action_description": ""
},
"created_at": "2025-11-28T21:32:08Z",
"updated_at": "2025-11-28T21:32:09Z"
}