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
| Item | Description |
|---|---|
| URL | https://api-coco.typex.im/open/robot/message/urgent |
| Method | POST |
| Content-Type | application/json |
Request Headers
Authorization: Bearer <bot_token>
Content-Type: application/json
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | Conversation ID containing the message. |
message_id | string | Yes | ID of the bot message to mark urgent. |
target_users | string[] | Yes | User 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
| Case | Result |
|---|---|
| Missing or invalid bot token, or bot is blocked | Authentication or permission error |
chat_id, message_id, or target_users is missing or invalid | Request is rejected |
Message does not exist in chat_id, was not sent by this bot, or is no longer valid | Request is rejected |
| Target is not a conversation member or cannot see the message | Permission or request error |
| Target was already marked urgent for this message | Request is rejected |