Overview
Custom server actions allow your AI Agent to connect with external APIs, fetch real-time information, and provide more dynamic responses. In this guide, we’ll walk through setting up a weather API action that retrieves weather details for a given location.How to Create a Custom Server Action
Step 1: Create a Custom Server Action
- Go to the Actions tab.
- Click List from the left-hand menu.
- Select Create Action.

- Choose Server Action under Custom Action.

- Enter an Action Title in the pop-up window and click Create.

- You will then see the action details page, where you can enable or disable the action.

Step 2: Basic Settings
-
Name:
Enter a descriptive name for the action.
- Example: weather
-
Description:
Provide a short explanation of what this action does and when it should be used.
- Example: Get the weather in a location.

Step 3: Define Parameters
Parameters are the data inputs the action needs to run. In this case, we want the location from the user.- Name: location
- Description: The location to get the weather for.
- Type: Text
- Required: ✔️ Yes
Step 4: Configure the API Request
Next, configure the API call that will be made when the action is triggered.- Method: POST (or GET depending on the API endpoint you’re using)
-
HTTPS URL: Paste the API or webhook endpoint.
- Example:
https://example.com/weather
(for testing)
- Example:
-
Parameters / Headers / Body:
-
You can map the location parameter into the request body or query string, depending on how your weather API expects the input. Parameters can be mapped using mustache templates, as shown in the example:
{{location}}
. This tells the system to dynamically replace the placeholder with the user’s actual input when making the API call. - Example (for JSON body):
-
You can map the location parameter into the request body or query string, depending on how your weather API expects the input. Parameters can be mapped using mustache templates, as shown in the example:

Step 5: Test the Request
At the bottom of the configuration screen, you’ll see the Test Response section.- Click Test now to simulate the request.
- Verify that the API responds with the expected weather data.
- If successful, the response will be available for the AI Agent to format into a reply for the user.

Example Workflow
- User asks: “What’s the weather in Tokyo?”
- AI Agent collects the parameter location = Tokyo.
- Action sends request to the weather API.
- API responds with real-time weather data.
- AI Agent replies: “The weather in Tokyo is 28°C with light rain.”