Delete data sources
curl --request DELETE \
--url https://app.livechatai.com/api/v2/data-sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "clx1234567890abcdef",
"source": "WEBSITE",
"id": "ds_1234567890",
"ids": [
"ds_1234567890",
"ds_0987654321"
]
}
'import requests
url = "https://app.livechatai.com/api/v2/data-sources"
payload = {
"agentId": "clx1234567890abcdef",
"source": "WEBSITE",
"id": "ds_1234567890",
"ids": ["ds_1234567890", "ds_0987654321"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: 'clx1234567890abcdef',
source: 'WEBSITE',
id: 'ds_1234567890',
ids: ['ds_1234567890', 'ds_0987654321']
})
};
fetch('https://app.livechatai.com/api/v2/data-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://app.livechatai.com/api/v2/data-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([
'agentId' => 'clx1234567890abcdef',
'source' => 'WEBSITE',
'id' => 'ds_1234567890',
'ids' => [
'ds_1234567890',
'ds_0987654321'
]
]),
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://app.livechatai.com/api/v2/data-sources"
payload := strings.NewReader("{\n \"agentId\": \"clx1234567890abcdef\",\n \"source\": \"WEBSITE\",\n \"id\": \"ds_1234567890\",\n \"ids\": [\n \"ds_1234567890\",\n \"ds_0987654321\"\n ]\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://app.livechatai.com/api/v2/data-sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"clx1234567890abcdef\",\n \"source\": \"WEBSITE\",\n \"id\": \"ds_1234567890\",\n \"ids\": [\n \"ds_1234567890\",\n \"ds_0987654321\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.livechatai.com/api/v2/data-sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"clx1234567890abcdef\",\n \"source\": \"WEBSITE\",\n \"id\": \"ds_1234567890\",\n \"ids\": [\n \"ds_1234567890\",\n \"ds_0987654321\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"message": "2 items deleted successfully",
"agentId": "clx1234567890abcdef",
"source": "TEXT",
"deleted": [
"ds_1234567890",
"ds_0987654321"
],
"notFound": []
}
}Data Sources
Delete data sources
Delete one or more data sources from an agent. This endpoint supports both single and bulk deletion operations.
DELETE
/
api
/
v2
/
data-sources
Delete data sources
curl --request DELETE \
--url https://app.livechatai.com/api/v2/data-sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "clx1234567890abcdef",
"source": "WEBSITE",
"id": "ds_1234567890",
"ids": [
"ds_1234567890",
"ds_0987654321"
]
}
'import requests
url = "https://app.livechatai.com/api/v2/data-sources"
payload = {
"agentId": "clx1234567890abcdef",
"source": "WEBSITE",
"id": "ds_1234567890",
"ids": ["ds_1234567890", "ds_0987654321"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: 'clx1234567890abcdef',
source: 'WEBSITE',
id: 'ds_1234567890',
ids: ['ds_1234567890', 'ds_0987654321']
})
};
fetch('https://app.livechatai.com/api/v2/data-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://app.livechatai.com/api/v2/data-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([
'agentId' => 'clx1234567890abcdef',
'source' => 'WEBSITE',
'id' => 'ds_1234567890',
'ids' => [
'ds_1234567890',
'ds_0987654321'
]
]),
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://app.livechatai.com/api/v2/data-sources"
payload := strings.NewReader("{\n \"agentId\": \"clx1234567890abcdef\",\n \"source\": \"WEBSITE\",\n \"id\": \"ds_1234567890\",\n \"ids\": [\n \"ds_1234567890\",\n \"ds_0987654321\"\n ]\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://app.livechatai.com/api/v2/data-sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"clx1234567890abcdef\",\n \"source\": \"WEBSITE\",\n \"id\": \"ds_1234567890\",\n \"ids\": [\n \"ds_1234567890\",\n \"ds_0987654321\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.livechatai.com/api/v2/data-sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"clx1234567890abcdef\",\n \"source\": \"WEBSITE\",\n \"id\": \"ds_1234567890\",\n \"ids\": [\n \"ds_1234567890\",\n \"ds_0987654321\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"message": "2 items deleted successfully",
"agentId": "clx1234567890abcdef",
"source": "TEXT",
"deleted": [
"ds_1234567890",
"ds_0987654321"
],
"notFound": []
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Data source deletion details
Unique identifier of the agent
Example:
"clx1234567890abcdef"
Type of data source to delete
Available options:
WEBSITE, TEXT, QA, PDF, DOCX, IMAGE Example:
"WEBSITE"
Unique identifier of the data source item to delete (for single deletion)
Example:
"ds_1234567890"
Array of unique identifiers for bulk deletion
Example:
["ds_1234567890", "ds_0987654321"]
⌘I

