JavaScript
import Profound from '@profoundai/client';
const client = new Profound({
apiKey: process.env['PROFOUND_API_KEY'], // This is the default and can be omitted
});
const folder = await client.knowledgeBases.folders.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
path: 'x',
});
console.log(folder.message);import os
from profound import Profound
client = Profound(
api_key=os.environ.get("PROFOUND_API_KEY"), # This is the default and can be omitted
)
folder = client.knowledge_bases.folders.delete(
knowledge_base_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
path="x",
)
print(folder.message)curl --request DELETE \
--url https://api.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"path": "<string>",
"recursive": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'path' => '<string>',
'recursive' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders"
payload := strings.NewReader("{\n \"path\": \"<string>\",\n \"recursive\": false\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.delete("https://api.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"<string>\",\n \"recursive\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"path\": \"<string>\",\n \"recursive\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"path": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Knowledge Bases
Delete Folder
Delete a folder. With recursive=false, non-empty folders return 409 and no contents are deleted.
DELETE
/
v1
/
knowledge-bases
/
{knowledge_base_id}
/
folders
JavaScript
import Profound from '@profoundai/client';
const client = new Profound({
apiKey: process.env['PROFOUND_API_KEY'], // This is the default and can be omitted
});
const folder = await client.knowledgeBases.folders.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
path: 'x',
});
console.log(folder.message);import os
from profound import Profound
client = Profound(
api_key=os.environ.get("PROFOUND_API_KEY"), # This is the default and can be omitted
)
folder = client.knowledge_bases.folders.delete(
knowledge_base_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
path="x",
)
print(folder.message)curl --request DELETE \
--url https://api.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"path": "<string>",
"recursive": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'path' => '<string>',
'recursive' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders"
payload := strings.NewReader("{\n \"path\": \"<string>\",\n \"recursive\": false\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.delete("https://api.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"<string>\",\n \"recursive\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryprofound.com/v1/knowledge-bases/{knowledge_base_id}/folders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"path\": \"<string>\",\n \"recursive\": false\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"path": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
APIKeyHeaderBearerAuth
Path Parameters
Unique knowledge base ID.
Query Parameters
Organization scope for API keys that can access multiple organizations.
Body
application/json
Was this page helpful?
⌘I