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.
curl -X POST https://api.vocobase.com/api/v2/functions \ -H "Authorization: Bearer rg_live_abc123def456ghi789jkl012" \ -H "Content-Type: application/json" \ -d '{ "name": "get_weather", "description": "Retrieve current weather for a city. Call this when the user asks about weather conditions.", "url": "https://api.weather.com/v1/current", "headers": [ { "key": "Authorization", "value": "Bearer weather_api_key_here" } ], "input_schema": [ { "name": "city", "type": "string", "description": "City name", "required": true } ], "output_schema": [ { "name": "temperature", "type": "number", "description": "Temperature in Celsius", "required": true }, { "name": "condition", "type": "string", "description": "Weather condition (e.g., Sunny, Rainy)", "required": true } ], "timeout": 10, "started_messages": ["Checking the weather...", "Let me look that up..."], "error_message": "Sorry, I could not get the weather right now." }'
Response
{ "success": true, "data": { "id": "f1234567-abcd-1234-abcd-123456789012", "name": "get_weather", "description": "Retrieve current weather for a city...", "method": "POST", "url": "https://api.weather.com/v1/current", "header_keys": ["Authorization"], "input_schema": [...], "output_schema": [...], "timeout": 10, "started_messages": ["Checking the weather...", "Let me look that up..."], "error_message": "Sorry, I could not get the weather right now.", "created_at": "2026-04-16T10:30:00Z", "updated_at": "2026-04-16T10:30:00Z" }}
Header values are encrypted at rest and never returned by the API. Only header_keys (the key names) appear in responses.
{ "name": "city", "type": "string", "description": "City name to look up", "required": true}
Field
Type
Description
name
string
Field name
type
string
string, number, boolean, string[], number[], or custom
description
string
Helps the LLM understand what to pass or expect
required
boolean
Whether the field is mandatory
jsonSchema
object
Required when type is custom. A JSON Schema object for complex types.
The description field on the function is the most important part. The LLM uses it to decide when to call the function. Be explicit: “Call this when the user asks about order status” is better than “Get order info”.
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
Write clear descriptions. The description is the #1 factor in whether the agent calls the function at the right time. Include specific trigger phrases: “Call this when the user asks about their order status or delivery date.”
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.