All Products
Search
Document Center

:Delete an environment

Last Updated:Jul 15, 2026

Permanently deletes an environment. This operation is irreversible and requires administrator permission.

Request headers

Header

Required

Description

Authorization

Yes

Bearer <PAT>

Path parameters

Parameter

Type

Required

Description

environment_id

string

Yes

The unique identifier for the environment. The value is prefixed with env_.

Request body

No request body is required.

Example request

curl -s -X DELETE "https://api.qoder.com.cn/api/v1/cloud/environments/env_019e3bb39b6774d8878cd0b9d237574b" \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK

{
  "deleted": true,
  "id": "env_019e3bb39b6774d8878cd0b9d237574b",
  "type": "environment"
}

If the caller lacks sufficient permission, the API returns the following error:

{
  "type": "error",
  "error": {
    "type": "permission_error",
    "message": "You do not have permission to access this resource."
  }
}

Error codes

HTTP

Type

Description

401

authentication_error

Authentication failed. The Personal Access Token (PAT) is invalid or has expired.

403

permission_error

You do not have permission to perform this action. Administrator permission is required.

404

not_found_error

The specified environment does not exist.

409

conflict_error

The environment cannot be deleted because it is referenced by one or more active sessions.

Notes

  • This endpoint requires a PAT with administrator permission. Calls without administrator permission return a 403 error.

  • Before deleting an environment, consider archiving it first with the archive endpoint.

  • You cannot delete an environment that has active sessions.