---
title: "Bulk Delete Devices"
method: POST
path: "/api/mesh/{team_key}/agents/devices/bulk-delete"
tags: ["mesh"]
---

# Bulk Delete Devices

`POST /api/mesh/{team_key}/agents/devices/bulk-delete`

## Request

- Base URL: `https://api.superit.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.superit.ai/api/mesh/{team_key}/agents/devices/bulk-delete`
- Auth: HTTP bearer

Soft-delete the selected devices and revoke their NATS credentials.

Requires engineer/admin role on the team. Returns the outcome per
key rather than 204 — a selection can go stale between render and submit,
and one already-removed device shouldn't sink the rest of the batch.

## Path parameters

- `team_key` string, required

## Request body

- BulkDeleteDevicesRequest: Device keys selected for removal on the device index page. Capped at exactly one page-select worth of devices — see ``BULK_DELETE_MAX_DEVICES``.
  - `deviceKeys` string[], required

## Response `200`

Successful Response

- BulkDeleteDevicesResponse: Per-key outcome of a bulk device removal. A stale selection (device already removed, or removed by someone else between render and submit) lands in ``not_found`` rather than failing the whole batch — the same collapse ``soft_delete_device`` already applies to unknown key / wrong team / already-deleted. Both fields are required rather than defaulted: the server always sends both lists, and a ``default_factory`` here would surface them as optional in the generated TypeScript client, pushing needless null-handling onto every caller.
  - `deleted` string[], required
  - `notFound` string[], required

## Other responses

- `400`: Invalid input
- `401`: Not authenticated
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `409`: Conflict
- `422`: Validation Error

---

[API](https://skmtc.dev/superit/apis/super-it-api.md) - [All operations](https://skmtc.dev/superit/apis/super-it-api/llms.txt) - [OpenAPI document](https://skmtc.dev/superit/apis/super-it-api/revisions/4944d556c2bb?raw)
