---
schema_version: "1"
id: 37adeab0aaa6274ca8273df54955e5273e28c70d71f3d4d64faab49ebae92889
title: ConnectApi.MessageSegmentInput
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_input_messageSegmentInput.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_messageSegmentInput.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 04022bc0f1e2440fbec561f8078b0c780363233c6f37ce3f5f739014f6a77f8c
description: Used to add rich message segments to feed items and comments.
---
# ConnectApi.MessageSegmentInput

Used to add rich message segments to feed items and comments.

This class is abstract and has no public constructor. You can make an instance only of a subclass.

Superclass for:

- [ConnectApi.EntityLinkSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_entity_link_segment.htm "An entity link segment.")
- [ConnectApi.HashtagSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_hashtag.htm "Include a hashtag in a feed item or comment.")
- [ConnectApi.InlineImageSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_inline_image_segment.htm "An inline image segment.")
- [ConnectApi.LinkSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_linkMsgSeg.htm "Include a link segment in a feed item or comment.")
- [ConnectApi.MarkupBeginSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_markup_begin_segment.htm "The beginning tag for rich text markup.")
- [ConnectApi.MarkupEndSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_markup_end_segment.htm "The end tag for rich text markup.")
- [ConnectApi.MentionSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_mentionMsgSeg.htm "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.TextSegmentInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_TxtMsgSeg.htm "Include a text segment in a feed item or comment.")

Use the [ConnectApiHelper repository on GitHub](https://github.com/forcedotcom/ConnectApiHelper "HTML (New Window)") to simplify many of the tasks accomplished with ConnectApi.MessageSegmentInput, such as posting with inline images, rich text, and mentions.

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




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

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

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

              <th class="featureTableHeader vertical-align-top " id="d674320e141">Required or Optional</th>

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

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d674320e132 d674320e144" data-title="Property"><samp class="codeph apex_code">type</samp></td>

              <td class="entry" headers="d674320e135" data-title="Type"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/connectAPI_enums.htm#MsgSegEnum"><samp class="codeph apex_code">ConnectApi.​MessageSegment​Type</samp></a></td>

              <td class="entry" headers="d674320e138" data-title="Description">The type of message segment. Values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph apex_code">EntityLink</samp></li>
                  <li class="li"><samp class="codeph apex_code">FieldChange</samp></li>
                  <li class="li"><samp class="codeph apex_code">FieldChangeName</samp></li>
                  <li class="li"><samp class="codeph apex_code">FieldChangeValue</samp></li>
                  <li class="li"><samp class="codeph apex_code">Hashtag</samp></li>
                  <li class="li"><samp class="codeph apex_code">InlineImage</samp></li>
                  <li class="li"><samp class="codeph apex_code">Link</samp></li>
                  <li class="li"><samp class="codeph apex_code">MarkupBegin</samp></li>
                  <li class="li"><samp class="codeph apex_code">MarkupEnd</samp></li>
                  <li class="li"><samp class="codeph apex_code">Mention</samp></li>
                  <li class="li"><samp class="codeph apex_code">MoreChanges</samp></li>
                  <li class="li"><samp class="codeph apex_code">ResourceLink</samp></li>
                  <li class="li"><samp class="codeph apex_code">Text</samp></li>
                </ul>
              </td>

              <td class="entry" headers="d674320e141" data-title="Required or Optional">Required</td>

              <td class="entry" headers="d674320e132 d674320e144" data-title="Property">23.0</td>

            </tr>

          </tbody>

        </table>

#### See Also

- [Edit a Comment](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/connectapi_examples_edit_comment.htm "Edit a Comment - HTML (New Window)")
- [Edit a Feed Element](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/connectapi_examples_edit_feed_element.htm "Edit a Feed Element - HTML (New Window)")
- [Edit a Question Title and Post](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/connectapi_examples_edit_question_title_post.htm "Edit a Question Title and Post - HTML (New Window)")
- [Post a Rich-Text Feed Element with Inline Image](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/connectapi_examples_post_feed_element_richtext_inlineimage.htm "Post a Rich-Text Feed Element with Inline Image - HTML (New Window)")
- [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.")