Agents
Replace the agent's attached dictionaries
Idempotent set-replace: overwrites the agent’s entire dictionary set with dictionary_ids. Duplicate ids are deduped silently. Every id must exist and belong to the calling account, else the whole request fails with VALIDATION_ERROR. The combined char_count across the resulting set must be at most 10,000 characters; otherwise the request fails with DICTIONARY_CHAR_LIMIT_EXCEEDED. Pass [] to detach all dictionaries. The swap is wrapped in a transaction — the attached set is never briefly partial.
PUT
/
agent
/
{id}
/
dictionaries
Replace the agent's attached dictionaries
curl --request PUT \
--url https://api.vocobase.com/api/v2/agent/{id}/dictionaries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dictionary_ids": [
"d1234567-abcd-1234-abcd-123456789012"
]
}
'import requests
url = "https://api.vocobase.com/api/v2/agent/{id}/dictionaries"
payload = { "dictionary_ids": ["d1234567-abcd-1234-abcd-123456789012"] }
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({dictionary_ids: ['d1234567-abcd-1234-abcd-123456789012']})
};
fetch('https://api.vocobase.com/api/v2/agent/{id}/dictionaries', 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/agent/{id}/dictionaries",
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([
'dictionary_ids' => [
'd1234567-abcd-1234-abcd-123456789012'
]
]),
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/agent/{id}/dictionaries"
payload := strings.NewReader("{\n \"dictionary_ids\": [\n \"d1234567-abcd-1234-abcd-123456789012\"\n ]\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/agent/{id}/dictionaries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dictionary_ids\": [\n \"d1234567-abcd-1234-abcd-123456789012\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/agent/{id}/dictionaries")
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 \"dictionary_ids\": [\n \"d1234567-abcd-1234-abcd-123456789012\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"dictionaries": [
{
"id": "d1234567-abcd-1234-abcd-123456789012",
"name": "Vocobase Product Catalog",
"term_count": 5,
"char_count": 52,
"attached_agent_count": 1,
"created_at": "2026-04-24T10:30:00.000Z",
"updated_at": "2026-04-24T10:30:00.000Z"
}
]
}
}Authorizations
API key in format: rg_live_xxxx. Pass as a Bearer token in the Authorization header.
Path Parameters
Agent ID.
Body
application/json
Full replacement set of dictionary IDs. Pass [] to detach all.
⌘I
Replace the agent's attached dictionaries
curl --request PUT \
--url https://api.vocobase.com/api/v2/agent/{id}/dictionaries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dictionary_ids": [
"d1234567-abcd-1234-abcd-123456789012"
]
}
'import requests
url = "https://api.vocobase.com/api/v2/agent/{id}/dictionaries"
payload = { "dictionary_ids": ["d1234567-abcd-1234-abcd-123456789012"] }
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({dictionary_ids: ['d1234567-abcd-1234-abcd-123456789012']})
};
fetch('https://api.vocobase.com/api/v2/agent/{id}/dictionaries', 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/agent/{id}/dictionaries",
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([
'dictionary_ids' => [
'd1234567-abcd-1234-abcd-123456789012'
]
]),
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/agent/{id}/dictionaries"
payload := strings.NewReader("{\n \"dictionary_ids\": [\n \"d1234567-abcd-1234-abcd-123456789012\"\n ]\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/agent/{id}/dictionaries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dictionary_ids\": [\n \"d1234567-abcd-1234-abcd-123456789012\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/agent/{id}/dictionaries")
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 \"dictionary_ids\": [\n \"d1234567-abcd-1234-abcd-123456789012\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"dictionaries": [
{
"id": "d1234567-abcd-1234-abcd-123456789012",
"name": "Vocobase Product Catalog",
"term_count": 5,
"char_count": 52,
"attached_agent_count": 1,
"created_at": "2026-04-24T10:30:00.000Z",
"updated_at": "2026-04-24T10:30:00.000Z"
}
]
}
}