Add Knowledge Base
curl --request POST \
--url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"content": "<string>",
"tags": [
"<string>"
],
"refreshRate": "never",
"sitemapUrl": "<string>",
"urls": [
"<string>"
],
"maxPages": 123,
"scrapeContent": true
}
'import requests
url = "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb"
payload = {
"name": "<string>",
"content": "<string>",
"tags": ["<string>"],
"refreshRate": "never",
"sitemapUrl": "<string>",
"urls": ["<string>"],
"maxPages": 123,
"scrapeContent": True
}
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: '<string>',
content: '<string>',
tags: ['<string>'],
refreshRate: 'never',
sitemapUrl: '<string>',
urls: ['<string>'],
maxPages: 123,
scrapeContent: true
})
};
fetch('https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb', 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://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb",
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' => '<string>',
'content' => '<string>',
'tags' => [
'<string>'
],
'refreshRate' => 'never',
'sitemapUrl' => '<string>',
'urls' => [
'<string>'
],
'maxPages' => 123,
'scrapeContent' => true
]),
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://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"refreshRate\": \"never\",\n \"sitemapUrl\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ],\n \"maxPages\": 123,\n \"scrapeContent\": true\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://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"refreshRate\": \"never\",\n \"sitemapUrl\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ],\n \"maxPages\": 123,\n \"scrapeContent\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb")
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\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"refreshRate\": \"never\",\n \"sitemapUrl\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ],\n \"maxPages\": 123,\n \"scrapeContent\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": "<unknown>"
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Knowledge Base
Create KB
(Convocore agents only) Adds a new document to the agent’s knowledge base, if your agent is built with VF use Voiceflow’s API instead. This route must use the new V3 endpoints.
POST
/
agents
/
{agentId}
/
kb
Add Knowledge Base
curl --request POST \
--url https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"content": "<string>",
"tags": [
"<string>"
],
"refreshRate": "never",
"sitemapUrl": "<string>",
"urls": [
"<string>"
],
"maxPages": 123,
"scrapeContent": true
}
'import requests
url = "https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb"
payload = {
"name": "<string>",
"content": "<string>",
"tags": ["<string>"],
"refreshRate": "never",
"sitemapUrl": "<string>",
"urls": ["<string>"],
"maxPages": 123,
"scrapeContent": True
}
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: '<string>',
content: '<string>',
tags: ['<string>'],
refreshRate: 'never',
sitemapUrl: '<string>',
urls: ['<string>'],
maxPages: 123,
scrapeContent: true
})
};
fetch('https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb', 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://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb",
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' => '<string>',
'content' => '<string>',
'tags' => [
'<string>'
],
'refreshRate' => 'never',
'sitemapUrl' => '<string>',
'urls' => [
'<string>'
],
'maxPages' => 123,
'scrapeContent' => true
]),
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://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"refreshRate\": \"never\",\n \"sitemapUrl\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ],\n \"maxPages\": 123,\n \"scrapeContent\": true\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://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"refreshRate\": \"never\",\n \"sitemapUrl\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ],\n \"maxPages\": 123,\n \"scrapeContent\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu-gcp-api.vg-stuff.com/v3/agents/{agentId}/kb")
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\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"refreshRate\": \"never\",\n \"sitemapUrl\": \"<string>\",\n \"urls\": [\n \"<string>\"\n ],\n \"maxPages\": 123,\n \"scrapeContent\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": "<unknown>"
}{
"message": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>"
}
]
}Example: Add Text Document
{
"name": "Product FAQ",
"sourceType": "doc",
"content": "Your product FAQ content here...",
"metadata": {
"description": "Frequently asked questions about our product"
},
"tags": ["faq", "product"]
}
Example: Add URLs
{
"name": "Website Pages",
"sourceType": "url",
"urls": [
"https://example.com/about",
"https://example.com/pricing"
],
"scrapeContent": true,
"refreshRate": "3d"
}
Example: Crawl Sitemap
{
"name": "Full Website",
"sourceType": "sitemap",
"sitemapUrl": "https://example.com/sitemap.xml",
"maxPages": 100,
"scrapeContent": true,
"refreshRate": "7d"
}
URL and sitemap sources may take time to process. Check document status via
GET /agents/{agentId}/kb/{docId}.Set
refreshRate to automatically re-crawl URL sources. Options: 3d, 7d, or never.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
⌘I
