DELETE /v1/environments/{environment_id}
Permanently deletes the specified environment. The operation is irreversible and requires admin permissions.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT> (admin scope required) |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
environment_id | string | Yes | Environment unique identifier (with the env_ prefix) |
Request body
No request body.Example request
Example response
A successful request returns HTTP200 with the following JSON body:
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 401 | authentication_error | PAT invalid or expired |
| 403 | permission_error | Not authorized to delete (admin permission required) |
| 404 | not_found_error | Environment with the given ID does not exist |
| 409 | conflict_error | Environment still has active sessions and cannot be deleted |
Notes
- This endpoint requires an admin-level PAT. Standard users receive a 403.
- Archive the environment via
POST /v1/environments/{environment_id}/archivebefore deletion when possible. - Deletion may fail if active sessions still reference the environment.