---
schema_version: "1"
id: 073f29ed5b6e2f22a020f7e5453235b1c2a584640ae6fc3e565abc2eb1b55659
title: Quick Action APIs in Lightning Experience
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/case_feed_dev_guide/guides/quickactions/quickaction-api.md
canonical_url: https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d3b58e7c6bd4bb0bee9b107474f41b89432d5a44162cb521d0bae2fddc84d012
products:
  - Publisher and Quick Action Developer Guide
  - Platform Developer Content
---

# Quick Action APIs in Lightning Experience

A `lightning:quickActionAPI` component allows you to access methods for programmatically controlling quick actions on record pages. This component is supported in Lightning Experience and supports utility pop-out. This component requires API version 43.0 and later.

| Required Editions                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------- |
| Available in: Lightning Experience                                                                                    |
| Available in: **Group**, **Professional**, **Enterprise**, **Performance**, **Unlimited**, and **Developer** Editions |

For example, if you have a custom Aura component that displays Knowledge articles, you can use the `lightning:quickActionAPI` component to attach and send a Knowledge article from your custom component using the Email quick action on the case record page.

To access these methods, create an instance of the `lightning:quickActionAPI` component inside your Aura component or page and assign an `aura:id` attribute to it.

```xml
<lightning:quickActionAPI aura:id="quickActionAPI"/>
```

This component provides similar functionality to the [Publisher APIs in Salesforce Classic](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/case-feed-dev-guide-component-interactions.md).

## Sample Code

This example creates two buttons that interact with the Update Case quick action on a case record page in Lightning Experience. The controller code uses the following Quick Action API methods: [selectAction](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-selectaction.md), [setActionFieldValues](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-setactionfieldvalues.md), and [invokeAction](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-invokeaction.md).

Component code:

```html
<aura:component implements="flexipage:availableForRecordHome" description="My Lightning Component">
  <lightning:quickActionAPI aura:id="quickActionAPI" />
  <div>
    <lightning:button label="Select Update Case Action" onclick="{!c.selectUpdateCaseAction}" />
    <lightning:button label="Update Case Status Field" onclick="{!c.updateCaseStatusAction}" />
  </div>
</aura:component>
```

Controller code:

```javascript
({
  selectUpdateCaseAction: function (cmp, event, helper) {
    var actionAPI = cmp.find("quickActionAPI");
    var args = { actionName: "Case.UpdateCase" };
    actionAPI
      .selectAction(args)
      .then(function (result) {
        // Action selected; show data and set field values
      })
      .catch(function (e) {
        if (e.errors) {
          // If the specified action isn't found on the page,
          // show an error message in the my component
        }
      });
  },

  updateCaseStatusAction: function (cmp, event, helper) {
    var actionAPI = cmp.find("quickActionAPI");
    var fields = {
      Status: { value: "Closed" },
      Subject: { value: "Sets by lightning:quickActionAPI component" },
      accountName: { Id: "accountId" },
    };
    var args = { actionName: "Case.UpdateCase", entityName: "Case", targetFields: fields };
    actionAPI
      .setActionFieldValues(args)
      .then(function () {
        actionAPI.invokeAction(args);
      })
      .catch(function (e) {
        console.error(e.errors);
      });
  },
});
```

- **[Quick Action API Considerations](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-considerations.md)**


    Before working with the Lightning Quick Action JavaScript API methods, review some considerations that might impact your implementation.

- **[getAvailableActions](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-getavailableactions.md)**


    Allows custom components to get a list of the available actions on a record page.

- **[getAvailableActionFields](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-getavailableactionfields.md)**


    Allows custom components to get a list of the available fields for a specific action on a record page.

- **[getCustomAction](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-getcustomaction.md)**


    Allows custom components to access a custom quick action and pass data or messages to it.

- **[getSelectedActions](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-getselectedactions.md)**


    Allows custom components to access selected quick actions on a record page.

- **[invokeAction](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-invokeaction.md)**


    Allows custom components to save or submit the quick action on a record page.

- **[refresh](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-refresh.md)**


    Refreshes the current record page.

- **[selectAction](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-selectaction.md)**


    Allows custom components to select and focus on a quick action on a record page.

- **[setActionFieldValues](https://developer.salesforce.com/docs/platform/case-feed-dev-guide/guide/quickaction-api-setactionfieldvalues.md)**


    Allows custom components to select a quick action on a record page and then specify field values for that action.

**See Also**

- [Lightning Component Library: lightning:quickActionAPI](https://developer.salesforce.com/docs/component-library/bundle/lightning:quickActionAPI/documentation)
- [_Lightning Components Developer Guide_](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_framework.htm)
