---
title: "Delete a message"
method: DELETE
path: "/ocs/v2.php/apps/assistant/chat/delete_message"
tags: ["chat_api"]
---

# Delete a message

`DELETE /ocs/v2.php/apps/assistant/chat/delete_message`

Delete a chat message by ID

## Query parameters

- `messageId` integer, required
- `sessionId` integer, required

## Headers

- `OCS-APIRequest` boolean, required

## Response `200`

The message has been successfully deleted

- object

## Other responses

- `401` — Not logged in
- `404` — The session was not found
- `500`

## Changes

- **2025-10-13** `992cd27e50b6` — 2 breaking, 1 info
  - the response's body type/format changed from `object`/`` to ``/`` for status `401`
  - removed the required property `error` from the response with the `401` status
  - added `subschema #1, subschema #2` to the response body `anyOf` list for the response status `401`
- **2025-03-11** `969dd20410d6` — 1 info
  - endpoint added
- **2024-04-15** `baf79495237b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/nextcloud/apis/assistant/changes/ocs/v2.php/apps/assistant/chat/delete_message/delete.md)

---

[API](https://skmtc.dev/nextcloud/apis/assistant.md) · [All operations](https://skmtc.dev/nextcloud/apis/assistant/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nextcloud/assistant/revisions/9146d4951875/schema)
