# Delete a catalog entry

> Deletes a catalog entry, as the Catalog's Delete: SOFT — it leaves the lists, and trips that already use it keep showing it.

`DELETE /v1/catalog/entities/{entityId}`

Deletes a catalog entry, as the Catalog's Delete: SOFT — it leaves the lists, and trips that already use it keep showing it. Deleting a `destino` or a place takes everything below it (its zones and places; products are never taken). When that is more than the entry itself, `confirm` (a query parameter) must be its exact name; `?dryRun=true` answers the counts first. Undo with POST /changes/{changeId}/revert, or POST /catalog/entities/{entityId}/restore.

**Permissions:** `catalog:write` · **Kind:** destructive · **Cost:** 1 unit · **Dry run:** `?dryRun=true` · MCP tool [`delete_catalog_entity`](https://api.bymundi.com/docs/mcp/tools/delete_catalog_entity.md)

Undoable: the response carries `Bymundi-Change-Id`; [revert it](https://api.bymundi.com/docs/guides/undo-and-dry-run.md) with `POST /v1/changes/{changeId}/revert`.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `entityId` | uuid | yes |  |

## Query parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `confirm` | string |  | The entry's exact name, when the delete takes more than the entry itself. max 200 chars |

## Response `200`

One of:

### `catalog_entity`

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | "catalog_entity" | yes |  |
| `id` | uuid | yes |  |
| `deleted` | true | yes |  |
| `deletedIds` | uuid[] | yes |  |

### `catalog_delete_preview`

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | "catalog_delete_preview" | yes |  |
| `id` | uuid | yes |  |
| `name` | string | yes |  |
| `deletes` | object | yes |  |
| `deletes.zonas` | integer | yes |  |
| `deletes.lugares` | integer | yes |  |
| `requiresConfirmation` | boolean | yes | true: repeat without dryRun and with `confirm` set to the entry's exact name. |


## Errors

Errors are [problem details](https://api.bymundi.com/docs/guides/errors.md). Besides the refusals described above, any call like this one can return:

- [`invalid_request`](https://api.bymundi.com/problems/invalid_request.md) — Invalid request
- [`unauthorized`](https://api.bymundi.com/problems/unauthorized.md) — Missing or invalid API key
- [`insufficient_scope`](https://api.bymundi.com/problems/insufficient_scope.md) — Missing permission
- [`rate_limited`](https://api.bymundi.com/problems/rate_limited.md) — Rate limit reached
- [`not_found`](https://api.bymundi.com/problems/not_found.md) — Not found
- [`idempotency_key_reused`](https://api.bymundi.com/problems/idempotency_key_reused.md) — Idempotency-Key reused
- [`request_in_progress`](https://api.bymundi.com/problems/request_in_progress.md) — Request in progress
- [`forbidden`](https://api.bymundi.com/problems/forbidden.md) — Not allowed

## Examples

#### curl

```bash
curl -X DELETE https://api.bymundi.com/v1/catalog/entities/$ENTITY_ID \
  -H "Authorization: Bearer $BYMUNDI_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

#### JavaScript

```javascript
const res = await fetch(`https://api.bymundi.com/v1/catalog/entities/${entityId}`, {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.BYMUNDI_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();
```

#### Python

```python
import os, uuid, requests

res = requests.delete(
    f"https://api.bymundi.com/v1/catalog/entities/{entityId}",
    headers={"Authorization": f"Bearer {os.environ['BYMUNDI_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
)
res.raise_for_status()
data = res.json()
```
