Tell Me More: Quick Actions and the REST API

The REST API contains a number of resources and calls that you can use when working with actions.

Quick Actions

Use the Quick Actions resource to return a list of actions as well as custom fields and objects that appear in the feed. The resource uses a URI of the format services/data/v34.0/quickActions/.

You might have a preferred tool for working with Salesforce APIs. If you don’t have a preferred tool, Workbench is an easy way to get started. You can find information about Workbench at https://developer.salesforce.com/page/Workbench. You can find information about the REST API in the Force.com REST API Developer’s Guide.

Global Actions

To return global actions, use: services/data/v34.0/quickActions/

A call to this resource returns information about the global actions including our Shipify canvas custom action as shown in this snippet of the response.
1...
2    { 
3    "urls" : { 
4        "quickAction" : "/services/data/v34.0/
5            quickActions/LogACall", 
6        "defaultValues" : "/services/data/v34.0/
7            quickActions/LogACall/defaultValues", 
8        "describe" : "/services/data/v34.0/
9            quickActions/LogACall/describe"
10        }, 
11            "name" : "LogACall", 
12            "type" : "LogACall", 
13            "label" : "Log a Call" 
14    }, 
15    { 
16    "urls" : { 
17        "quickAction" : "/services/data/v34.0/
18            quickActions/Shipify", 
19        "describe" : "/services/data/v34.0/
20            quickActions/Shipify/describe" 
21        }, 
22            "name" : "Shipify", 
23            "type" : "Canvas", 
24            "label" : "Shipify" 
25        },
26...
Object Actions

To return a specific object’s actions, as well as global actions, use: services/data/v34.0/sobjects/object/quickActions/

The call /services/data/v34.0/sobjects/Invoice__c/quickActions returns information about global actions as well as the Invoice Create_Delivery action, as shown in this snippet of the response.
1...
2    { "urls" : { 
3        "quickAction" : "/services/data/v34.0/
4            quickActions/Shipify", 
5        "describe" : "/services/data/v34.0/
6            quickActions/Shipify/describe" 
7    }, 
8    "name" : "Shipify", 
9    "type" : "Canvas", 
10    "label" : "Shipify" 
11    },
12    { 
13    "urls" : { 
14        "defaultValuesTemplate" : "/services/data/v34.0/
15            sobjects/Invoice__c/quickActions/Create_Delivery/
16            defaultValues/{ID}", 
17        "quickAction" : "/services/data/v34.0/
18            sobjects/Invoice__c/quickActions/Create_Delivery", 
19        "defaultValues" : "/services/data/v34.0/
20            sobjects/Invoice__c/quickActions/Create_Delivery/
21            defaultValues", 
22        "describe" : "/services/data/v34.0/
23            sobjects/Invoice__c/quickActions/Create_Delivery/
24            describe"
25        }, 
26            "name" : "Invoice__c.Create_Delivery", 
27            "type" : "Create", 
28            "label" : "Create Delivery" 
29        },
30...
Specific Actions

To return a specific action, use: services/data/v34.0/sobjects/object/quickActions/Action_Name

