Delete sources from a knowledge base
curl --request DELETE \
--url https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"source_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources"
payload = { "source_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({source_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources', 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.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources",
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([
'source_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources"
payload := strings.NewReader("{\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\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.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources")
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 \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"organization_id": "123e4567-e89b-12d3-a456-426614174001",
"sources": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"file_url": "<string>",
"type": "file"
}
]
},
"message": "Sources deleted from knowledge base successfully",
"error": {
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
},
"status": 200
}knowledge bases
Delete sources from a knowledge base
Delete sources from a knowledge base.
DELETE
/
v1
/
knowledge-bases
/
{knowledge_base_id}
/
sources
Delete sources from a knowledge base
curl --request DELETE \
--url https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"source_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources"
payload = { "source_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({source_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources', 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.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources",
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([
'source_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources"
payload := strings.NewReader("{\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\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.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.callrounded.com/v1/knowledge-bases/{knowledge_base_id}/sources")
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 \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"organization_id": "123e4567-e89b-12d3-a456-426614174001",
"sources": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"file_name": "<string>",
"file_url": "<string>",
"type": "file"
}
]
},
"message": "Sources deleted from knowledge base successfully",
"error": {
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
},
"status": 200
}Authorizations
The API Key created in Rounded Studio.
- You can create it by going to the "API Keys" settings of your profile.
- Need help? You can email us at team@callrounded.com or join our Discord community.
Path Parameters
Body
application/json
List of source IDs to delete from the knowledge base.
Example:
[
"123e4567-e89b-12d3-a456-426614174000",
"123e4567-e89b-12d3-a456-426614174001"
]
Response
Successfully deleted sources from knowledge base
The updated knowledge base data after sources were deleted.
Show child attributes
Show child attributes
Response message indicating the result of the operation.
Show child attributes
Show child attributes
Example:
{
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
}
HTTP status code of the response.
⌘I