curl --request POST \
--url https://api.instaview.sk/contacts/erasures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifierType": "externalId",
"value": "CAND-12345",
"mode": "delete",
"allowMultiple": false
}
'import requests
url = "https://api.instaview.sk/contacts/erasures"
payload = {
"identifierType": "externalId",
"value": "CAND-12345",
"mode": "delete",
"allowMultiple": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
identifierType: 'externalId',
value: 'CAND-12345',
mode: 'delete',
allowMultiple: false
})
};
fetch('https://api.instaview.sk/contacts/erasures', 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/erasures",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'identifierType' => 'externalId',
'value' => 'CAND-12345',
'mode' => 'delete',
'allowMultiple' => false
]),
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://api.instaview.sk/contacts/erasures"
payload := strings.NewReader("{\n \"identifierType\": \"externalId\",\n \"value\": \"CAND-12345\",\n \"mode\": \"delete\",\n \"allowMultiple\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.instaview.sk/contacts/erasures")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifierType\": \"externalId\",\n \"value\": \"CAND-12345\",\n \"mode\": \"delete\",\n \"allowMultiple\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/contacts/erasures")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifierType\": \"externalId\",\n \"value\": \"CAND-12345\",\n \"mode\": \"delete\",\n \"allowMultiple\": false\n}"
response = http.request(request)
puts response.read_body{
"mode": "delete",
"identifierType": "externalId",
"contactIds": [
"550e8400-e29b-41d4-a716-446655440000"
]
}Erase Contacts by Identifier
Deletes or anonymizes the contacts in the API key’s company that an external id, phone number or e-mail address names. Each contact is deleted as DELETE /contacts/{id} deletes it, including its call recordings and the calls held by the voice provider. When more than one contact matches, the request is refused with 409 unless allowMultiple is true. Nothing matching is a 200 with an empty contactIds, so a retried request is safe.
curl --request POST \
--url https://api.instaview.sk/contacts/erasures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifierType": "externalId",
"value": "CAND-12345",
"mode": "delete",
"allowMultiple": false
}
'import requests
url = "https://api.instaview.sk/contacts/erasures"
payload = {
"identifierType": "externalId",
"value": "CAND-12345",
"mode": "delete",
"allowMultiple": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
identifierType: 'externalId',
value: 'CAND-12345',
mode: 'delete',
allowMultiple: false
})
};
fetch('https://api.instaview.sk/contacts/erasures', 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/erasures",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'identifierType' => 'externalId',
'value' => 'CAND-12345',
'mode' => 'delete',
'allowMultiple' => false
]),
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://api.instaview.sk/contacts/erasures"
payload := strings.NewReader("{\n \"identifierType\": \"externalId\",\n \"value\": \"CAND-12345\",\n \"mode\": \"delete\",\n \"allowMultiple\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.instaview.sk/contacts/erasures")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifierType\": \"externalId\",\n \"value\": \"CAND-12345\",\n \"mode\": \"delete\",\n \"allowMultiple\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/contacts/erasures")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"identifierType\": \"externalId\",\n \"value\": \"CAND-12345\",\n \"mode\": \"delete\",\n \"allowMultiple\": false\n}"
response = http.request(request)
puts response.read_body{
"mode": "delete",
"identifierType": "externalId",
"contactIds": [
"550e8400-e29b-41d4-a716-446655440000"
]
}Request
{
"identifierType": "externalId",
"value": "CAND-12345",
"mode": "delete"
}
| Field | Required | Meaning |
|---|---|---|
identifierType | yes | externalId, phoneNumber or email |
value | yes | The identifier itself, at most 512 characters |
mode | no | delete (the default) or anonymize |
allowMultiple | no | true to erase every contact the identifier matches. Off by default, see below |
delete:contacts scope, the same as Delete Contact.
How an identifier matches
externalIdmatches theexternalIdyou stored in the contact’smetadata, and the id a connected ATS or CRM synced the contact under.phoneNumbermatches ignoring spaces, dashes and brackets, so+421 915-123 456finds a contact stored as+421915123456. The country prefix is not guessed:0915123456does not.emailmatches case-insensitively.
When more than one contact matches
Two records that share an e-mail address or an external id are not necessarily one person: a shared family mailbox, an id reused across two systems. So by default the request is refused with409 Conflict and nothing is erased. The error message lists the matching contact ids.
Check them, then either send the same request with "allowMultiple": true to erase all of them,
or delete the right one with Delete Contact.
One request erases at most 50 contacts. An identifier that matches more is refused with
422 Unprocessable Entity, even with allowMultiple.
Delete or anonymize
- delete
- anonymize
GET /contacts/{id} answers 404.Anonymized, and the surname, e-mail, phone number, metadata and fields are empty.
Use it when your own system keeps the id and needs it to keep resolving, or when reports
should go on counting the contact.The conversations are not kept. A transcript, a recording or an analysis of a call is
personal data, so anonymizing a contact cannot leave them behind.Recordings and calls at the voice provider
Call recordings and the call records held by our voice provider are queued for deletion in the same transaction that deletes the contact, and deleted right after it. A deletion the provider does not confirm is retried automatically for several days. Nothing you need to do, and nothing lost if a provider is briefly down.Response
{
"mode": "delete",
"identifierType": "externalId",
"contactIds": ["550e8400-e29b-41d4-a716-446655440000"]
}
200 with an empty contactIds. That
makes a retried request safe, since the second attempt finds nothing left to erase.
Error Scenarios
- 400 Bad Request: an unknown
identifierTypeormode, or an emptyvalue - 409 Conflict: more than one contact matches and
allowMultipleis nottrue. Nothing was erased - 422 Unprocessable Entity: more than 50 contacts match. Nothing was erased
Related Resources
Delete Contact
Contacts Resource Guide
Query Parameters
Body
Which identifier value is. externalId matches the contact's metadata.externalId and the id an ATS or CRM integration synced the contact under; phoneNumber matches ignoring spaces, dashes and brackets; email matches case-insensitively.
externalId, phoneNumber, email "externalId"
Erase every contact the identifier matches. Off by default: when more than one contact matches, the request is refused with 409 and erases nothing, because two records sharing an e-mail address are not necessarily one person. At most 50 contacts are erased per request.
false