---
schema_version: "1"
id: 3ff071678a64b2f4326490fa1ed4fd030e4097db2b91ab080b502d34d2988bc6
title: ConnectApi.MentionSegmentInput
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_input_mentionMsgSeg.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_mentionMsgSeg.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 444c059c019226c53ce14a3d0c1c01f4f2cbc83d3029ebc49a6056b3f61650af
description: Include an @mention of a user or group in a feed post or comment. When creating a feed post or comment, you can include up to 25 mentions.
---
# ConnectApi.MentionSegmentInput

Include an @mention of a user or group in a feed post or comment. When creating a feed post or comment, you can include up to 25 mentions.

Subclass of [ConnectApi.MessageSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_messageSegmentInput.htm "Used to add rich message segments to feed items and comments.").

<table class="featureTable sort_table" summary="">




          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader vertical-align-top " id="d673980e57">Property</th>

              <th class="featureTableHeader vertical-align-top " id="d673980e60">Type</th>

              <th class="featureTableHeader vertical-align-top " id="d673980e63">Description</th>

              <th class="featureTableHeader vertical-align-top " id="d673980e66">Available Version</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d673980e57" data-title="Property"><samp class="codeph apex_code">id</samp></td>

              <td class="entry" headers="d673980e60" data-title="Type">String</td>

              <td class="entry" headers="d673980e63" data-title="Description">ID of the user or group to mention.<p class="p">To mention a user, use either <samp class="codeph nolang">id</samp> or <samp class="codeph nolang">username</samp>. You can’t include both.</p>
                <p class="p">To mention a group, you must use
                  <samp class="codeph nolang">id</samp>.
                </p>
              </td>

              <td class="entry" headers="d673980e66" data-title="Available Version">28.0<p class="p">Groups are available in 29.0.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d673980e57" data-title="Property"><samp class="codeph apex_code">username</samp></td>

              <td class="entry" headers="d673980e60" data-title="Type">String</td>

              <td class="entry" headers="d673980e63" data-title="Description">User name of the user to mention.<p class="p">To mention a user, use either <samp class="codeph nolang">id</samp> or <samp class="codeph nolang">username</samp>. You can’t include both.</p>
              </td>

              <td class="entry" headers="d673980e66" data-title="Available Version">38.0</td>

            </tr>

          </tbody>

        </table>

#### See Also

- [ConnectApi.MessageBodyInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_msgBody.htm "Add rich messages to feed items and comments.")