Delete a unit
Code Mode: praxis.devops.units.delete
HTTP: DELETE /devops/v1/units/{id}
Destroy the unit and the machine behind it: the sandbox kills the machine, the unit moves to deleted, and its record stays for history. A unit holding uncommitted or unpushed work is refused with 409 UNIT_UNPUSHED_WORK so that work is not lost by accident; send force true to delete it anyway, which is what the Console offers behind a confirmation. Deleting an already deleted unit succeeds and changes nothing. Deleting is one-way: a deleted unit is never started again; open a new one for the change instead.
Signature
praxis.devops.units.delete(args:{path:{/** e.g. "wsu_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string};query?:{/** e.g. false */ force?:boolean}}):Promise<{/** Always true on success; a refusal answers an error instead, so a caller never reads deleted false here. e.g. true */ deleted:boolean}>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | yes | The unit identifier returned by the unit create answer or a unit list, such as wsu_…; not the id of the change it was opened for. |
| force | query | boolean | no | Delete even when the unit holds uncommitted or unpushed work; omitted or false refuses such a unit with UNIT_UNPUSHED_WORK. |
Responses
| Status | Content types | Description |
|---|---|---|
| 200 | application/json | The unit is gone and its machine was killed; the answer carries deleted true. |
| 401 | application/json | The API key is missing or invalid; send a valid Praxis API key in the Authorization header before retrying. |
| 403 | application/json | The credential carries no organization, or that organization cannot reach this project; use a key belonging to the project’s organization. No cross-organization read is possible. |
| 404 | application/json | UNIT_NOT_FOUND means no unit with that id is visible to this organization — a unit belonging to another organization answers the same way, so its existence is not revealed; list the project’s units and use an id from that answer. |
| 409 | application/json | UNIT_UNPUSHED_WORK means the unit holds uncommitted or unpushed work, so deleting it would lose that work; push it first, or send force true to delete it anyway. Nothing was deleted. |
| 500 | application/json | INTERNAL means the service could not complete the request; retry once, and if it repeats report the request id. A read is safe to repeat; a write that failed this way should be re-read before it is sent again. |