POST
/api/send-message
Sends a message to a group that specifically mentions one or more participants.
Mention Users in a Group Message
This functionality allows you to send a message to a group that triggers a notification for specific members, even if they have muted the group.
To use mentions, you must provide three parameters in your request:
to
: The JID of the group (ending in@g.us
).text
: The message content. For the mention to be visually displayed in the WhatsApp client, you must include the "@" symbol followed by the user's number (e.g., "Hello @1234567890").mentions
: An array of strings, where each string is the JID of a group member you want to mention (e.g.,["[email protected]"]
).
This feature can also be combined with media messages by including the appropriate media parameters alongside the text and mentions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
to | string | Yes | The Group JID, which must end in @g.us. |
text | string | Yes | The text content of the message. Should include the @ mention for visual display. |
mentions | array | Yes | An array of user JIDs (strings) to be mentioned in the group message. |
Code Examples
curl -X POST "https://www.wasenderapi.com/api/send-message"
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"to": "[email protected]",
"text": "Hello @1234567890, check this out!",
"mentions": ["[email protected]"]
}'
Response Examples
{
"success": true,
"data": {
"msgId": 100001,
"jid": "[email protected]",
"status": "in_progress"
}
}