---
schema_version: "1"
id: 883da0f5d9e98491e1ce4e967ea88c0819cbeb20b08450668bbdc67b904fc62c
title: ConnectApi.ActionLinkDefinition
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_output_action_link_definition.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_action_link_definition.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3ae25aa1a7129dc0a31d45a816f93adacbe5f36b3f8637e7cf7d1b75bcc76ecf
description: The definition of an action link. Action link definition can be sensitive to a third party (for example, OAuth bearer token headers). For this reason, only calls made from the Apex namespace that created the action link definition can read, modify, or delete the definition. In addition, the user making the call must have created the definition or have View All Data permission.
---
# ConnectApi.ActionLinkDefinition

The definition of an action link. Action link definition can be sensitive to a third party (for example, OAuth bearer token headers). For this reason, only calls made from the Apex namespace that created the action link definition can read, modify, or delete the definition. In addition, the user making the call must have created the definition or have View All Data permission.

<table class="featureTable sort_table" summary="">
          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader vertical-align-top " id="d783202e27">Property Name</th>
              <th class="featureTableHeader vertical-align-top " id="d783202e29">Type</th>
              <th class="featureTableHeader vertical-align-top " id="d783202e31">Description</th>
              <th class="featureTableHeader vertical-align-top " id="d783202e33">Available Version</th>
            </tr>
          </thead>
          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">actionUrl</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">String</td>
              <td class="entry" headers="d783202e31" data-title="Description">The action link URL. For example, a <samp class="codeph nolang">Ui</samp> action link URL is a Web page. A <samp class="codeph nolang">Download</samp> action link URL is a link to the file to download. <samp class="codeph nolang">Ui</samp> and <samp class="codeph nolang">Download</samp> action link URLs are provided to clients. An <samp class="codeph nolang">Api</samp> or <samp class="codeph nolang">ApiAsync</samp> action link URL is a REST resource. <samp class="codeph nolang">Api</samp> and <samp class="codeph nolang">ApiAsync</samp> action link URLs aren’t provided to clients. Links to Salesforce can be relative. All other links must be absolute and start with <samp class="codeph nolang">https://</samp>.</td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">createdDate</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">Datetime</td>
              <td class="entry" headers="d783202e31" data-title="Description">ISO 8601 format date string, for example, 2011-02-25T18:24:31.000Z.</td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">excludedUserId</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">String</td>
              <td class="entry" headers="d783202e31" data-title="Description">ID of a single user to exclude from performing the action. If you specify an <samp class="codeph nolang">excludedUserId</samp>, you can’t specify a <samp class="codeph nolang">userId</samp>.</td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">groupDefault</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">Boolean</td>
              <td class="entry" headers="d783202e31" data-title="Description">
                <samp class="codeph nolang">true</samp> if this action is the default action link in the action link group; <samp class="codeph nolang">false</samp> otherwise. There can be only one default action link per action link group. The default action link gets distinct styling in the Salesforce UI.
              </td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">headers</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_request_header.htm#apex_connectapi_output_request_header" title="An HTTP request header name and value pair."><samp class="codeph apex_code">ConnectApi.​RequestHeader</samp></a>&gt;
              </td>
              <td class="entry" headers="d783202e31" data-title="Description">The request headers for the <samp class="codeph nolang">Api</samp> and <samp class="codeph nolang">ApiAsync</samp> action link types.</td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">id</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">String</td>
              <td class="entry" headers="d783202e31" data-title="Description"><span class="ph" id="id"><a name="id"><!-- --></a>The 18-character ID for the action link definition.</span></td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>

            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">label</samp></td>

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

              <td class="entry" headers="d783202e31" data-title="Description">A custom label to display on the action link button. A <samp class="codeph nolang">label</samp> value can be set only in an action link template.<div class="p">Action links have four statuses: NewStatus, PendingStatus, SuccessStatus, and FailedStatus. These strings are appended to the label for each status:<ul class="ul bulletList">
                    <li class="li"><em class="ph i">label</em></li>
                    <li class="li">
                      <em class="ph i">label</em> Pending
                    </li>
                    <li class="li">
                      <em class="ph i">label</em> Success
                    </li>
                    <li class="li">
                      <em class="ph i">label</em> Failed
                    </li>
                  </ul>
                  For example, if the value of <samp class="codeph nolang">label</samp> is “See Example,” the values of the four action link states are: See Example, See Example Pending, See Example Success, and See Example Failed.</div>
                An action link can use either <samp class="codeph nolang">label</samp> or <samp class="codeph nolang">labelKey</samp> to generate label names, it can’t use both. If <samp class="codeph nolang">label</samp> has a value, the value of <samp class="codeph nolang">labelKey</samp> is <samp class="codeph nolang">None</samp>. If <samp class="codeph nolang">labelKey</samp> has a value other than <samp class="codeph nolang">None</samp>, the value of <samp class="codeph nolang">label</samp> is <samp class="codeph nolang">null</samp>.</td>

              <td class="entry" headers="d783202e33" data-title="Available Version">34.0</td>

            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">labelKey</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">String</td>
              <td class="entry" headers="d783202e31" data-title="Description">Key for the set of labels to show in the user interface. A set includes labels for these states: NewStatus, PendingStatus, SuccessStatus, FailedStatus. For example, if you use the <samp class="codeph nolang">Approve</samp> key, you get these labels: Approve, Pending, Approved, Failed.<p class="p">For a complete list of label keys, see <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.chatterapi.meta/chatterapi/connect_appendices_action_links_labels.htm" target="_blank" title="HTML (New Window)">Action Links Labels</a> in the <cite class="cite">Connect REST API Developer Guide</cite>.</p>
              </td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">method</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/connectAPI_enums.htm#RequestMethodEnum"><samp class="codeph apex_code" id="RequestMethodEnum">ConnectApi.​HttpRequestMethod</samp></a></td>
              <td class="entry" headers="d783202e31" data-title="Description">The HTTP method. One of these values:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">HttpDelete</samp>—Returns HTTP 204 on success. Response body or output class is empty.
                  </li>
                  <li class="li">
                    <samp class="codeph nolang">HttpGet</samp>—Returns HTTP 200 on success.
                  </li>
                  <li class="li">
                    <samp class="codeph nolang">HttpHead</samp>—Returns HTTP 200 on success. Response body or output class is empty.
                  </li>
                  <li class="li">
                    <samp class="codeph nolang">HttpPatch</samp>—Returns HTTP 200 on success or HTTP 204 if the response body or output class is empty.
                  </li>
                  <li class="li">
                    <samp class="codeph nolang">HttpPost</samp>—Returns HTTP 201 on success or HTTP 204 if the response body or output class is empty. Exceptions are the batch posting resources and methods, which return HTTP 200 on success.
                  </li>
                  <li class="li">
                    <samp class="codeph nolang">HttpPut</samp>—Return HTTP 200 on success or HTTP 204 if the response body or output class is empty.
                  </li>
                </ul>
              </td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">modifiedDate</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">Datetime</td>
              <td class="entry" headers="d783202e31" data-title="Description">ISO 8601 format date string, for example, 2011-02-25T18:24:31.000Z.</td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">requestBody</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">String</td>
              <td class="entry" headers="d783202e31" data-title="Description">The request body for <samp class="codeph nolang">Api</samp> and <samp class="codeph nolang">ApiAsync</samp> action link types. Escape quotation mark characters in the
                <samp class="codeph nolang">requestBody</samp> value.
              </td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">requires​Confirmation</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">Boolean</td>
              <td class="entry" headers="d783202e31" data-title="Description">
                <samp class="codeph nolang">true</samp> to require the user to confirm the action; <samp class="codeph nolang">false</samp> otherwise.
              </td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">templateId</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">String</td>
              <td class="entry" headers="d783202e31" data-title="Description"><span class="ph" id="templateId"><a name="templateId"><!-- --></a>The ID of the action link template from which to instantiate this action
                  link. If the action link isn’t associated with a template, the value is <samp class="codeph nolang">null</samp>.</span></td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">type</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/connectAPI_enums.htm#ActionLinkTypeEnum"><samp class="codeph apex_code" id="ActionLinkTypeEnum">ConnectApi.​ActionLinkType</samp></a></td>
              <td class="entry" headers="d783202e31" data-title="Description">Defines the type of action link. Values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">Api</samp>—The action link calls a synchronous API at the action URL. Salesforce sets the status to <samp class="codeph nolang">SuccessfulStatus</samp> or <samp class="codeph nolang">FailedStatus</samp> based on the HTTP status code returned by your server.
                  </li>
                  <li class="li">
                    <samp class="codeph nolang">ApiAsync</samp>—The action link calls an asynchronous API at the
                    action URL. The action remains in a <samp class="codeph nolang">PendingStatus</samp> state until a third party makes a request to <samp class="codeph nolang">/connect/action-links/{actionLinkId}</samp> to set the
                    status to <samp class="codeph nolang">SuccessfulStatus</samp> or <samp class="codeph nolang">FailedStatus</samp> when the asynchronous operation is
                    complete.
                  </li>
                  <li class="li">
                    <samp class="codeph nolang">Download</samp>—The action link downloads a file from the action URL.
                  </li>
                  <li class="li">
                    <samp class="codeph nolang">Ui</samp>—The action link takes the user to a web page at the action URL.
                  </li>
                </ul>
                <p class="p">Invoking <samp class="codeph nolang">ApiAsync</samp> action links from an
                  app requires a call to set the status. However, there isn’t currently a way to set
                  the status of an action link using Apex. To set the status, use Connect REST API.
                  See the Action Link resource in the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.chatterapi.meta/chatterapi/" target="_blank" title="HTML (New Window)">Connect REST API Developer Guide</a>for more information.</p>
              </td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
            <tr>
              <td class="entry" headers="d783202e27" data-title="Property Name"><samp class="codeph apex_code">userId</samp></td>
              <td class="entry" headers="d783202e29" data-title="Type">String</td>
              <td class="entry" headers="d783202e31" data-title="Description">The ID of the user who can execute the action. If not specified or <samp class="codeph nolang">null</samp>, any user can execute the action. If you specify a <samp class="codeph nolang">userId</samp>, you can’t specify an <samp class="codeph nolang">excludedUserId</samp>.</td>
              <td class="entry" headers="d783202e33" data-title="Available Version">33.0</td>
            </tr>
          </tbody>
        </table>

#### See Also

- [ConnectApi.ActionLinkGroupDefinition](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_action_link_group_definition.htm "The definition of an action link group. Information in the action link group definition can be sensitive to a third party (for example, OAuth bearer token headers). For this reason, only calls made from the Apex namespace that created the action link group definition can read, modify, or delete the definition. In addition, the user making the call must have created the definition or have View All Data permission.")