Custom Functions
Update a custom function
Every field is optional; only what you send changes. Sending headers replaces the whole set.
PUT
/
functions
/
{id}
Update a custom function
curl --request PUT \
--url https://api.vocobase.com/api/v2/functions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Look up order status and expected delivery date.",
"timeout": 15
}
'import requests
url = "https://api.vocobase.com/api/v2/functions/{id}"
payload = {
"description": "Look up order status and expected delivery date.",
"timeout": 15
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Look up order status and expected delivery date.', timeout: 15})
};
fetch('https://api.vocobase.com/api/v2/functions/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Look up order status and expected delivery date.',
'timeout' => 15
]),
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/{id}"
payload := strings.NewReader("{\n \"description\": \"Look up order status and expected delivery date.\",\n \"timeout\": 15\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.vocobase.com/api/v2/functions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Look up order status and expected delivery date.\",\n \"timeout\": 15\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/functions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Look up order status and expected delivery date.\",\n \"timeout\": 15\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": 15,
"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": "agent_name is required and must be max 50 characters"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}{
"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.
Path Parameters
Function ID.
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
Update a custom function
curl --request PUT \
--url https://api.vocobase.com/api/v2/functions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Look up order status and expected delivery date.",
"timeout": 15
}
'import requests
url = "https://api.vocobase.com/api/v2/functions/{id}"
payload = {
"description": "Look up order status and expected delivery date.",
"timeout": 15
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Look up order status and expected delivery date.', timeout: 15})
};
fetch('https://api.vocobase.com/api/v2/functions/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Look up order status and expected delivery date.',
'timeout' => 15
]),
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/{id}"
payload := strings.NewReader("{\n \"description\": \"Look up order status and expected delivery date.\",\n \"timeout\": 15\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.vocobase.com/api/v2/functions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Look up order status and expected delivery date.\",\n \"timeout\": 15\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/functions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Look up order status and expected delivery date.\",\n \"timeout\": 15\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": 15,
"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": "agent_name is required and must be max 50 characters"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}{
"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"
}
}