The call /services/data/v34.0/sobjects/Invoice__c/ quickActions/Create_Delivery returns information about only the Create_Delivery action, as shown in this response.
1{
2    "colors": [
3        {
4            "theme": "theme4",
5            "color": "AA8E0A",
6            "context": "primary"
7        },
8        {
9            "theme": "theme3",
10            "color": "AA8E0A",
11            "context": "primary"
12        }
13    ],
14    "miniIconUrl": "https://instance.salesforce.com/img/
15        icon/custom51_100/truck16.png",
16    "sourceSobjectType": "Invoice__c",
17    "targetParentField": "Invoice__c",
18    "targetRecordTypeId": null,
19    "targetSobjectType": "Delivery__c",
20    "visualforcePageName": null,
21    "iconUrl": "https://instance.salesforce.com/img/
22        icon/custom51_100/truck32.png",
23    "iconName": null,
24    "canvasApplicationName": null,
25    "height": null,
26    "icons" : [ ],
27...
28    "layout": {
29        "layoutRows": [{
30            "layoutItems": [
31                {
32                    "layoutComponents": [{
33                        "details": {
34                            "namePointing": false,
35                            "custom": true,
36                            "htmlFormatted": false,
37                            "dependentPicklist": false,
38                            "calculatedFormula": null,
39                            "defaultValueFormula": null,
40                            "defaultedOnCreate": false,
41                            "digits": 0,
42                            "groupable": true,
43                            "permissionable": false,
44                            "referenceTo": ["Invoice__c"],
45                            "relationshipOrder": 0,
46                            "soapType": "tns:ID",
47                            "nameField": false,
48                            "sortable": true,
49                            "filterable": true,
50                            "restrictedPicklist": false,
51                            "caseSensitive": false,
52                            "calculated": false,
53                            "scale": 0,
54                            "nillable": false,
55                            "externalId": false,
56                            "idLookup": false,
57                            "controllerName": null,
58                            "deprecatedAndHidden": false,
59                            "inlineHelpText": null,
60                            "writeRequiresMasterRead": false,
61                            "createable": true,
62                            "updateable": false,
63                            "relationshipName": "Invoice__r",
64                            "autoNumber": false,
65                            "unique": false,
66                            "picklistValues": [],
67                            "displayLocationInDecimal": false,
68                            "cascadeDelete": true,
69                            "restrictedDelete": false,
70                            "length": 18,
71                            "name": "Invoice__c",
72                            "type": "reference",
73                            "defaultValue": null,
74                            "byteLength": 18,
75                            "label": "Invoice",
76                            "precision": 0
77                        },
78                        "displayLines": 1,
79                        "tabOrder": 1,
80                        "value": "Invoice__c",
81                        "type": "Field"
82                    }],
83                    "placeholder": false,
84                    "editable": true,
85                    "required": true,
86                    "label": "Invoice"
87                },
88                {
89                    "layoutComponents": [],
90                    "placeholder": true,
91                    "editable": false,
92                    "required": false,
93                    "label": ""
94                }
95            ],
96            "numItems": 2
97        }],
98        "useCollapsibleSection": false,
99        "useHeading": false,
100        "columns": 2,
101        "heading": null,
102        "rows": 1
103    },
104    "defaultValues": [],
105    "width": null,
106    "urls": {
107        "defaultValuesTemplate": "/services/data/v34.0/
108            sobjects/Invoice__c/quickActions/
109            Create_Delivery/defaultValues/{ID}",
110        "quickAction": "/services/data/v34.0/
111            sobjects/Invoice__c/quickActions/Create_Delivery",
112        "defaultValues": "/services/data/v34.0/
113            sobjects/Invoice__c/quickActions/
114            Create_Delivery/defaultValues",
115        "describe": "/services/data/v34.0/
116            sobjects/Invoice__c/quickActions/
117            Create_Delivery/describe"
118    },
119    "name": "Invoice__c.Create_Delivery",
120    "type": "Create",
121    "label": "Create Delivery"
122}
Action Details

To return a specific action’s descriptive detail, use: services/data/v34.0/sobjects/object/quickActions/Action_Name/describe/

Action Default Values and Field Values

To return a specific action’s default values, including default field values, use: services/data/v34.0/sobjects/object/quickActions/Action_Name/defaultValues/

The call /services/data/v34.0/sobjects/Invoice__c/ quickActions/Create_Data/defaultValues returns information about defaults for the Invoice Create_Delivery action, as shown in this snippet of the response.
1...
2{
3   "attributes":{
4      "type":"Delivery__c"
5   }
6}
7...
Action Default Values

To return the default values for an action, use: /services/data/v34.0/subjects/ object/quickActions/Action_Name/defaultValues/Parent_ID

Describe Layouts

Use the global describe layouts resource to get global layout information for objects, including action objects. The resource uses a URI of the format: services/data/v34.0/ sobjects/Global/describe/layouts/

