Add force-delete for environments to the Deploy API (v4) - Mendix Forum

Add force-delete for environments to the Deploy API (v4)

0

Summary


Expose the "force delete" capability that currently exists only in the Sprintr UI as an endpoint (or flag on the existing `DELETE` endpoint) in the Deploy API v4, so environments stuck in a broken state can be removed programmatically.


Problem / Motivation


When automated app deployments via the Deploy API fail, environments are sometimes left behind in a state that the regular `DELETE` endpoint cannot resolve. Today the only way to clean them up is to open the Sprintr UI and use the "force delete" option, which requires several manual clicks per environment.


This is particularly painful for automated integration tests and CI/CD pipelines: every failed test run can leave behind stale environments that have to be removed by hand. Recently I had to delete multiple environments one by one through the UI for exactly this reason which doesn't scale and defeats the purpose of an automated pipeline.


Proposed Solution


One of the following would solve this:


- A new endpoint, e.g. `DELETE /api/v4/apps/{appId}/environments/{environmentId}/force`

- Or a query parameter / request body flag on the existing endpoint, e.g. `DELETE .../environments/{id}?force=true`


Behavior should mirror the UI's "force delete" exactly: remove the environment regardless of its current state, without requiring it to be in a healthy condition first.


Benefit


- Fully automated CI/CD cleanup, no manual UI steps

- Self-healing test pipelines (cleanup as part of teardown)

- Consistent API surface anything doable in the UI should be doable via the API


Thanks for considering!


Best regards,

Marvin

asked
0 answers