Detach a contact from a draft run
curl --request DELETE \
--url https://api.instaview.sk/runs/{id}/contacts/{contactId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/runs/{id}/contacts/{contactId}"
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/runs/{id}/contacts/{contactId}', 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/runs/{id}/contacts/{contactId}",
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/runs/{id}/contacts/{contactId}"
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/runs/{id}/contacts/{contactId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/runs/{id}/contacts/{contactId}")
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{
"totalContacts": 9
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Runs
Detach Contact
Removes a contact from a run that has not launched. Draft only: after launch the contact’s conversation exists and may already have been called, so removing the link would be a half-truth. Cancel the run instead.
DELETE
/
runs
/
{id}
/
contacts
/
{contactId}
Detach a contact from a draft run
curl --request DELETE \
--url https://api.instaview.sk/runs/{id}/contacts/{contactId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/runs/{id}/contacts/{contactId}"
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/runs/{id}/contacts/{contactId}', 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/runs/{id}/contacts/{contactId}",
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/runs/{id}/contacts/{contactId}"
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/runs/{id}/contacts/{contactId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/runs/{id}/contacts/{contactId}")
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{
"totalContacts": 9
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Removes a contact from a run that has not launched.
Detaching a contact that is not on the run is a
Draft only
Detach works while the run is aDRAFT and returns 422 after that.
The reason is that launching mints a conversation per contact, and that conversation may already have been called. Removing the link afterwards would be a half-truth: the contact would vanish from the run while the record of their call, its recording and its analysis stayed behind, still carrying the run’s id. Cancel the run instead — that stops the dialling and leaves an honest record of what happened.
Basic Usage
DELETE /runs/789e0123-.../contacts/contact-uuid
{ "totalContacts": 9 }
404.
Error Scenarios
- 404 Not Found: the run does not exist, belongs to another company, or the contact is not attached to it
- 422 Unprocessable Entity: the run has already launched
- 403 Forbidden: the API key does not hold
write:runs
Related Resources
Attach Contacts
Add contacts to the run
Cancel Run
Stop a run that has already launched
Authorizations
API key for authentication using Bearer scheme
Query Parameters
Required for ATS API keys to specify which company to access. Ignored for standard company API keys.
Response
Contact detached
Contacts remaining on the run
Example:
9