跳转到主要内容

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} 永久删除指定环境。此操作不可逆,需要管理员权限。

请求头

头部必选说明
AuthorizationBearer <PAT>(需管理员权限)

路径参数

参数类型必选说明
environment_idstring环境的唯一标识(前缀为 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."
  }
}

错误码

HTTPtype说明
401authentication_error认证失败,PAT 无效或过期
403permission_error无权执行删除操作(需要管理员权限)
404not_found_error指定 ID 的环境不存在

注意事项

  • 该端点需要管理员级别的 PAT 权限。普通用户调用会返回 403 错误。
  • 建议在删除前先通过 归档端点 进行归档操作。
  • 如果环境下仍有活跃会话,删除可能会失败。