Delete a contact document
curl --request DELETE \
--url https://api.instaview.sk/contacts/{id}/documents/{documentId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/contacts/{id}/documents/{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/contacts/{id}/documents/{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/contacts/{id}/documents/{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/contacts/{id}/documents/{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/contacts/{id}/documents/{documentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/contacts/{id}/documents/{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
}Contact Documents
Delete Contact Document
Permanently deletes an uploaded document, the stored file and the copy held by the voice provider. This cannot be undone.
The CV document cannot be deleted here: it is produced from the contact’s processed CV, and would be listed again on the next read. Deactivate it instead, or delete the contact’s CV. A contact’s documents are also deleted, storage and provider copies included, when the contact reaches its GDPR retention date.
DELETE
/
contacts
/
{id}
/
documents
/
{documentId}
Delete a contact document
curl --request DELETE \
--url https://api.instaview.sk/contacts/{id}/documents/{documentId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/contacts/{id}/documents/{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/contacts/{id}/documents/{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/contacts/{id}/documents/{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/contacts/{id}/documents/{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/contacts/{id}/documents/{documentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/contacts/{id}/documents/{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 an uploaded contact document, its stored file and the copy held by the voice provider.
Overview
Works onUPLOAD documents, completed or not — deleting a PENDING upload releases its slot and its bytes immediately instead of waiting for the 24-hour cleanup.
The CV document is refused with a 409. It is produced from the contact’s processed CV, so deleting the document would only have it listed again on the next read. To keep the CV out of calls, deactivate it; to remove it entirely, delete the contact’s CV.
Contact documents follow the contact’s retention. When a contact reaches its GDPR expiry date, every
document on it — the
CV projection and the uploads, their stored files and their provider copies —
is deleted with the rest of the contact’s data. There is no second retention clock to manage.Example
curl -X DELETE https://api.instaview.sk/contacts/$CONTACT_ID/documents/$DOCUMENT_ID \
-H "Authorization: Bearer $INSTAVIEW_API_KEY"
{
"id": "5d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a",
"deleted": true
}
Error Scenarios
- 404 Not Found: No such document on that contact
- 409 Conflict: The document is the contact’s
CV
Related Resources
Authorizations
API key for authentication using Bearer scheme
Path Parameters
Contact the document belongs to.
Document id.
Query Parameters
Required for ATS API keys to specify which company to access. Ignored for standard company API keys.