---
title: "Soft-delete a model and cascade to chats, messages, attachments"
method: DELETE
path: "/v1/external-models/{id}"
tags: ["External Models"]
---

# Soft-delete a model and cascade to chats, messages, attachments

`DELETE /v1/external-models/{id}`

Sets isDeleted=true on the model and all related chats, messages and attachments. Returns counts of affected rows.

## Path parameters

- `id` string, required

## Headers

- `x-api-key` string, required

## Response `200`

Model and related data soft-deleted

## Other responses

- `404` — Model not found

---

[API](https://skmtc.dev/miaai/apis/backend-template-api.md) · [All operations](https://skmtc.dev/miaai/apis/backend-template-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/miaai/backend-template-api/revisions/2a8d88a5124f/schema)
