What are AloAi Agents' custom functions?
AloAi Custom Functions are user-defined features that allow AloAi Voice and Text Agents to communicate with external systems using APIs. These functions execute dynamic, real-time tasks such as fetching customer data, updating records, or confirming appointments—based on user input during conversations.
By integrating with APIs, AloAi agents can personalize user interactions and automate backend workflows, helping businesses boost responsiveness and efficiency.
What problems do custom functions solve?
Custom Functions enable real-time data retrieval and action execution, reducing manual tasks and delays in customer service. They bridge the gap between a user's question and operational systems like CRMs, booking platforms, or internal tools.
They solve:
The need for real-time, data-driven responses
Manual processing of customer inquiries
Gaps between conversational interfaces and operational systems
Who can use custom functions?
Business admins can set up, test, and manage custom functions. They control how variables are defined, which API endpoints are used, and how responses are mapped.
Average users benefit from a smarter, more interactive experience with the assistant. Instead of canned replies, users receive responses informed by real-time data.
When should you use custom functions?
Use Custom Functions when your AloAi agent needs to interact with real-time external data or trigger backend actions during a conversation. Below are common use cases for both Text and Voice Agents.
AloAi Text Agents
Self-service answers from live data
Use a function to automatically pull policy information, pricing, or order status from your support systems.
Example: When a user asks, “What’s your return policy?”, the agent uses a function to fetch the latest policy from your knowledge base.
Lead capture and qualification
Automatically follow up with missed callers or new inquiries by asking for key lead details (e.g., business size). Based on their answers, the function can update your CRM or route the lead to sales.
Appointment booking via text
Connect the agent to your scheduling tool. Users can check available slots and confirm bookings without agent assistance—all done through a triggered API call.
Personalized marketing responses
If a user asks about promotions, the agent can call a function to pull applicable offers from your CRM and reply with tailored content or follow-up actions (e.g., sending a discount code).
AloAi Voice Agents
Smart call routing and IVR
Voice Agents can handle routing using logic from your internal systems.
Example: If the caller says “billing,” a function determines the right department and handles the transfer.
Missed call follow-up
When no one is available to take the call, use a function to log the details and send a follow-up via SMS or email—ensuring no inquiry is lost.
Legal and consulting intake
Voice Agents can pre-screen callers by collecting case or inquiry details. The function forwards this data to your intake system for review by your team.
Outbound sales and booking
For sales development (SDR/BDR) tasks, Voice Agents can call leads, assess interest using a function, and schedule meetings directly in your calendar.
Creating and applying a custom function
Adding a new custom function
To create a function, go to your AloAi Agent (Voice or Text) and navigate to the Custom Functions tab.
Click +Add Function.
Configure your custom function
Name it and describe what it does. The description helps the agent understand when to use this function and what to say when it’s called.
Additional settings
Respond to the contact during execution - enable this option if you want the agent to provide audible feedback while executing the function. This is particularly helpful if the execution takes longer than 3 seconds.
Respond to the contact after execution - enable this option if you want the agent to communicate with the contact after the function has completed.
Additional settings
Define your variables
Determine the pieces of information you need (e.g., CustomerFirstName, CustomerLastName, CustomerEmail).
Each variable should have a type (string, number, etc.) and indicate whether it is required for execution.
CustomerEmail - string, required
CustomerLastName - string, required
CustomerFirstName - string, required
Setup the API request
Select the appropriate method for your request based on your API requirements.
In this example, a POST request is recommended for creating new resources. However, if POST is unavailable, you may opt for a GET request to retrieve data instead.
Method available:
GET - used to retrieve data from the server. It does not modify any resources and is typically safe and idempotent.
POST - utilized to create new resources on the server. It submits data to be processed and can result in a change in the server's state.
PUT - employed to update an existing resource entirely. It replaces the resource with the request payload and is idempotent.
DELETE - used to remove a specified resource from the server. This method is idempotent, meaning repeated requests will have the same effect.
PATCH - similar to PUT, but it is used to apply partial modifications to a resource. It updates only the fields provided in the request.
Add parameters - add any necessary query parameters or body data that your API endpoint requires.
Examples of JSONs:
Execute the function and test the API call
Connect and send data - use the defined function to send the prepared data to the API, simulating the request as needed. Ensure that you provide real data values during testing.
Handle API responses
Save and test your function
Ensure to save your function once all parameters and settings are configured properly.
Integrate with user interactions
Integrate the function into user prompts - specify when the custom function should be called based on user queries (e.g., if a user asks about Cancel Customer Reservation or Account).
Add action > Custom function
Select custom function
Example:
If the user asks about the cancel reservation:
Add action - cancel customer account
Specify which custom function to use