Delete a knowledge document
curl --request DELETE \
--url https://api.instaview.sk/agents/{id}/knowledge/{documentId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/agents/{id}/knowledge/{documentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.instaview.sk/agents/{id}/knowledge/{documentId}', 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.instaview.sk/agents/{id}/knowledge/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.instaview.sk/agents/{id}/knowledge/{documentId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.instaview.sk/agents/{id}/knowledge/{documentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/agents/{id}/knowledge/{documentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deleted": true
}Agent Knowledge Base
Delete Knowledge Document
Permanently deletes the document, the stored file and the copy held by the voice provider. This cannot be undone.
DELETE
/
agents
/
{id}
/
knowledge
/
{documentId}
Delete a knowledge document
curl --request DELETE \
--url https://api.instaview.sk/agents/{id}/knowledge/{documentId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/agents/{id}/knowledge/{documentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.instaview.sk/agents/{id}/knowledge/{documentId}', 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.instaview.sk/agents/{id}/knowledge/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.instaview.sk/agents/{id}/knowledge/{documentId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.instaview.sk/agents/{id}/knowledge/{documentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/agents/{id}/knowledge/{documentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deleted": true
}Permanently deletes a document from an agent’s knowledge base. This action cannot be undone.
Overview
Deletion removes the document record, the stored file and the copy held by the voice provider. There is no soft-delete and no version history to recover from, which is what makes this a genuine erasure rather than a hidden retention. The freed slot is available immediately.Example
curl -X DELETE https://api.instaview.sk/agents/$AGENT_ID/knowledge/$DOCUMENT_ID \
-H "Authorization: Bearer $INSTAVIEW_API_KEY"
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"deleted": true
}
This is the response shape after the August 3, 2026 envelope
change. Until that cutover, integrations still receiving the legacy
envelope get
{ "statusCode": 200, "message": "Success", "data": true, "traceId": "…" }
instead. Watch for the Deprecation and Sunset headers to tell which shape you are on.Pending Documents
Works onPENDING documents too. Deleting one is how you release a reserved slot straight away instead of waiting for the 24-hour cleanup.
To stop using a document without losing it, deactivate
it instead.
Error Scenarios
- 404 Not Found: No such document on that agent
Related Resources
Authorizations
API key for authentication using Bearer scheme
Path Parameters
Agent the knowledge base belongs to.
Knowledge document id.
Query Parameters
Required for ATS API keys to specify which company to access. Ignored for standard company API keys.