Permanently deletes an environment. This operation is irreversible and requires administrator permission.
Request headers
|
Header |
Required |
Description |
|
|
Yes |
|
Path parameters
|
Parameter |
Type |
Required |
Description |
|
|
string |
Yes |
The unique identifier for the environment. The value is prefixed with |
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 failed. The Personal Access Token (PAT) is invalid or has expired. |
|
403 |
|
You do not have permission to perform this action. Administrator permission is required. |
|
404 |
|
The specified environment does not exist. |
|
409 |
|
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.