---
schema_version: "1"
id: 9fd5a4720fb8e2475e305491183d986bbe83322c37343b9c944bf0cc4fbd61c1
title: Create Action Link Templates
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/action_link_group_template_create.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.action_link_group_template_create.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e25588aca4e43548e632cb8076c2673ee31b4a7aac50820b9cd6c70e1e606aae
description: Create action link templates in Setup so that you can instantiate action link groups with common properties from Connect REST API or Apex. You can package templates and distribute them to other Salesforce orgs.
products:
  - Salesforce Platform
release: "264"
---
# Create Action Link Templates

Create action link templates in Setup so that you can instantiate action link groups with common properties from Connect REST API or Apex. You can package templates and distribute them to other Salesforce orgs.

### Required Editions

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_important.png)

Important Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic (<a href="https://help.salesforce.com/s/articleView?id=xcloud.overview_edition_lex_only.htm&amp;type=5&amp;language=en_US" target="_blank">not available in all orgs</a>) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: all editions except <strong>Personal</strong> and <strong>Starter</strong></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d21627e72">User
              Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d21627e72 ">To create action link group templates:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d21627e72 ">Customize Application</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d21627e72 ">To create action link templates:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d21627e72 ">Customize Application</td>

          </tr>
        </tbody>
      </table>

In addition to creating action link templates in Setup, you can also use Metadata API, SOAP API, and REST API to create action link templates.

