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

# 删除凭证

> 删除一个 Vault credential。

`DELETE /api/v1/cloud/vaults/{vault_id}/credentials/{credential_id}`

删除 Vault credential 并返回删除确认。

## 路径参数

| 参数              | 类型     | 说明                            |
| --------------- | ------ | ----------------------------- |
| `vault_id`      | string | 以 `vault_` 为前缀的 Vault ID      |
| `credential_id` | string | 以 `vcred_` 为前缀的 Credential ID |

## 请求头

| 头部              | 必选 | 说明             |
| --------------- | -- | -------------- |
| `Authorization` | 是  | `Bearer <PAT>` |

## 示例请求

```bash theme={null}
curl -X DELETE "https://api.qoder.com/api/v1/cloud/vaults/vault_019e3bb940277f0db05ab74291acf6ef/credentials/vcred_019e3bb98877759e862750b495c1fce8" \
  -H "Authorization: Bearer $QODER_PAT"
```

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "id": "vcred_019e3bb98877759e862750b495c1fce8",
  "type": "vault_credential_deleted"
}
```

删除成功通过响应体中的 `"type": "vault_credential_deleted"` 标识。

## 错误码

| HTTP | type                   | 触发条件                   |
| ---- | ---------------------- | ---------------------- |
| 401  | `authentication_error` | 缺少或无效的认证令牌             |
| 404  | `not_found_error`      | Vault 或 credential 不存在 |

完整错误信封说明详见 [错误参考](/zh/cloud-agents/api/conventions/errors)。

## 相关

<CardGroup cols={2}>
  <Card title="Vaults" icon="key" href="/zh/cloud-agents/vaults">
    安全地存储凭据并注入到 Agent Session。
  </Card>
</CardGroup>
