---
title: "Delete Mob"
method: DELETE
path: "/mobs/{id}"
tags: ["Mobs"]
---

# Delete Mob

`DELETE /mobs/{id}`

## Request

- Base URL: `https://api.purplegrain.com/api/v1`
- URL: `https://api.purplegrain.com/api/v1/mobs/{id}`
- Auth: HTTP bearer

Removes the mob for good — and only while nothing is filed on it.

**A mob with any record or open task cannot be removed: the request is
refused with a `409`** whose `errors[0].detail` names the counts
("Merino wethers has 4 records and 0 open tasks on it — archive this mob
instead of removing it") and whose `errors[0].code` is `asset_in_use`.
The counts are read inside the delete's own transaction, not from the
numbers a client read earlier, so a mob that acquired history between a
client's check and its `DELETE` is kept rather than silently unfiled.
Archive it instead (`PUT { archived: true }`): its records — every move
it ever made included — stay on the property, and the mob stays
openable from the archive drawer.

A client offers "Remove this mob" only while `record_count` and
`open_task_count` are both zero and "Archive this mob" otherwise — and
treats a `409` as the archive face, because the numbers moved under it.

## Path parameters

- `id` string, required

## Response `204`

Deleted

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict — the mob has records or open tasks on it, so it can be archived but not removed. `errors[0].detail` names both counts and says to archive instead; `errors[0].code` is `asset_in_use`. Nothing was changed.

---

[API](https://skmtc.dev/purplegrain/apis/purple-grain-api.md) · [All operations](https://skmtc.dev/purplegrain/apis/purple-grain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/purplegrain/apis/purple-grain-api/revisions/4bedbc1c784c?raw)