The Action URL, HTTP Request Body, and HTTP Headers fields support _binding variables_ and _context variables_. Define binding variables in a template and set their values when you instantiate the action link group. Use context variables in a template and when an action link executes, Salesforce fills in the value and returns it in the request. For information about how to use these variables in a template, see [Design Action Link Templates](https://help.salesforce.com/s/articleView?id=platform.action_link_group_template_design.htm&release=264.0.0&type=5 "Before you create a template, consider which values you want to set in the template and which values you want to set with binding variables when you instantiate action link groups from the template.").

1. From Setup, enter Action Link Templates in the Quick Find box, then select **Action Link Templates**.
2. Click **New**.
3. Enter the Name of the template. This name is displayed in the list of action link group templates.
    
    This is the only action link group template value you can edit after the action link group template has been published.
4. Enter the Developer Name. Use the Developer Name to refer to this template from code. It defaults to a version of the Developer Name without spaces. Only letters, numbers, and underscores are allowed.
5. Select the Category, which indicates where to display the instantiated action link groups on feed elements. Primary displays action link groups in the body of feed elements. Overflow displays action link groups in the overflow menu of feed elements.
    
    If an action link group template is Primary, it can contain up to three action link templates. If an action link group template is Overflow, it can contain up to four action link templates.
6. Select the number of Executions Allowed, which indicates how many times the action link groups instantiated from this template can be executed. (Action links within a group are mutually exclusive.) If you choose Unlimited, the action links in the group cannot be of type `Api` or `ApiAsync`.
7. (Optional) Enter the Hours until Expiration, which is the number of hours from when the action link group is created until it's removed from associated feed elements and can no longer be executed. The maximum value is 8760.
    
    See [Design Action Link Templates](https://help.salesforce.com/s/articleView?id=platform.action_link_group_template_design.htm&release=264.0.0&type=5 "Before you create a template, consider which values you want to set in the template and which values you want to set with binding variables when you instantiate action link groups from the template.").
8. Click **Save**.
9. Click **New** to create an action link template.
    
    The action link template is automatically associated with an action link group template in a master-detail relationship.
10. Select the Action Type.
    
    - `Api`—The action link calls a synchronous API at the action URL. Salesforce sets the status to `SuccessfulStatus` or `FailedStatus` based on the HTTP status code returned by your server.
    - `ApiAsync`—The action link calls an asynchronous API at the action URL. The action remains in a `PendingStatus` state until a third party makes a request to `/connect/action-links/actionLinkId` to set the status to `SuccessfulStatus` or `FailedStatus` when the asynchronous operation is complete.
    - `Download`—The action link downloads a file from the action URL.
    - `Ui`—The action link takes the user to a web page at the action URL.
11. Enter an Action URL, which is the URL for the action link.
    
    For a `UI` action link, the URL is a Web page. For a `Download` action link, the URL is a link to a file to download. For an `Api` action link or an `ApiAsync` action link, the URL is a REST resource.
    
    Links to resources hosted on Salesforce servers can be relative, starting with a `/`. All other links must be absolute and start with `https://`. This field can contain binding variables in the form `{!Bindings.key}`, for example, `https://www.example.com/{!Bindings.itemId}`. Set the binding variable’s value when you instantiate the action link group from the template, as in this Connect REST API example, which sets the value of `itemId` to `8675309`.
    
    ```
    
    POST /connect/action-link-group-definitions
    
    {
         "templateId" : "07gD00000004C9r",
         "templateBindings" : [
            {
               "key":"itemId",
               "value": "8675309"
            }
         ]
    }
    ```
    
    This field can also contain [context variables](https://help.salesforce.com/s/articleView?id=platform.action_link_group_template_design.htm&release=264.0.0&type=5 "Before you create a template, consider which values you want to set in the template and which values you want to set with binding variables when you instantiate action link groups from the template."). Use context variables to pass information about the user who executed the action link to your server-side code. For example, this action link passes the user ID of the user who clicked on the action link to take a survey to the server hosting the survey.
    
    ```
    actionUrl=https://example.com/doSurvey?surveyId=1234&salesforceUserId={!userId}
    ```
12. Enter the HTTP Method to use to make the HTTP request.
13. (Optional) If the Action Type is `Api` or `ApiAsync`, enter an HTTP Request Body.
    
    This field can contain binding variables and context variables.
14. (Optional) If the Action Type is `Api` or `ApiAsync`, enter HTTP Headers.
    
    This field can contain binding variables and context variables .
    
    If an action link instantiated from the template makes a request to a Salesforce resource, the template must have a Content-Type header.
15. (Optional) To make this action link the default link in the group (which has special formatting in the UI), select Default Link in Group. There can be only one default link in a group.
16. (Optional) To display a confirmation dialog to the user before the action link executes, select Confirmation Required.
17. Enter the relative Position of the action link within action link groups instantiated from this template. The first position is 0.
18. Enter the Label Key. This value is the key for a set of UI labels to display for these statuses: NewStatus, PendingStatus, SuccessfulStatus, FailedStatus.
    
    For example, the **Post** set contains these labels: **Post**, **Post Pending**, **Posted**, **Post Failed**. This image shows an action link with the **Post** label key when the value of status is SuccessfulStatus:
    
    ![SuccessfulStatus](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/extend_code/images/actionlinks_task_success.png)
19. (Optional) If none of the Label Key values make sense for the action link, set Label Key to **None** and enter a value in the Label field.
    
    Action links have four statuses: NewStatus, PendingStatus, SuccessStatus, and FailedStatus. These strings are appended to the label for each status:
    
    - _label_
    - _label_ Pending
    - _label_ Success
    - _label_ Failed
    
    For example, if the value of `label` is “See Example,” the values of the four action link states are: See Example, See Example Pending, See Example Success, and See Example Failed.
    
    An action link can use either a LabelKey or Label to generate label names, it can’t use both.
20. Select User Visibility, which indicates who can see the action link group.
    
    If you select **Only creator’s manager can see**, the manager is the creator’s manager when the action link group is instantiated. If the creator’s manager changes after the action link group is instantiated, that change is not reflected.
21. (Optional) If you selected Only Custom User Can See or Everyone Except Custom User Can See, enter a Custom User Alias.
    
    Enter a string and set its value when you instantiate an action link group, just like you would set the value for a binding variable. However don’t use the binding variable syntax in the template, just enter a value. For example, you could enter `ExpenseApprover`. This Connect REST API example sets the value of `ExpenseApprover` to `005B0000000Ge16`:
    
    ```
    
    POST /connect/action-link-group-definitions
    
    {
         "templateId" : "07gD00000004C9r",
         "templateBindings" : [
            {
               "key":"ExpenseApprover",
               "value": "005B0000000Ge16"
            }
         ]
    }
    ```
22. To create another action link template for this action link group template, click **Save & New**.
23. If you’re done adding action link templates to this action link group template, click **Save**.
24. To publish the action link group template, click **Back to List** to return to the Action Link Group Template list view.
    
    ![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_important.png)
    
    Important You must publish a template before you can instantiate an action link group from it in Apex or Connect REST API.
25. Click **Edit** for the action link group template you want to publish.
26. Select Published and click **Save**.

#### See Also

- [Design Action Link Templates](https://help.salesforce.com/s/articleView?id=platform.action_link_group_template_design.htm&release=264.0.0&type=5 "Before you create a template, consider which values you want to set in the template and which values you want to set with binding variables when you instantiate action link groups from the template.")
- [Edit Action Link Templates](https://help.salesforce.com/s/articleView?id=platform.action_link_group_template_edit.htm&release=264.0.0&type=5 "You can edit all fields on an unpublished action link group template and on its associated action link templates.")
- [Delete Action Link Group Templates](https://help.salesforce.com/s/articleView?id=platform.action_link_group_template_delete.htm&release=264.0.0&type=5 "When you delete an action link group template, you delete its associated action link templates and all action link groups that have been instantiated from the templates. Deleted action link groups disappear from any feed elements they've been associated with.")
- [Package Action Link Templates](https://help.salesforce.com/s/articleView?id=platform.action_link_group_template_package.htm&release=264.0.0&type=5 "Package action link templates to distribute them to other Salesforce organizations.")
- [_Apex Developer Guide_: Working with Action Links](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_features_action_links.htm)
- [_Apex Developer Guide_: Define an Action Link in a Template and Post with a Feed Element](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_examples_define_post_action_link_template.htm)