Custom Functions
Custom functions let your voice agents call external HTTP endpoints mid-conversation. When the agent determines it needs to perform an action — check the weather, book an appointment, look up an order — it invokes a function you’ve defined, waits for the response, and continues the conversation with that data.How it works
- You define a function with a name, description, URL, and input/output schema
- You attach it to an agent
- During a voice call, the agent’s LLM reads the description and decides when to call it
- The bot sends a
POSTrequest to your URL with the input parameters - Your endpoint responds with data
- The agent uses that data to continue the conversation
Create a function
Response
Header values are encrypted at rest and never returned by the API. Only
header_keys (the key names) appear in responses.Function fields
Schema fields
Each entry ininput_schema or output_schema:
Reserved function names
These names are used by built-in integrations and cannot be used:knowledge_base_search, calendar_create_event, calendar_list_events, calendar_update_event, calendar_delete_event, gmail_send_email, gmail_search_emails, slack_send_message, slack_list_channels, add_to_cart, view_cart, clear_cart, checkout
Attach a function to an agent
After creating a function, attach it to one or more agents:Response
Enable or disable a function for an agent
Functions are enabled by default when attached. Toggle withenabled:
cURL
Response
Detach a function from an agent
cURL
204 No Content on success.
List functions on an agent
See all functions currently active on an agent:cURL
Response
Manage functions
List all your functions
cURL
Get a single function
cURL
Update a function
All fields are optional — only provided fields are updated.cURL
Delete a function
cURL
204 No Content. Deleting a function automatically detaches it from all agents.
Full lifecycle example
Building your function endpoint
Your endpoint receives aPOST request from the bot with the input fields in the body:
output_schema:
- Must respond within the configured
timeout(default 30 seconds) - Must return valid JSON
- Must return a
2xxstatus code - HTTPS required in production
error_message and continues the conversation.
Error responses
Tips
- Keep timeouts short. Users are waiting in real-time. A 10-second timeout feels like an eternity in a voice conversation.
- Use
started_messages. They fill the silence while your endpoint processes. Without them, there is dead air. - One function, many agents. Create a function once and attach it to as many agents as you need.
Next steps
Quick Start
Create an agent to attach functions to.
Knowledge Base
Give your agent document context alongside custom functions.