Update a Knowledge base name or description
curl --request PATCH \
--url https://api.langdock.com/knowledge/{folderId}/folder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.langdock.com/knowledge/{folderId}/folder"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.langdock.com/knowledge/{folderId}/folder', 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.langdock.com/knowledge/{folderId}/folder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<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.langdock.com/knowledge/{folderId}/folder"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.langdock.com/knowledge/{folderId}/folder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/knowledge/{folderId}/folder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyKnowledge Folder API
Update Knowledge base
Rename a Knowledge base or update its description
PATCH
/
knowledge
/
{folderId}
/
folder
Update a Knowledge base name or description
curl --request PATCH \
--url https://api.langdock.com/knowledge/{folderId}/folder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.langdock.com/knowledge/{folderId}/folder"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.langdock.com/knowledge/{folderId}/folder', 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.langdock.com/knowledge/{folderId}/folder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<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.langdock.com/knowledge/{folderId}/folder"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.langdock.com/knowledge/{folderId}/folder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/knowledge/{folderId}/folder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpdates the name or description of an existing Knowledge base. This is not the file replace route. To replace a file, use Update a file.
Include at least one field. There is no public endpoint to create or delete a Knowledge base.
Before You Start
- API key scope: Requires an API key with the
KNOWLEDGE_FOLDER_APIscope. The API key itself needs the Editor role on the Knowledge base. See Share Knowledge bases with the API for setup instructions. - Knowledge bases: The Knowledge Folder API manages resources that appear as Knowledge bases in the Library.
Base URL
https://api.langdock.com
Dedicated deploymentsReplace
api.langdock.com with <your-deployment-url>/api/public in all requests.Request Format
This endpoint acceptsapplication/json.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
folderId | string | Yes | The ID of the Knowledge base |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New name. Cannot be empty after trimming. |
description | string | No | New description. |
Examples
Update with cURL
curl -X PATCH "https://api.langdock.com/knowledge/{folderId}/folder" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Product handbook",
"description": "Internal product documentation"
}'
Update with JavaScript
const axios = require("axios");
async function updateKnowledgeBase(folderId, data) {
const response = await axios.patch(
`https://api.langdock.com/knowledge/${folderId}/folder`,
data,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
}
);
return response.data;
}
const result = await updateKnowledgeBase(
"550e8400-e29b-41d4-a716-446655440000",
{ name: "Product handbook" }
);
console.log("Updated:", result.result.name);
Response Format
Success Response (200 OK)
{
status: "success";
result: {
id: string;
name: string;
description: string | null;
createdAt: string;
updatedAt: string;
};
}
Example Response
{
"status": "success",
"result": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Product handbook",
"description": "Internal product documentation",
"createdAt": "2026-08-12T09:15:00.000Z",
"updatedAt": "2026-09-01T10:22:00.000Z"
}
}
Error Handling
| Status | Meaning |
|---|---|
400 | Invalid body, empty name, or no fields provided |
401 | Invalid or missing API key |
403 | Missing KNOWLEDGE_FOLDER_API scope, or the key is not Editor on this Knowledge base |
404 | Knowledge base not found |
429 | Rate limit exceeded |
500 | Unexpected server error |
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.
Was this page helpful?