Update a knowledge base
curl --request PUT \
--url https://asteragents.com/api/kb/manage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Documentation",
"description": "<string>",
"extractionModel": "<string>",
"extractionSchema": {},
"trigger": {
"enabled": true,
"agentId": 42,
"prompt": "Summarize this document and extract key topics",
"createdAt": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://asteragents.com/api/kb/manage"
payload = {
"name": "Updated Documentation",
"description": "<string>",
"extractionModel": "<string>",
"extractionSchema": {},
"trigger": {
"enabled": True,
"agentId": 42,
"prompt": "Summarize this document and extract key topics",
"createdAt": "2023-11-07T05:31:56Z"
}
}
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({
name: 'Updated Documentation',
description: '<string>',
extractionModel: '<string>',
extractionSchema: {},
trigger: {
enabled: true,
agentId: 42,
prompt: 'Summarize this document and extract key topics',
createdAt: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://asteragents.com/api/kb/manage', 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://asteragents.com/api/kb/manage",
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([
'name' => 'Updated Documentation',
'description' => '<string>',
'extractionModel' => '<string>',
'extractionSchema' => [
],
'trigger' => [
'enabled' => true,
'agentId' => 42,
'prompt' => 'Summarize this document and extract key topics',
'createdAt' => '2023-11-07T05:31:56Z'
]
]),
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://asteragents.com/api/kb/manage"
payload := strings.NewReader("{\n \"name\": \"Updated Documentation\",\n \"description\": \"<string>\",\n \"extractionModel\": \"<string>\",\n \"extractionSchema\": {},\n \"trigger\": {\n \"enabled\": true,\n \"agentId\": 42,\n \"prompt\": \"Summarize this document and extract key topics\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\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://asteragents.com/api/kb/manage")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Documentation\",\n \"description\": \"<string>\",\n \"extractionModel\": \"<string>\",\n \"extractionSchema\": {},\n \"trigger\": {\n \"enabled\": true,\n \"agentId\": 42,\n \"prompt\": \"Summarize this document and extract key topics\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://asteragents.com/api/kb/manage")
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 \"name\": \"Updated Documentation\",\n \"description\": \"<string>\",\n \"extractionModel\": \"<string>\",\n \"extractionSchema\": {},\n \"trigger\": {\n \"enabled\": true,\n \"agentId\": 42,\n \"prompt\": \"Summarize this document and extract key topics\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"knowledgeBase": {
"id": 1,
"name": "Product Documentation",
"embeddingModel": "openai:text-embedding-3-small",
"embeddingDimensions": 1536,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"userId": "user_2ABC123DEF",
"fileCount": 12,
"status": "ready",
"description": "All product docs and user guides",
"extractionModel": "<string>",
"extractionSchema": {},
"source": null,
"trigger": {
"enabled": true,
"agentId": 42,
"prompt": "Summarize this document and extract key topics",
"createdAt": "2023-11-07T05:31:56Z"
},
"lastFileUploadedAt": "2023-11-07T05:31:56Z",
"totalSize": 123
}
}{
"error": "User is not part of any organization"
}{
"error": "Knowledge base not found"
}{
"error": "Internal Server Error"
}Knowledge Bases API
Update a knowledge base
Update an existing knowledge base by ID.
The embedding model cannot be changed after creation — only the name, description, extraction settings, and trigger can be updated.
PUT
/
kb
/
manage
Update a knowledge base
curl --request PUT \
--url https://asteragents.com/api/kb/manage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Documentation",
"description": "<string>",
"extractionModel": "<string>",
"extractionSchema": {},
"trigger": {
"enabled": true,
"agentId": 42,
"prompt": "Summarize this document and extract key topics",
"createdAt": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://asteragents.com/api/kb/manage"
payload = {
"name": "Updated Documentation",
"description": "<string>",
"extractionModel": "<string>",
"extractionSchema": {},
"trigger": {
"enabled": True,
"agentId": 42,
"prompt": "Summarize this document and extract key topics",
"createdAt": "2023-11-07T05:31:56Z"
}
}
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({
name: 'Updated Documentation',
description: '<string>',
extractionModel: '<string>',
extractionSchema: {},
trigger: {
enabled: true,
agentId: 42,
prompt: 'Summarize this document and extract key topics',
createdAt: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://asteragents.com/api/kb/manage', 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://asteragents.com/api/kb/manage",
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([
'name' => 'Updated Documentation',
'description' => '<string>',
'extractionModel' => '<string>',
'extractionSchema' => [
],
'trigger' => [
'enabled' => true,
'agentId' => 42,
'prompt' => 'Summarize this document and extract key topics',
'createdAt' => '2023-11-07T05:31:56Z'
]
]),
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://asteragents.com/api/kb/manage"
payload := strings.NewReader("{\n \"name\": \"Updated Documentation\",\n \"description\": \"<string>\",\n \"extractionModel\": \"<string>\",\n \"extractionSchema\": {},\n \"trigger\": {\n \"enabled\": true,\n \"agentId\": 42,\n \"prompt\": \"Summarize this document and extract key topics\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\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://asteragents.com/api/kb/manage")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Documentation\",\n \"description\": \"<string>\",\n \"extractionModel\": \"<string>\",\n \"extractionSchema\": {},\n \"trigger\": {\n \"enabled\": true,\n \"agentId\": 42,\n \"prompt\": \"Summarize this document and extract key topics\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://asteragents.com/api/kb/manage")
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 \"name\": \"Updated Documentation\",\n \"description\": \"<string>\",\n \"extractionModel\": \"<string>\",\n \"extractionSchema\": {},\n \"trigger\": {\n \"enabled\": true,\n \"agentId\": 42,\n \"prompt\": \"Summarize this document and extract key topics\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"knowledgeBase": {
"id": 1,
"name": "Product Documentation",
"embeddingModel": "openai:text-embedding-3-small",
"embeddingDimensions": 1536,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"userId": "user_2ABC123DEF",
"fileCount": 12,
"status": "ready",
"description": "All product docs and user guides",
"extractionModel": "<string>",
"extractionSchema": {},
"source": null,
"trigger": {
"enabled": true,
"agentId": 42,
"prompt": "Summarize this document and extract key topics",
"createdAt": "2023-11-07T05:31:56Z"
},
"lastFileUploadedAt": "2023-11-07T05:31:56Z",
"totalSize": 123
}
}{
"error": "User is not part of any organization"
}{
"error": "Knowledge base not found"
}{
"error": "Internal Server Error"
}Authorizations
JWT token from Clerk authentication.
Must be from a user with org:admin role.
Query Parameters
The ID of the knowledge base to update
Example:
1
Body
application/json
Knowledge base name
Example:
"Updated Documentation"
Optional description
Optional extraction model
Optional extraction schema
Trigger configuration that automatically runs an agent when new files are added.
Set enabled: true with an agentId and prompt to activate.
Show child attributes
Show child attributes
⌘I