Post an @Mention

Resource
To post a feed item with a mention, use /chatter/feed-elements.
To post a comment with a mention, use /chatter/feed-elements/feedElementId/capabilities/comments/items.
HTTP method
POST
Request body
For a feed item, use Feed Item Input

For a comment, use Comment Input

Both of these input request bodies include a body property that is a Message Body Input request body. In these examples, the Message Body Input request body includes a messageSegments property that has one Message Segment Input: Text request body and one Message Segment Input: Mention request body.

Request body example
This example is for a feed item:
This example is for a comment:

Include a space in the text message segment because spaces aren’t added automatically before or after a mention.

Note

Returns
Feed Item
Comment