---
title: "Decommission a device"
method: POST
path: "/v1/edge/devices/{id}/decommission"
tags: ["Edge Devices"]
---

# Decommission a device

`POST /v1/edge/devices/{id}/decommission`

## Request

- Base URL: `https://api.hify.club`
- URL: `https://api.hify.club/v1/edge/devices/{id}/decommission`
- Auth: API key in header `X-User-Token`

Retires the device immediately: removes its arenas and facility, revokes its API token, marks open footage requests lost and aborts in-flight deployments. A background job then deletes its Cloudflare tunnel and DNS record and decommissions it in Mender. Tailscale is not touched; remove the node manually. Calling this again while that cleanup is unfinished re-enqueues it.

## Response `202`

Device decommissioned, or already decommissioned with cleanup unfinished; external cleanup enqueued

- Device
  - `id` integer
  - `mender_device_id` string, nullable
  - `mac_address` string, nullable
  - `status` 'pending' | 'accepted' | 'rejected' | 'preauthorized' | 'noauth' | 'decommissioned'
  - `facility_id` integer, nullable
  - `mender_attributes` object
  - `upload_mode` 'continuous' | 'on_demand'
  - `preview_generation_enabled` boolean
  - `archive_disk` boolean
  - `decommissioned_at` string, date-time, nullable
  - `arenas` object[]
  - `facility` object, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Device is already decommissioned and its cleanup has finished
- `422`: The device could not be saved as decommissioned

## Changes

- **2026-11-05** `b5920403538d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/hify/apis/hify-apis/changes/v1/edge/devices/:id/decommission/post.md)

---

[API](https://skmtc.dev/hify/apis/hify-apis.md) - [All operations](https://skmtc.dev/hify/apis/hify-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/hify/apis/hify-apis/revisions/b5920403538d?raw)
