---
schema_version: "1"
id: 802b394f1de2357288ec2c510e60ea6f3e2825511b1864af2f7f4ed5b3354406
title: ConnectApi.FileIdInput
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_input_file_id.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_file_id.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: b8eef0a35672402b81e71ee0facd9fa72db61f790d39e40c02dab67f1f479876
description: Attach a file that has already been uploaded or remove a file from a feed element.
---
# ConnectApi.FileIdInput

Attach a file that has already been uploaded or remove a file from a feed element.

<table class="featureTable sort_table" summary="">
          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader vertical-align-top " id="d647466e27">Property</th>
              <th class="featureTableHeader vertical-align-top " id="d647466e29">Type</th>
              <th class="featureTableHeader vertical-align-top " id="d647466e31">Description</th>
              <th class="featureTableHeader vertical-align-top " id="d647466e33">Required or Optional</th>
              <th class="featureTableHeader vertical-align-top " id="d647466e35">Available Version</th>
            </tr>
          </thead>
          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d647466e27 d647466e35" data-title="Property"><samp class="codeph apex_code">id</samp></td>

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

              <td class="entry" headers="d647466e31" data-title="Description"><span class="ph" id="idDesc"><a name="idDesc"><!-- --></a>ID of a file that has already been uploaded.</span></td>

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

              <td class="entry" headers="d647466e27 d647466e35" data-title="Property">36.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d647466e27 d647466e35" data-title="Property"><samp class="codeph apex_code">operationType</samp></td>

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

              <td class="entry" headers="d647466e31" data-title="Description">Operation to carry out on the file.
                Values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph apex_code">Add</samp>—Adds the file to the feed element.
                  </li>
                  <li class="li">
                    <samp class="codeph apex_code">Remove</samp>—Removes the file from the feed element.
                  </li>
                </ul>
                <p class="p" id="operationTypeNote"><a name="operationTypeNote"><!-- --></a><samp class="codeph apex_code">Remove</samp> operations
                  are processed before <samp class="codeph apex_code">Add</samp> operations.
                  Adding content that is already added and removing content that is already removed
                  result in no operation.</p>
              </td>

              <td class="entry" headers="d647466e33" data-title="Required or Optional">Optional<p class="p">If not specified, defaults to <samp class="codeph apex_code">Add</samp>.</p>
              </td>

              <td class="entry" headers="d647466e27 d647466e35" data-title="Property">36.0</td>

            </tr>

          </tbody>
        </table>

#### See Also

- [ConnectApi.FilesCapabilityInput](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_input_multiple_content_capability.htm "Attach up to 10 files that have already been uploaded or remove one or more files from a feed element.")