Search code examples
slackslack-api

Mention Users Group via Slack API


I would like to mention Users Group via Slack API (Rest), is it possible? I tried via @admins, <@admins>, <@ID>, <!admins>

But it still is showed as a standard text, without mention. Any ideas?


Solution

  • User Groups follow the format <!subteam^ID|handle>. (subteam is literal text. ID and handle are replaced with the details of the group.) These indicate a User Group message, and should cause a notification to be displayed by the client. User Group IDs can be determined from the usergroups.list API endpoint. For example, if you have a User Group named happy-peeps with ID of S012345, then you would use the command <!subteam^S012345|happy-peeps> to mention that user group in a message.

    https://api.slack.com/reference/surfaces/formatting#mentioning-groups