Files
Delete files
Delete up to 25 files of a knowledge base in one call: all of them, or none.
POST
/
knowledge-base
/
{id}
/
files
/
delete
Delete files
curl --request POST \
--url https://api.verbeo.ai/v1/knowledge-base/{id}/files/delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_ids": [
"<string>"
]
}
'import requests
url = "https://api.verbeo.ai/v1/knowledge-base/{id}/files/delete"
payload = { "file_ids": ["<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({file_ids: ['<string>']})
};
fetch('https://api.verbeo.ai/v1/knowledge-base/{id}/files/delete', 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/{id}/files/delete",
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([
'file_ids' => [
'<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/{id}/files/delete"
payload := strings.NewReader("{\n \"file_ids\": [\n \"<string>\"\n ]\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/{id}/files/delete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v1/knowledge-base/{id}/files/delete")
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 \"file_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyDeletes several files of one knowledge base, their stored bytes and their passages: all of them, or none. This cannot be undone.
Path parameters
Body
Request
curl -X POST "https://api.verbeo.ai/v1/knowledge-base/5df09066-0842-4c92-8ef0-6cf2ff6d7455/files/delete" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "file_ids": ["c4ff0c9c-4b3b-4a94-a86e-3d3b64088ae0", "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d"] }'
Response
200 OK: the ids deleted.
{
"success": true,
"data": { "deleted": ["c4ff0c9c-4b3b-4a94-a86e-3d3b64088ae0", "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d"] }
}
Errors
| Code | Status | When |
|---|---|---|
VALIDATION_FAILED | 422 | file_ids: must name at least one file, file_ids: must name at most 25 files, file_ids: must name each file once. |
NOT_FOUND | 404 | No such knowledge base, or an id that is not one of its files: nothing is deleted. |
INTERNAL_ERROR | 500 | The file could not be deleted. Try again in a moment. Nothing was deleted. |
Was this page helpful?
⌘I
Delete files
curl --request POST \
--url https://api.verbeo.ai/v1/knowledge-base/{id}/files/delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_ids": [
"<string>"
]
}
'import requests
url = "https://api.verbeo.ai/v1/knowledge-base/{id}/files/delete"
payload = { "file_ids": ["<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({file_ids: ['<string>']})
};
fetch('https://api.verbeo.ai/v1/knowledge-base/{id}/files/delete', 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/{id}/files/delete",
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([
'file_ids' => [
'<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/{id}/files/delete"
payload := strings.NewReader("{\n \"file_ids\": [\n \"<string>\"\n ]\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/{id}/files/delete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v1/knowledge-base/{id}/files/delete")
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 \"file_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body