Custom Functions
Create a custom function
Registers an HTTP endpoint the agent can call mid-conversation. See Custom Functions for the request contract your endpoint must satisfy.
POST
/
functions
Create a custom function
curl --request POST \
--url https://api.vocobase.com/api/v2/functions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "check_order_status",
"description": "Look up the status of a customer order by order number.",
"url": "https://api.example.com/vocobase/order-status",
"headers": [
{
"key": "X-Api-Key",
"value": "sk_live_..."
}
],
"input_schema": [
{
"name": "order_number",
"type": "string",
"description": "The customer's order number.",
"required": true
}
],
"timeout": 10,
"started_messages": [
"Let me look that up for you."
]
}
EOFimport requests
url = "https://api.vocobase.com/api/v2/functions"
payload = {
"name": "check_order_status",
"description": "Look up the status of a customer order by order number.",
"url": "https://api.example.com/vocobase/order-status",
"headers": [
{
"key": "X-Api-Key",
"value": "sk_live_..."
}
],
"input_schema": [
{
"name": "order_number",
"type": "string",
"description": "The customer's order number.",
"required": True
}
],
"timeout": 10,
"started_messages": ["Let me look that up for you."]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'check_order_status',
description: 'Look up the status of a customer order by order number.',
url: 'https://api.example.com/vocobase/order-status',
headers: [{key: 'X-Api-Key', value: 'sk_live_...'}],
input_schema: [
{
name: 'order_number',
type: 'string',
description: 'The customer\'s order number.',
required: true
}
],
timeout: 10,
started_messages: ['Let me look that up for you.']
})
};
fetch('https://api.vocobase.com/api/v2/functions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vocobase.com/api/v2/functions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'check_order_status',
'description' => 'Look up the status of a customer order by order number.',
'url' => 'https://api.example.com/vocobase/order-status',
'headers' => [
[
'key' => 'X-Api-Key',
'value' => 'sk_live_...'
]
],
'input_schema' => [
[
'name' => 'order_number',
'type' => 'string',
'description' => 'The customer\'s order number.',
'required' => true
]
],
'timeout' => 10,
'started_messages' => [
'Let me look that up for you.'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vocobase.com/api/v2/functions"
payload := strings.NewReader("{\n \"name\": \"check_order_status\",\n \"description\": \"Look up the status of a customer order by order number.\",\n \"url\": \"https://api.example.com/vocobase/order-status\",\n \"headers\": [\n {\n \"key\": \"X-Api-Key\",\n \"value\": \"sk_live_...\"\n }\n ],\n \"input_schema\": [\n {\n \"name\": \"order_number\",\n \"type\": \"string\",\n \"description\": \"The customer's order number.\",\n \"required\": true\n }\n ],\n \"timeout\": 10,\n \"started_messages\": [\n \"Let me look that up for you.\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vocobase.com/api/v2/functions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"check_order_status\",\n \"description\": \"Look up the status of a customer order by order number.\",\n \"url\": \"https://api.example.com/vocobase/order-status\",\n \"headers\": [\n {\n \"key\": \"X-Api-Key\",\n \"value\": \"sk_live_...\"\n }\n ],\n \"input_schema\": [\n {\n \"name\": \"order_number\",\n \"type\": \"string\",\n \"description\": \"The customer's order number.\",\n \"required\": true\n }\n ],\n \"timeout\": 10,\n \"started_messages\": [\n \"Let me look that up for you.\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/functions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"check_order_status\",\n \"description\": \"Look up the status of a customer order by order number.\",\n \"url\": \"https://api.example.com/vocobase/order-status\",\n \"headers\": [\n {\n \"key\": \"X-Api-Key\",\n \"value\": \"sk_live_...\"\n }\n ],\n \"input_schema\": [\n {\n \"name\": \"order_number\",\n \"type\": \"string\",\n \"description\": \"The customer's order number.\",\n \"required\": true\n }\n ],\n \"timeout\": 10,\n \"started_messages\": [\n \"Let me look that up for you.\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "fn_3d2c1b0a-9876-5432-10fe-dcba98765432",
"name": "check_order_status",
"description": "Look up the status of a customer order by order number.",
"method": "POST",
"url": "https://api.example.com/vocobase/order-status",
"header_keys": [
"X-Api-Key"
],
"input_schema": [
{
"name": "order_number",
"type": "string",
"description": "The customer's order number.",
"required": true
}
],
"output_schema": [
{
"name": "status",
"type": "string",
"description": "Current order status.",
"required": true
},
{
"name": "eta_days",
"type": "number",
"description": "Days until delivery.",
"required": false
}
],
"timeout": 10,
"started_messages": [
"Let me look that up for you."
],
"error_message": "I could not reach the order system just now.",
"created_at": "2026-07-02T10:15:00.000Z",
"updated_at": "2026-08-11T09:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Name must be snake_case (lowercase, numbers, underscores, start with letter)"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds."
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}Authorizations
API key in format: rg_live_xxxx. Pass as a Bearer token in the Authorization header.
Body
application/json
snake_case, starts with a letter. Reserved names are rejected.
Maximum string length:
50Maximum string length:
500Maximum string length:
2000Encrypted at rest. Only the keys are ever returned.
Maximum array length:
10Show child attributes
Show child attributes
Maximum array length:
100Show child attributes
Show child attributes
Maximum array length:
100Show child attributes
Show child attributes
Defaults to 30.
Required range:
1 <= x <= 60Maximum array length:
5Maximum string length:
200Maximum string length:
500⌘I
Create a custom function
curl --request POST \
--url https://api.vocobase.com/api/v2/functions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "check_order_status",
"description": "Look up the status of a customer order by order number.",
"url": "https://api.example.com/vocobase/order-status",
"headers": [
{
"key": "X-Api-Key",
"value": "sk_live_..."
}
],
"input_schema": [
{
"name": "order_number",
"type": "string",
"description": "The customer's order number.",
"required": true
}
],
"timeout": 10,
"started_messages": [
"Let me look that up for you."
]
}
EOFimport requests
url = "https://api.vocobase.com/api/v2/functions"
payload = {
"name": "check_order_status",
"description": "Look up the status of a customer order by order number.",
"url": "https://api.example.com/vocobase/order-status",
"headers": [
{
"key": "X-Api-Key",
"value": "sk_live_..."
}
],
"input_schema": [
{
"name": "order_number",
"type": "string",
"description": "The customer's order number.",
"required": True
}
],
"timeout": 10,
"started_messages": ["Let me look that up for you."]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'check_order_status',
description: 'Look up the status of a customer order by order number.',
url: 'https://api.example.com/vocobase/order-status',
headers: [{key: 'X-Api-Key', value: 'sk_live_...'}],
input_schema: [
{
name: 'order_number',
type: 'string',
description: 'The customer\'s order number.',
required: true
}
],
timeout: 10,
started_messages: ['Let me look that up for you.']
})
};
fetch('https://api.vocobase.com/api/v2/functions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vocobase.com/api/v2/functions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'check_order_status',
'description' => 'Look up the status of a customer order by order number.',
'url' => 'https://api.example.com/vocobase/order-status',
'headers' => [
[
'key' => 'X-Api-Key',
'value' => 'sk_live_...'
]
],
'input_schema' => [
[
'name' => 'order_number',
'type' => 'string',
'description' => 'The customer\'s order number.',
'required' => true
]
],
'timeout' => 10,
'started_messages' => [
'Let me look that up for you.'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vocobase.com/api/v2/functions"
payload := strings.NewReader("{\n \"name\": \"check_order_status\",\n \"description\": \"Look up the status of a customer order by order number.\",\n \"url\": \"https://api.example.com/vocobase/order-status\",\n \"headers\": [\n {\n \"key\": \"X-Api-Key\",\n \"value\": \"sk_live_...\"\n }\n ],\n \"input_schema\": [\n {\n \"name\": \"order_number\",\n \"type\": \"string\",\n \"description\": \"The customer's order number.\",\n \"required\": true\n }\n ],\n \"timeout\": 10,\n \"started_messages\": [\n \"Let me look that up for you.\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vocobase.com/api/v2/functions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"check_order_status\",\n \"description\": \"Look up the status of a customer order by order number.\",\n \"url\": \"https://api.example.com/vocobase/order-status\",\n \"headers\": [\n {\n \"key\": \"X-Api-Key\",\n \"value\": \"sk_live_...\"\n }\n ],\n \"input_schema\": [\n {\n \"name\": \"order_number\",\n \"type\": \"string\",\n \"description\": \"The customer's order number.\",\n \"required\": true\n }\n ],\n \"timeout\": 10,\n \"started_messages\": [\n \"Let me look that up for you.\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/functions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"check_order_status\",\n \"description\": \"Look up the status of a customer order by order number.\",\n \"url\": \"https://api.example.com/vocobase/order-status\",\n \"headers\": [\n {\n \"key\": \"X-Api-Key\",\n \"value\": \"sk_live_...\"\n }\n ],\n \"input_schema\": [\n {\n \"name\": \"order_number\",\n \"type\": \"string\",\n \"description\": \"The customer's order number.\",\n \"required\": true\n }\n ],\n \"timeout\": 10,\n \"started_messages\": [\n \"Let me look that up for you.\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "fn_3d2c1b0a-9876-5432-10fe-dcba98765432",
"name": "check_order_status",
"description": "Look up the status of a customer order by order number.",
"method": "POST",
"url": "https://api.example.com/vocobase/order-status",
"header_keys": [
"X-Api-Key"
],
"input_schema": [
{
"name": "order_number",
"type": "string",
"description": "The customer's order number.",
"required": true
}
],
"output_schema": [
{
"name": "status",
"type": "string",
"description": "Current order status.",
"required": true
},
{
"name": "eta_days",
"type": "number",
"description": "Days until delivery.",
"required": false
}
],
"timeout": 10,
"started_messages": [
"Let me look that up for you."
],
"error_message": "I could not reach the order system just now.",
"created_at": "2026-07-02T10:15:00.000Z",
"updated_at": "2026-08-11T09:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Name must be snake_case (lowercase, numbers, underscores, start with letter)"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds."
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}