Set up actions for your customer service agent
Actions let your customer service agent perform specific tasks by interacting with APIs or services. For example, you could create an action that checks the status of a customer’s order, or retrieves information about an incident.
By setting up actions, you can extend your agent’s capabilities and automate common support tasks. You can create as many actions as you need, and each action can be enabled or disabled at any time.
The customer service agent currently only supports read-only actions.
Create an action
To create an action for your customer service agent:
In your agent settings, select Actions from the sidebar.
Select Create action.
Fill in the action details
Action name: Enter a descriptive name for your action (for example, “Check order status”).
Description: Describe what the action does. This helps your agent understand when to use it.
Action type: Currently the feature only supports actions that retrieve data (Retriever).
Enabled: Select this checkbox to make the action available to your agent.
Set up the API operation
Method: Choose the HTTP method (GET, POST) based on what the action needs to do.
Server (Base URL): Enter the base URL of the API server (for example,
https://api.example.com
).Request URL (Path): Enter the specific endpoint path, starting with a slash (for example,
/orders/status
).
To get the Server (Base URL) and the Request URL (Path), check the documentation of the API you’re connecting to.
Add query parameters
If your API requires query parameters:
Under Query parameters, select Add query parameters.
Enter the key and value for each parameter. You can use variables by entering values like
${orderId}
.Select Add.
Add headers
If your API requires headers:
Under Headers, select Add headers.
Enter the key and value (for example,
Authorization
andBearer ${apiKey}
).Select Add.
Add a request body
When using the POST method, you can include a request body in your API call. The request body should be formatted as JSON containing key-value pairs:
{
"key1": "${variable1}",
"key2": "${variable2}",
"...": "..."
}
So, if you wanted to send the following data:
Name
Email
Your request body should look like this:
{
"name": "${name}"
"email": "${email_address}"
}
Ensure that the keys match the parameter names required by the API endpoint and that they're added as variables.
Define variables
Variables allow you to define dynamic values that can be used throughout your action, like input parameters that users can fill in when running the action.
Under Variables, select Add variable.
Enter the variable name, description, and data type (choose from: string, number, integer, or boolean).
If the variable is required for the API call, make sure to check the "Required" box. Failing to mark a required variable may result in the action parameter not being populated as expected.
Select Add variable.
The variable Name must match the Key in the query parameter or the Key in the JSON body.
Example
In Query parameters:
Key:
product
Value:
${product}
In Variables
Name:
product
Description:
The product to check for incidents
Data type:
String
Authentication
The authentication type defines how your action will connect to the API. Currently the only option is to have no authentication.
Save, test, and publish your action
Select Create action to save your action.
Use the Test button to try out your action and make sure it works as expected.
You can review the steps your agent has taken in Conversation review. Read more about reviewing conversations.
When you’re ready, select Publish to make the action available to your agent.
Was this helpful?