---
title: "Decommission"
method: POST
path: "/api/v1/admin/devices/{device_id}/decommission"
tags: ["device administration"]
---

# Decommission

`POST /api/v1/admin/devices/{device_id}/decommission`

## Request

- Base URL: `https://api.brumby.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.brumby.com/api/v1/admin/devices/{device_id}/decommission`
- Auth: HTTP bearer

Retire the unit: certificate revoked and the CRL rewritten, installation
closed, everything still queued for it closed (`cleaned_up`), lifecycle
retired, hardware serial freed for a reimage.

409 with a sentence while a flight is open or the dock holds a launched
mission; 409 `device_already_retired` the second time.

## Path parameters

- `device_id` string, required

## Request body

- DeviceDecommission: Retire a unit for good: certificate revoked (CRL rewritten), installation closed, everything still queued for it closed, and the hardware serial freed so the same box can announce itself again after a reimage.
  - `reason` string, required

## Response `200`

Successful Response

- DeviceDecommissionResponse
  - `device_id` string, required
  - `lifecycle` string, required
  - `original_serial_number` string, required
  - `retired_serial_number` string, required
  - `revoked_serials` string[], required
  - `installation_closed` boolean, required
  - `crl_written` boolean, required
  - `cleaned_up` DecommissionCleanup, required: What decommissioning closed besides the certificate and the installation, by id. Every list may be empty; none of these is history being deleted.
    - `mission_requests_refused` string[], required
    - `sim_runs_cancelled` string[], required
    - `launch_intents_withdrawn` string[], required
    - `bundle_deployments_cancelled` string[], required
    - `diagnostic_actions_undelivered` string[], required
    - `bootstrap_tokens_revoked` string[], required
    - `install_kits_superseded` string[], required
    - `companions_unbound` string[], required
    - `geofences_archived` string[], required
    - `sim_runner_token_revoked` boolean, required
    - `manual_position_cleared` boolean, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/brumby/apis/brumby-platform-api.md) - [All operations](https://skmtc.dev/brumby/apis/brumby-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/brumby/apis/brumby-platform-api/revisions/fe185e20813e?raw)
