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

永久删除一枚 API 凭证。删除后**立即不可恢复**，所有正在使用该 Token 的业务接口会马上收到 `401`。

> ℹ️ 本接口属于 **AceDataCloud 平台管理 API**，统一前缀 `https://platform.acedata.cloud/api/v1/`。

## 接口概览

| 项 | 内容 |
| - | - |
| 方法 | `DELETE` |
| URL | `https://platform.acedata.cloud/api/v1/credentials/{credential_id}` |
| 鉴权 | ✅ 需要账户令牌 |

`/credentials/{id}` 与 `/credentials/{id}/` 当前都可用；示例统一使用无尾斜杠形式。

## 鉴权说明（如何获取账户令牌）

请求头：

```http theme={null}
Authorization: Bearer ${PLATFORM_TOKEN}
```

获取方式见[管理 AceDataCloud 平台账户令牌](https://platform.acedata.cloud/documents/platform-token)。

## 路径参数

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `credential_id` | UUID | ✅ | 要删除的凭证 ID |

## 请求示例

### cURL

```shell theme={null}
curl -X DELETE 'https://platform.acedata.cloud/api/v1/credentials/df3e1b1b-9e72-4c4f-9a83-1e23f7c8b4d6' \
  -H "authorization: Bearer ${PLATFORM_TOKEN}"
```

### Python

```python theme={null}
import os
import requests

cred_id = "df3e1b1b-9e72-4c4f-9a83-1e23f7c8b4d6"
resp = requests.delete(
    f"https://platform.acedata.cloud/api/v1/credentials/{cred_id}",
    headers={"authorization": f"Bearer {os.environ['PLATFORM_TOKEN']}"},
    timeout=10,
)
assert resp.status_code == 204, resp.text
print("✅ 已删除")
```

### Node.js

```javascript theme={null}
const credId = 'df3e1b1b-9e72-4c4f-9a83-1e23f7c8b4d6'
const r = await fetch(`https://platform.acedata.cloud/api/v1/credentials/${credId}`, {
  method: 'DELETE',
  headers: { authorization: `Bearer ${process.env.PLATFORM_TOKEN}` },
})
console.log('status:', r.status) // 204
```

## 响应

* **成功**：`HTTP 204 No Content`，**无响应体**。
* **失败**：返回错误 JSON，见下表。

## 错误处理

| HTTP | code | 含义 |
| - | - | - |
| 401 | `not_authenticated` | 缺少账户令牌 |
| 403 | `permission_denied` | 该凭证不属于你 |
| 404 | `not_found` | 凭证不存在或已被删除 |

## 实用提示

* **删除不可逆**——平台不保留 Token 副本。如果你只是怀疑泄露还想保留监控数据，应使用[轮换 AceDataCloud 平台 API 凭证](https://platform.acedata.cloud/documents/platform-credential-rotate)而不是删除。
* **删除不会退还该凭证已消耗的额度**。Application 余额按消耗实时扣减，删除凭证不影响余额账面。
* 删除后可通过[API 凭证列表](https://platform.acedata.cloud/documents/platform-credential-list)按 `application_id` 重新确认剩余凭证。
* **批量清理前先核对调用方**：列表当前没有最后使用时间字段；应结合部署配置和调用记录确认凭证不再使用，再逐个删除。

## 相关接口

* [获取 AceDataCloud 平台 API 凭证列表](https://platform.acedata.cloud/documents/platform-credential-list)
* [轮换 AceDataCloud 平台 API 凭证](https://platform.acedata.cloud/documents/platform-credential-rotate) — 不删凭证仅换 Token
* [创建 AceDataCloud 平台 API 凭证](https://platform.acedata.cloud/documents/platform-credential-create)


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