> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# 轮换 AceDataCloud 平台 API 凭证

> Platform 集成指南 - Ace Data Cloud

为现有 Credential 生成新的 Token 或密码。凭证 ID、Application 关联、限额和其他字段保持不变，旧秘密立即失效。

> 轮换会中断仍使用旧秘密的客户端。先准备安全分发和回滚方案，再执行写操作。

## 接口概览

| 项 | 内容 |
| - | - |
| 方法 | `POST` |
| URL | `https://platform.acedata.cloud/api/v1/credentials/{credential_id}/rotate/` |
| 鉴权 | Account Token |
| Body | 无或 `{}` |

从[凭证列表](https://platform.acedata.cloud/documents/platform-credential-list)取得 `credential_id`：

```shell theme={null}
export PLATFORM_TOKEN='你的账户令牌'
export CREDENTIAL_ID='要轮换的 Credential ID'

curl -X POST \
  "https://platform.acedata.cloud/api/v1/credentials/${CREDENTIAL_ID}/rotate/" \
  -H "Authorization: Bearer ${PLATFORM_TOKEN}"
```

成功返回更新后的 Credential。`type=Token` 时读取新的 `token`；`type=Identity` 时读取新的 `password`。将完整响应按秘密处理并立即更新调用方。

## 错误处理

* `401`：Account Token 无效。
* `403`：无权管理该凭证。
* `404`：Credential ID 不存在。

## 相关接口

* [获取 API 凭证列表](https://platform.acedata.cloud/documents/platform-credential-list)
* [创建 API 凭证](https://platform.acedata.cloud/documents/platform-credential-create)
* [删除 API 凭证](https://platform.acedata.cloud/documents/platform-credential-delete)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.