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.
DELETE /v1/environments/{environment_id}
永久删除指定环境。此操作不可逆,需要管理员权限。
请求头
| 头部 | 必选 | 说明 |
|---|
Authorization | 是 | Bearer <PAT>(需管理员权限) |
路径参数
| 参数 | 类型 | 必选 | 说明 |
|---|
environment_id | string | 是 | 环境的唯一标识(前缀为 env_) |
请求体
无需请求体。
示例请求
curl -s -X DELETE "https://openapi.qoder.sh/api/v1/cloud/environments/env_019e3bb39b6774d8878cd0b9d237574b" \
-H "Authorization: Bearer $QODER_PAT"
示例响应
成功时返回空响应体,HTTP 状态码 204。
权限不足时返回错误:
{
"type": "error",
"error": {
"type": "permission_error",
"message": "You do not have permission to access this resource."
}
}
错误码
| HTTP | type | 说明 |
|---|
| 401 | authentication_error | 认证失败,PAT 无效或过期 |
| 403 | permission_error | 无权执行删除操作(需要管理员权限) |
| 404 | not_found_error | 指定 ID 的环境不存在 |
注意事项
- 该端点需要管理员级别的 PAT 权限。普通用户调用会返回 403 错误。
- 建议在删除前先通过 归档端点 进行归档操作。
- 如果环境下仍有活跃会话,删除可能会失败。