Connect external APIs as functions
Integrate a third-party API so the agent can retrieve or send data during a live call.
An External API function lets your agent call a third-party API in real time during a call and use the response in its reply. You can connect any REST endpoint, including automation tools, CRMs, or custom backends.
When to use an External API function
Use this function type when the agent needs information it doesn't have in its instructions or knowledge base.
Common use cases include:
Check whether a product is in stock and return its price.
Look up a customer's account status before discussing their support issue.
Create a record in a CRM when a sale is confirmed during the call.
Trigger a workflow in an automation platform when a specific condition is met.
Before you start
Make sure you have the following:
An agent created. See Create an agent.
A REST API endpoint that Agentalk can call.
The API URL and any required authentication credentials.
Configure the external API function
Follow these steps to add and configure an External API function.
The following example shows how the setup appears in the interface.
Define basic information
Define what the function does and when it runs.
In the Function Name field, enter a unique name using only letters, numbers, or underscores (for example,
search_products).In the Function Description field, describe what the function does and when the agent should use it. Example:
Search products in the system by name or category.In the Response Message field, enter the message the agent will use after the function runs. This message can include data returned by the API.

Configure API settings
Define how the agent connects to your API.
In the HTTP Method dropdown, select the request method required by your API (for example,
GETorPOST).In the API URL field, enter the full endpoint URL. Example:
https://api.yourstore.com/search(Optional) Add headers if your API requires them:
Click Add Header +.
Enter the header name (for example,
Authorization).Enter the value (for example, an API key or token).
Add parameters:
Click Add Parameter +.
In Parameter Name, enter the parameter name exactly as your API expects it (for example,
product_name).In Parameter Description, describe what the agent should extract from the conversation. Example: The name of the product the caller is asking about.
Enable Required if the parameter must always be included in the request.
Click Create Function + to add the function.

The agent uses the parameter description to determine what value to send when the function runs.
Verify the function behavior
After testing, confirm the following:
The function triggers at the correct time.
The agent sends the correct parameters.
The agent uses the API response accurately.
The response time is suitable for a live call.
Example: External API function in a call
This example shows how the function is configured and used during a call.
Configuration
Function name:
check_product_availabilityHTTP method:
GETAPI URL:
https://api.gadgetstore.com/v1/products/searchHeaders:
Authorization: Bearer YOUR_API_KEY
Parameters:
product_name(required): Product name mentioned by the caller
Call flow example
This example shows how the function runs during a conversation.
Caller asks: "Do you have the iPhone 17 in stock?"
The agent runs the function.
The agent sends
product_name: "iPhone 17"to the API.The API returns availability and price.
The agent responds with the information.
Next steps
Here are the recommended next steps after completing this guide:
Use built-in functions: Combine external APIs with core agent actions.
Manage contacts: Use contact data to personalize API responses.
Create an agent: Apply your API integration in a live agent.
Last updated
