Delete Message API
Overview
Section titled “Overview”DELETE /admin/message
Deletes one or more messages in a conversation. The deletion behavior depends on the type field:
"myself": messages are deleted only for the sender"all": messages are deleted for all participants, and a real-time notification is sent to online users in the conversation.
Authorization
Section titled “Authorization”{ Admin-Api-Key: {{ HTTP_ADMIN_API_KEY }} }Request
Section titled “Request”Content-Type: application/json
{ "organizationId": "680a2fae96cc69d78861f101", "senderId": "63480e68f4794709f802a2fa", "messageDelete": { "cid": "63077ad836b78c3d82af0815", "ids": ["63077ad836b78c3d82af0812", "63077ad836b78c3d82af0813"], "type": "myself" }}Request Parameters
Section titled “Request Parameters”| Field | Type | Description |
|---|---|---|
organizationId | string | OrganizationId performing request |
senderId | string | User ID performing the deletion |
messageDelete.cid | string | Conversation ID |
messageDelete.ids | array[string] | List of Message IDs to delete |
messageDelete.type | "myself" | "all" | Deletion type: for sender only (myself) or for all users (all) |
Successful Response
Section titled “Successful Response”{ "success": true}Real-time Message
Section titled “Real-time Message”if type: "all"
{ "message_delete": { "cid": "63077ad836b78c3d82af0815", "ids": ["63077ad836b78c3d82af0812", "63077ad836b78c3d82af0813"], "type": "all", "from": "634ec51c0b65918393dca5bf" }}If type: "myself" is used, the messages will be removed only for the
senderId. No real-time event is broadcast to other users.