---
title: "Delete an environment permanently"
method: DELETE
path: "/projects/{project_id}/environments/{env_id}"
tags: ["Projects"]
---

# Delete an environment permanently

`DELETE /projects/{project_id}/environments/{env_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/environments/{env_id}`
- Auth: HTTP bearer

Permanently deletes an environment and all related data. Cannot delete:
- Production environments (name = "Production")

Warning: This action is permanent and cannot be undone.
Active deployments are automatically cancelled before deletion.

## Path parameters

- `project_id` integer, required
- `env_id` integer, required

## Response `204`

Environment permanently deleted

## Other responses

- `400`: Cannot delete production environment
- `404`: Project or environment not found
- `409`: The environment still has CDN delivery, or a worker holding its containers is unreachable; a retry finishes once it is back
- `428`: Recent MFA verification required
- `500`: Internal server error

## Changes

- **2026-11-25** `480a86944327`: 1 info
  - the endpoint scheme security `bearer_auth` was added to the API
- **2026-11-03** `0add2fdd114a`: 1 info
  - added the non-success response with the status `409`
- **2026-11-03** `fcfcfae25744`: 1 info
  - removed the non-success response with the status `409`
- **2026-11-03** `af07888c38c0`: 1 info
  - added the non-success response with the status `409`
- **2026-08-04** `c647b6ab1d2c`: 1 info
  - added the non-success response with the status `428`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/environments/:env_id/delete.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
