---
schema_version: "1"
id: 2b33005d7b35412ddb0358c8de2509c1abad47ace8eb2be0f43d2ad7c5a59773
title: ConnectApi.TextSegmentInput
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_input_TxtMsgSeg.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_TxtMsgSeg.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 25a25688413879e1ab010d518ad452d924b3f883dadbe96dfb8817a5ec99c51b
description: Include a text segment in a feed item or comment.
---
# ConnectApi.TextSegmentInput

Include a text segment in a feed item or comment.

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.").

| Property | Type | Description | Available Version |
| --- | --- | --- | --- |
| text | String | Plain text for this segment. If hashtags or links are detected in text, they’re included in the comment as hashtag and link segments. Mentions aren’t detected in text and aren’t separated out of the text. Mentions require [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."). | 28.0 |

#### 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.")