Skip to main content

Robot Message Urgent API

Mark a message previously sent by the bot as urgent for one or more recipients. The selected recipients receive the urgent-message notification.

Endpoint​

ItemDescription
URLhttps://api-coco.typex.im/open/robot/message/urgent
MethodPOST
Content-Typeapplication/json

Request Headers​

Authorization: Bearer <bot_token>
Content-Type: application/json

Request Parameters​

ParameterTypeRequiredDescription
chat_idstringYesConversation ID containing the message.
message_idstringYesID of the bot message to mark urgent.
target_usersstring[]YesUser IDs to receive the urgent notification. Must contain at least one user ID.

The message must be a valid, visible message sent by the bot in the specified conversation. System, withdrawn, expired, or otherwise invalid messages cannot be marked urgent. In a one-to-one conversation, target_users must contain the other participant. In a group, every target must be a current member who can see the message.

Repeated IDs within target_users are deduplicated. A user who has already been marked urgent for this message cannot be submitted again; the request is rejected. Other recipients who have not yet been marked urgent can be added in a later request.

Example: Mark a Message Urgent​

curl --location 'https://api-coco.typex.im/open/robot/message/urgent' \
--header 'Authorization: Bearer <bot_token>' \
--header 'Content-Type: application/json' \
--data '{
"chat_id": "123445",
"message_id": "7543434",
"target_users": [
"124468778",
"878756565"
]
}'

Successful Response​

{
"code": 0,
"data": null,
"msg": "ok",
"msg_i18n": {
"en": "ok"
}
}

Common Failure Cases​

CaseResult
Missing or invalid bot token, or bot is blockedAuthentication or permission error
chat_id, message_id, or target_users is missing or invalidRequest is rejected
Message does not exist in chat_id, was not sent by this bot, or is no longer validRequest is rejected
Target is not a conversation member or cannot see the messagePermission or request error
Target was already marked urgent for this messageRequest is rejected