---
title: "Delete chat messages by ID(s)"
method: POST
path: "/api/v2/chats/{id}/messages/delete"
tags: ["Chats"]
---

# Delete chat messages by ID(s)

`POST /api/v2/chats/{id}/messages/delete`

<a class="try-sandbox-link" href="https://sandbox.textmagic.com/#/Chats/deleteChatMessages" target="_blank">Try in sandbox</a><br>Delete messages from chat by given message IDs.

## Path parameters

- `id` integer, required

## Request body

- object
  - `inbound_ids` string — Inbound message IDs to delete. Require when "all" is equal to 0 (false).
  - `sent_ids` string — Sent message IDs to delete. Require when "all" is equal to 0 (false).
  - `calls_ids` string — Calls IDs to delete. Require when "all" is equal to 0 (false).
  - `all` boolean — Default is 0 (false). If set to 1, all the entities will be removed.

## Response `204`

Request executed with success.

## Other responses

- `400` — Bad request.
- `401` — Unauthorized request.

---

[API](https://skmtc.net/textmagic/apis/textmagic-api.md) · [All operations](https://skmtc.net/textmagic/apis/textmagic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/textmagic/textmagic-api/revisions/3e4029d19684/schema)
