Delete document
curl --request DELETE \
--url https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID} \
--header 'authorization: <api-key>'import requests
url = "https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID}"
headers = {"authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {authorization: '<api-key>'}};
fetch('https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{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://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{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: <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"
"net/http"
"io"
)
func main() {
url := "https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID}")
.header("authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodyDelete document
Remove a document from the knowledge base.
DELETE
/
v1alpha1
/
public
/
knowledge-base
/
document
/
{documentID}
Delete document
curl --request DELETE \
--url https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID} \
--header 'authorization: <api-key>'import requests
url = "https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID}"
headers = {"authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {authorization: '<api-key>'}};
fetch('https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{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://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{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: <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"
"net/http"
"io"
)
func main() {
url := "https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID}")
.header("authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://realtime-api.voiceflow.com/v1alpha1/public/knowledge-base/document/{documentID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodyAuthorizations
Voiceflow API key
Path Parameters
ID of the document to target.
Query Parameters
The alias of the environment to target (ie. main). You can find this in the environments page of your agent.
💡 Tip: Learn more about Environments.
Response
200
The target document was deleted successfully.
Was this page helpful?
⌘I