Delete Resource
curl --request DELETE \
--url https://api.wistx.ai/v1/indexing/resources/{resource_id}import requests
url = "https://api.wistx.ai/v1/indexing/resources/{resource_id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.wistx.ai/v1/indexing/resources/{resource_id}', 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.wistx.ai/v1/indexing/resources/{resource_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/indexing/resources/{resource_id}"
req, _ := http.NewRequest("DELETE", url, nil)
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.wistx.ai/v1/indexing/resources/{resource_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/indexing/resources/{resource_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to delete resource"
}
Indexing
Delete Resource
Delete an indexed resource
DELETE
/
v1
/
indexing
/
resources
/
{resource_id}
Delete Resource
curl --request DELETE \
--url https://api.wistx.ai/v1/indexing/resources/{resource_id}import requests
url = "https://api.wistx.ai/v1/indexing/resources/{resource_id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.wistx.ai/v1/indexing/resources/{resource_id}', 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.wistx.ai/v1/indexing/resources/{resource_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/indexing/resources/{resource_id}"
req, _ := http.NewRequest("DELETE", url, nil)
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.wistx.ai/v1/indexing/resources/{resource_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/indexing/resources/{resource_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to delete resource"
}
Delete an indexed resource and all associated knowledge articles
curl --request DELETE \
--url https://api.wistx.ai/v1/indexing/resources/res_abc123 \
--header 'Authorization: Bearer YOUR_API_KEY'
import requests
api_key = "YOUR_API_KEY"
resource_id = "res_abc123"
response = requests.delete(
f"https://api.wistx.ai/v1/indexing/resources/{resource_id}",
headers={"Authorization": f"Bearer {api_key}"}
)
if response.status_code == 204:
print("Resource deleted successfully")
const apiKey = "YOUR_API_KEY";
const resourceId = "res_abc123";
const response = await fetch(
`https://api.wistx.ai/v1/indexing/resources/${resourceId}`,
{
method: "DELETE",
headers: {
Authorization: `Bearer ${apiKey}`
}
}
);
if (response.status === 204) {
console.log("Resource deleted successfully");
}
package main
import (
"fmt"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
resourceID := "res_abc123"
url := fmt.Sprintf("https://api.wistx.ai/v1/indexing/resources/%s", resourceID)
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
if resp.StatusCode == 204 {
fmt.Println("Resource deleted successfully")
}
}
require 'net/http'
require 'uri'
api_key = "YOUR_API_KEY"
resource_id = "res_abc123"
url = URI("https://api.wistx.ai/v1/indexing/resources/#{resource_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Bearer #{api_key}"
response = http.request(request)
puts "Resource deleted successfully" if response.code == "204"
<?php
$apiKey = "YOUR_API_KEY";
$resourceId = "res_abc123";
$url = "https://api.wistx.ai/v1/indexing/resources/" . $resourceId;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $apiKey
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 204) {
echo "Resource deleted successfully";
}
import java.net.HttpURLConnection;
import java.net.URL;
public class DeleteResource {
public static void main(String[] args) throws Exception {
String apiKey = "YOUR_API_KEY";
String resourceId = "res_abc123";
URL url = new URL("https://api.wistx.ai/v1/indexing/resources/" + resourceId);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("DELETE");
conn.setRequestProperty("Authorization", "Bearer " + apiKey);
int responseCode = conn.getResponseCode();
if (responseCode == 204) {
System.out.println("Resource deleted successfully");
}
}
}
Path Parameters
string
required
Resource ID to delete.
Response
{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to delete resource"
}