Knowledge bases
Create knowledge base
Create a knowledge base: empty, or with its first files uploaded in the same call.
POST
/
knowledge-base
Create knowledge base
curl --request POST \
--url https://api.verbeo.ai/v1/knowledge-base \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>"
}
'import requests
url = "https://api.verbeo.ai/v1/knowledge-base"
payload = { "display_name": "<string>" }
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({display_name: '<string>'})
};
fetch('https://api.verbeo.ai/v1/knowledge-base', 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.verbeo.ai/v1/knowledge-base",
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([
'display_name' => '<string>'
]),
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.verbeo.ai/v1/knowledge-base"
payload := strings.NewReader("{\n \"display_name\": \"<string>\"\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.verbeo.ai/v1/knowledge-base")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v1/knowledge-base")
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 \"display_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCreates a knowledge base. Send JSON to create it empty, or a multipart form to create it with its first files in the same call.
Then upload files or add text to it.
The request is all or nothing: if a file is refused, the knowledge base is not created either, and the error names the file.
Read the knowledge base until
And the errors every route can give.
Create it empty (JSON)
curl -X POST "https://api.verbeo.ai/v1/knowledge-base" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "display_name": "Clinic FAQ" }'
Create it with files (multipart)
A file to upload. Repeat the field for each file: up to 25 files, together up to 25 MB. Uploading files lists the types.
curl -X POST "https://api.verbeo.ai/v1/knowledge-base" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "display_name=Clinic FAQ" \
-F "files=@prices.pdf" \
-F "files=@opening-hours.docx"
import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("display_name", "Clinic FAQ");
for (const name of ["prices.pdf", "opening-hours.docx"]) {
form.append("files", new Blob([await readFile(name)]), name);
}
const res = await fetch("https://api.verbeo.ai/v1/knowledge-base", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.VERBEO_API_KEY}` },
body: form,
});
const { data: knowledgeBase } = await res.json();
import os, requests
res = requests.post(
"https://api.verbeo.ai/v1/knowledge-base",
headers={"Authorization": f"Bearer {os.environ['VERBEO_API_KEY']}"},
data={"display_name": "Clinic FAQ"},
files=[
("files", open("prices.pdf", "rb")),
("files", open("opening-hours.docx", "rb")),
],
)
knowledge_base = res.json()["data"]
Response
201 Created with the knowledge base object. Created with files, it also carries files: each file object, in the order you sent them, processing.
{
"success": true,
"data": {
"id": "5df09066-0842-4c92-8ef0-6cf2ff6d7455",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000",
"agent_id": null,
"display_name": "Clinic FAQ",
"tool_description": null,
"tool_description_source": "generated",
"tool_description_review": false,
"tool_description_input_hash": null,
"metadata": {},
"created_at": "2026-11-07T09:12:44.512301+00:00",
"updated_at": "2026-11-07T09:12:44.512301+00:00",
"file_count": 2,
"ready_count": 0,
"processing_count": 2,
"error_count": 0,
"chunk_count": 0,
"files": [
{
"id": "c4ff0c9c-4b3b-4a94-a86e-3d3b64088ae0",
"store_id": "5df09066-0842-4c92-8ef0-6cf2ff6d7455",
"display_name": "prices.pdf",
"file_type": "application/pdf",
"file_size": 371989,
"status": "processing",
"error_code": null,
"error_message": null,
"chunk_count": 0,
"chunks_saved": 0,
"…": "every field of the file object"
},
{
"id": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"display_name": "opening-hours.docx",
"status": "processing",
"…": "every field of the file object"
}
]
}
}
processing_count is 0, then attach it to an assistant.
Errors
| Code | Status | When |
|---|---|---|
VALIDATION_FAILED | 422 | display_name missing (display_name: Required), empty or longer than 255 characters. In a form: no file (files: must include at least one file), more than 25, a file under another field name, a file with no name, or a type that is not taken (photo.png: This file type is not supported. …). |
KB_LIMIT | 409 | You have the knowledge bases your plan allows: The Free plan includes 2 knowledge bases. Upgrade to Pro for up to 25. |
KB_* | 409 | A file was refused, and nothing was created: see Errors. |
PAYLOAD_TOO_LARGE | 413 | More than 25 MB of files in one request. |
BAD_GATEWAY | 502 | The files could not be stored just now. Try again in a moment. Nothing was created. |
Was this page helpful?
⌘I
Create knowledge base
curl --request POST \
--url https://api.verbeo.ai/v1/knowledge-base \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>"
}
'import requests
url = "https://api.verbeo.ai/v1/knowledge-base"
payload = { "display_name": "<string>" }
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({display_name: '<string>'})
};
fetch('https://api.verbeo.ai/v1/knowledge-base', 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.verbeo.ai/v1/knowledge-base",
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([
'display_name' => '<string>'
]),
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.verbeo.ai/v1/knowledge-base"
payload := strings.NewReader("{\n \"display_name\": \"<string>\"\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.verbeo.ai/v1/knowledge-base")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v1/knowledge-base")
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 \"display_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body