Browse Platform API
Platform API

Before sending a one-to-one message

Copy

Use this callback for content moderation, policy enforcement, or field validation before a one-to-one message is sent.

HTTP request

POST {WEBHOOK_ADDRESS}/callbackBeforeSendSingleMsgCommand

Request body

PropertyTypeDescription
callbackCommandstringcallbackBeforeSendSingleMsgCommand.
sendIDstringSender user ID.
recvIDstringRecipient user ID.
serverMsgIDstringOpenIM server message ID.
clientMsgIDstringClient message ID.
operationIDstringOpenIM operation trace ID.
senderPlatformIDintSender platform ID.
senderNicknamestringSender nickname.
sessionTypeintConversation type.
msgFromintMessage source.
contentTypeintMessage content type.
statusintMessage status.
sendTimeintSend time in milliseconds.
createTimeintCreation time in milliseconds.
contentstringJSON string for the selected message content type.
seqintMessage sequence number.
atUserListstring[]Mentioned user IDs.
faceURLstringSender avatar URL.
exstringExtension data.
keyVersion EnterpriseintMessage encryption key version.

Response

Return the common before-event response from Webhooks overview. Use nextCode: 1 to reject the message.

Processing rules

  • Configuration key: beforeSendSingleMsg.
  • OpenIM waits synchronously; timeout behavior follows failedContinue.