> ## 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.