Browse Platform API
Platform API

Before writing a message

Copy

Adjust permitted message fields before the message is written to OpenIM storage.

HTTP request

POST {WEBHOOK_ADDRESS}/callbackBeforeMsgModifyCommand

Request body

The payload contains callbackCommand: callbackBeforeMsgModifyCommand and the message fields described on Before sending a one-to-one message. recvID and keyVersion are Enterprise extensions for this callback.

Response

Return the common before-event fields from Webhooks overview. The response may replace content, recipient or group identifiers, message IDs, sender profile, conversation and content types, status, sending options, offline push data, mention data, attachments, and extension data.

Processing rules

  • Configuration key: beforeMsgModify.
  • OpenIM waits synchronously. Use nextCode: 1 to reject writing the message; timeout behavior follows failedContinue.
  • Return only fields that should replace the values OpenIM is about to write.