Custom actions are no-code and deeply embedded integrations that can connect your live external data with Intercom. This live data can be used to power Fin, Workflows, and the Inbox, allowing your customers to self-serve their queries automatically.
A great way to get started is to think of common questions that your teammates spend considerable time answering, using information currently not available in Intercom.
These can be questions where your customers simply want to get information that you store on an external system such as, “What is my order status?”, or take action like, "Reschedule a delivery" or "Process a refund" in your external system.
When you know which questions you want to solve, it’s surprisingly simple and quick to set up a custom action with little to no technical expertise.
Creating a custom action
First, navigate to Settings > Integrations > Actions.
This is where you'll set up all the different connections you have to external data (e.g. Shopify, Salesforce, etc.) depending on your use case. Click Create action and then select Create custom action from the dropdown menu.
It's also possible to create actions for Fin straight from templates.
Usage
From the Usage dropdown you can choose to set up this custom action for:
AI Agent - Allow Fin to use this action to access or update external data
Workflows and Help Desk - Add this action to Workflows or allow teammates to use in Help Desk.
Choose Workflows and Help Desk if this action is not being used by Fin, or learn how to set up custom actions for Fin.
Name and description
Give your custom action a unique name that explains exactly which action it will be taking (e.g. “Get order ID”). Use the description field to tell teammates when to use this action and what information they can expect it to fetch (e.g. “Get order for a given ID. Order ID should be stored in Conversation CDA”).
API connection
Next, fill in the request details. This is where you’ll need to enter the HTTPS URL to the 3rd party system you’re connecting to (e.g. Shopify, Salesforce, etc.).
API Request
You can specify what action you’d like this request to take by selecting the method:
GET - Read and store information from the 3rd party system.
POST - Create or add information to the 3rd party system.
PUT - Update information in the 3rd party system.
DELETE - Remove information from the 3rd party system.
In this example, we’ll ask the request to GET the order ID from the API and enter the URL.
To make a request, the URL must be an HTTPS address and return a JSON response.
You can insert attributes from User, Conversation, Company, and events as templated values in the URL and in the request body of POST and PUT methods. Use custom data attributes you have already set up in your workspace. Or, for much greater data flexibility, try using custom objects.
HTTP headers
You can choose to add any additional parameters to this request by clicking Add key value pair and then select Key value pair under HTTP Headers:
Authentication
Custom actions support both fixed and dynamic tokens for authentication. Under the HTTP Headers, you can select the authentication token you want to use in the request, which will then be added to the header.
Request body
If you're making a POST or a PUT request, you'll have an option to provide a request body to include any data you want to send in the request:
Make sure to include appropriate HTTP headers as required by the API you're making a request to (for example, accept: application/json
and content-type: application\json
)
Test response
Next, you’ll need to test the response for this action to make sure it’s fetching the right data from the 3rd party system you’re connecting to.
Testing this request makes a connection with the API so it will complete the action you have created. For example, if you’ve asked it to DELETE data from the API, this information will be deleted. Try testing with a GET request to ensure you’re only reading information and not changing it.
Click Test request to check the custom action has been configured correctly. You should get a green tick and see the details of that request if the connection is validated with the API.
This is all the information you can now use to power your Workflows and provide customers with fast answers, such as order status.
Response mapping
This step is optional but it’s important if you want to use the data in your Workflows, particularly for GET requests. It tells the action where to store this information in Intercom so that it can be given to customers in your Workflows as answers to their questions.
Common scenarios where you might not need to store data are action request types PUT, POST, DELETE. For all GET requests, if you want to use the data in bots, you’ll need to store this data in Intercom.
JSON response data can be stored in:
Standard Objects: User and Conversation attributes.
Custom objects: Object attributes you have created in Intercom.
Select the Intercom object and then map it with the external API object.
All custom attributes and custom objects must be created before they can be used for response storage here.
Now select the data attributes in Intercom you want to store this information in. For example, we selected "Order" as the Intercom object and then selected "orders" as the API object in the external system and mapped it with the API attribute "order_id":
External data can only be stored in custom data attributes and not the standard Intercom data attributes.
Mapping response data to custom objects
When mapping with custom objects, you must map the ID to the external_id field otherwise it will create duplicates with each GET request. Learn more about setting up right references with Custom Objects
Updating references from People or Conversations
The next step is to select which references from People or Conversation relate to your custom object you want to update.
Set live
Once you’ve tested your custom action successfully, you’re ready to set it live.
Now you can use it in Workflows or in the inbox to allow customers to self-serve or your support team to fetch data from external sources 🎉
The current timeout limit for custom actions is 15 seconds.
Moving a custom action to draft
If you want to deprecate old custom actions that are no longer required, you can move them into draft state.
Go to Settings > Integrations > Actions and click on the custom action you want to move to draft then select Set to draft.
This will check for any dependencies on this custom action. You'll need to review and resolve these dependencies before moving it to draft state. For example, you may need to remove this custom action from a Workflow first.
Need more help? Get support from our Community Forum
Find answers and get help from Intercom Support and Community Experts