AISARAISAR
All webhooks

Messages

Message deleted

message.deleted

Fires when a message is deleted. Includes the actor who deleted it — a user (operator), the contact (e.g. WhatsApp "Delete for Everyone"), or system for bulk deletions triggered by the channel platform — and an optional reason. Use message_id to remove the message from your local state.

HTTP request

AISAR sends a signed POST request to your webhook_url:

http
POST {webhook_url}
Content-Type: application/json
X-AISAR-Signature: sha256=...

{
  "event": "message.deleted",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-03-26T12:00:00.000000Z",
  "company_id": 1,
  "data": {
    "message_id": 123,
    "conversation_id": 45,
    "channel_id": 2,
    "deletion": {
      "actor": {
        "type": "user",
        "contact_id": null,
        "user_id": 3,
        "name": "Manager Name"
      },
      "deleted_at": "2026-03-26T12:00:00+00:00",
      "reason": null
    }
  }
}

The X-AISAR-Signature header carries an HMAC-SHA256 signature of the request body — use it to verify the request came from AISAR.

Example payload

json
{
  "event": "message.deleted",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-03-26T12:00:00.000000Z",
  "company_id": 1,
  "data": {
    "message_id": 123,
    "conversation_id": 45,
    "channel_id": 2,
    "deletion": {
      "actor": {
        "type": "user",
        "contact_id": null,
        "user_id": 3,
        "name": "Manager Name"
      },
      "deleted_at": "2026-03-26T12:00:00+00:00",
      "reason": null
    }
  }
}

Payload fields

FieldTypeDescription
message_idintegerInternal message ID
conversation_idintegerConversation ID
channel_idintegerChannel ID
deletion.actorobjectWho deleted the message
deletion.actor.typestringuser, contact, or system (bulk deletions triggered by the channel platform)
deletion.actor.contact_idinteger|nullContact ID (when deleted by the contact)
deletion.actor.user_idinteger|nullUser ID (when deleted by a user)
deletion.actor.namestringActor display name
deletion.deleted_atstringISO 8601 timestamp of the deletion
deletion.reasonstring|nullDeletion reason (if provided by the user)