---
schema_version: "1"
id: 4f2de3876d30b5965f5166a70b72f4f9f8d5e0ecf1129d9eb14cae372fb8a704
title: ConnectApi.FeedItemInput
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_input_feedItem.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_feedItem.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d5de27abf5f4acd7cd325ad0561d52945ab29e53f86a8b97ed17fe8720af4c02
description: Used to create rich feed items, for example, feed items that include @mentions or files.
---
# ConnectApi.FeedItemInput

Used to create rich feed items, for example, feed items that include @mentions or files.

Subclass of [ConnectApi.FeedElementInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_feed_element.htm "Feed elements are the top-level items that a feed contains. Feeds are feed element containers.") as of version 31.0.

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





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

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

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

              <th class="featureTableHeader  " id="d642285e69">Required or Optional</th>

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

            </tr>

          </thead>

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

              <td class="entry" headers="d642285e63" data-title="Type"><samp class="codeph apex_code"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_FeedItemAtt.htm" title="Used to attach a file to a feed item.">ConnectApi.​Feed​Item​Attachment​​Input</a></samp></td>

              <td class="entry" headers="d642285e66" data-title="Description">Specifies the attachment for the feed item. The feed item type is inferred
                based on the provided attachment. <strong class="ph b">Important:</strong> As of API version 32.0, use the inherited <samp class="codeph apex_code">capabilities</samp> property.</td>

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

              <td class="entry" headers="d642285e72" data-title="Available Version">28.0–31.0</td>

            </tr>

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

              <td class="entry" headers="d642285e63" data-title="Type"><samp class="codeph apex_code"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_msgBody.htm" title="Add rich messages to feed items and comments.">ConnectApi.​Message​​Body​Input</a></samp></td>

              <td class="entry" headers="d642285e66" data-title="Description">Message body. <span class="ph" id="feedItemLengthLimit"><a name="feedItemLengthLimit"><!-- --></a>The body can contain up to 10,000
                  characters and 25 mentions. Because the character limit can change, clients should
                  make a <samp class="codeph nolang">describeSObjects()</samp> call on the
                  FeedItem or FeedComment object and look at the length of the
                  <span class="keyword parmname">Body</span> or <span class="keyword parmname">CommentBody</span> field to determine
                  the maximum number of allowed characters.</span>
                <p class="p">If you specify <samp class="codeph apex_code">originalFeedElementId</samp> to share a feed item, use
                  the <samp class="codeph nolang">body</samp> property to add the first comment to
                  the feed item.</p>
                <p class="p">To edit this property in a feed item, use <samp class="codeph apex_code"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ChatterFeeds_static_methods.htm#apex_ConnectAPI_ChatterFeeds_updateFeedElement" title="Edit a feed element.">updateFeedElement(communityId, feedElementId, feedElement)</a></samp>. Editing feed posts
                  is supported in version 34.0 and later.</p>
              </td>

              <td class="entry" headers="d642285e69" data-title="Required or Optional">Required unless the feed item has a link capability or a content
                capability.</td>

              <td class="entry" headers="d642285e72" data-title="Available Version">28.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d642285e60" data-title="Property"><samp class="codeph apex_code">isBookmarked​​ByCurrentUser</samp></td>

              <td class="entry" headers="d642285e63" data-title="Type">Boolean</td>

              <td class="entry" headers="d642285e66" data-title="Description">Specifies if the new feed item should be bookmarked for the user (<samp class="codeph nolang">true</samp>) or not (<samp class="codeph nolang">false</samp>). <strong class="ph b">Important:</strong> As of API version 32.0, use the <samp class="codeph apex_code">capabilities.bookmarks.isBookmarkedByCurrentUser</samp> property.</td>

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

              <td class="entry" headers="d642285e72" data-title="Available Version">28.0–31.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d642285e60" data-title="Property"><samp class="codeph apex_code">original​FeedElementId</samp></td>

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

              <td class="entry" headers="d642285e66" data-title="Description">To share a feed element, specify its 18-character ID. <strong class="ph b">Important:</strong> As of API version 39.0, use the <samp class="codeph apex_code">capabilities.feedEntity​Share.feedEntityId</samp> property.</td>

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

              <td class="entry" headers="d642285e72" data-title="Available Version">31.0–38.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d642285e60" data-title="Property"><samp class="codeph apex_code">original​FeedItemId</samp></td>

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

              <td class="entry" headers="d642285e66" data-title="Description">To share a feed item, specify its 18-character ID. <strong class="ph b">Important:</strong> In API version 32.0–38.0, use the <samp class="codeph apex_code">originalFeedElementId</samp> property. In API version 39.0 and later, use the <samp class="codeph apex_code">capabilities.feedEntity​Share.feedEntityId</samp> property.</td>

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

              <td class="entry" headers="d642285e72" data-title="Available Version">28.0–31.0</td>

            </tr>

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

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

              <td class="entry" headers="d642285e66" data-title="Description">Type of users who can see a feed item.<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph apex_code">AllUsers</samp>—Visibility is not limited to internal users.
                  </li>
                  <li class="li">
                    <samp class="codeph apex_code">InternalUsers</samp>—Visibility is limited to internal users.
                  </li>
                </ul>
                <div class="p">Default values:<ul class="ul bulletList">
                    <li class="li">For external users, the default value is <samp class="codeph nolang">AllUsers</samp>. External users must use this value to see their posts.</li>
                    <li class="li">For internal users, the default value is <samp class="codeph nolang">InternalUsers</samp>. Internal users can accept this value or use the value <samp class="codeph nolang">AllUsers</samp> to allow external users to see their posts.</li>
                  </ul>
                  If the parent of the feed item is a user, group, or direct message, the <samp class="codeph nolang">visibility</samp> of the feed item must be <samp class="codeph nolang">AllUsers</samp>.</div>
              </td>

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

              <td class="entry" headers="d642285e72" data-title="Available Version">28.0</td>

            </tr>

          </tbody>

        </table>