A call to this resource returns layout information for the global actions (including our Shipify canvas custom action), as shown in this response.
1{
2   "recordTypeSelectorRequired":[
3      false
4   ],
5   "recordTypeMappings":[
6
7   ],
8   "layouts":[
9      {
10         "relatedLists":[
11
12         ],
13         "relatedContent":null,
14         "detailLayoutSections":[
15
16         ],
17         "editLayoutSections":[
18
19         ],
20         "multirowEditLayoutSections":[
21
22         ],
23         "offlineLinks":[
24
25         ],
26         "buttonLayoutSection":null,
27         "highlightsPanelLayoutSection":null,
28         "quickActionList":{
29            "quickActionListItems":[
30               {
31                  "quickActionName":"Shipify",
32                  "colors":[
33
34                  ],
35                  "miniIconUrl":null,
36                  "targetSobjectType":null,
37                  "iconUrl":null,
38                  "urls":{
39                     "quickAction":"/services/data/v34.0/
40                         quickActions/Shipify",
41                     "describe":"/services/data/v34.0/
42                         quickActions/Shipify/describe"
43                  },
44                  "icons":[
45
46                  ],
47                  "type":"Canvas",
48                  "label":"Shipify"
49               },
50               {
51                  "quickActionName":"FeedItem.TextPost",
52                  "colors":[
53
54                  ],
55                  "miniIconUrl":null,
56                  "targetSobjectType":null,
57                  "iconUrl":null,
58                  "urls":{
59
60                  },
61                  "icons":[
62
63                  ],
64                  "type":"Post",
65                  "label":"Post"
66               },
67               {
68                  "quickActionName":"FeedItem.ContentPost",
69                  "colors":[
70
71                  ],
72                  "miniIconUrl":null,
73                  "targetSobjectType":null,
74                  "iconUrl":null,
75                  "urls":{
76
77                  },
78                  "icons":[
79
80                  ],
81                  "type":"Post",
82                  "label":"File"
83               },
84               {
85                  "quickActionName":"NewTask",
86                  "colors":[
87                     {
88                        "color":"44A12C",
89                        "theme":"theme4",
90                        "context":"primary"
91                     },
92                     {
93                        "color":"1797C0",
94                        "theme":"theme3",
95                        "context":"primary"
96                     }
97                  ],
98                  "miniIconUrl":"https://instance.
99                      salesforce.com/img/icon/tasks16.png",
100                  "targetSobjectType":"Task",
101                  "iconUrl":"https://instance.
102                      salesforce.com/img/icon/home32.png",
103                  "urls":{
104                     "quickAction":"/services/data/v34.0/
105                         quickActions/NewTask",
106                     "defaultValues":"/services/data/v34.0/
107                         quickActions/NewTask/defaultValues",
108                     "describe":"/services/data/v34.0/
109                         quickActions/NewTask/describe"
110                  },
111                  "icons":[
112                     {
113                        "url":"https://instance.
114                            salesforce.com/img/icon/home32.png",
115                        "height":32,
116                        "theme":"theme3",
117                        "width":32,
118                        "contentType":"image/png"
119                     },
120                     {
121                        "url":"https://instance.
122                            salesforce.com/img/icon/tasks16.png",
123                        "height":16,
124                        "theme":"theme3",
125                        "width":16,
126                        "contentType":"image/png"
127                     },
128                     ...
129                  ],
130                  "type":"Create",
131                  "label":"New Task"
132               },
133               {
134                  "quickActionName":"NewContact",
135
136                     ...
137                  ],
138                  "type":"Create",
139                  "label":"New Contact"
140               },
141               ...
142                  "type":"Create",
143                  "label":"New Lead"
144               },
145               {
146                  "quickActionName":"FeedItem.LinkPost",
147                  "colors":[
148
149                  ],
150                  "miniIconUrl":null,
151                  "targetSobjectType":null,
152                  "iconUrl":null,
153                  "urls":{
154
155                  },
156                  "icons":[
157
158                  ],
159                  "type":"Post",
160                  "label":"Link"
161               },
162               {
163                  "quickActionName":"FeedItem.PollPost",
164                  "colors":[
165
166                  ],
167                  "miniIconUrl":null,
168                  "targetSobjectType":null,
169                  "iconUrl":null,
170                  "urls":{
171
172                  },
173                  "icons":[
174
175                  ],
176                  "type":"Post",
177                  "label":"Poll"
178               }
179            ]
180         },
181         "id":"00hR0000000MpLAIA0"
182      }
183   ]
184}

Use the describe layouts resource to obtain a description of a layout for a specific object, including action objects. The resource uses a URI of the format: services/data/ v34.0/sobjects/object/describe/layouts/