Delete run
curl --request DELETE \
--url https://api.instaview.sk/runs/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/runs/{id}"
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}', 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}",
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}"
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}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/runs/{id}")
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
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Runs
Delete Run
Soft-deletes a run that is no longer active. Allowed from DRAFT, COMPLETED and CANCELLED; SCHEDULED, RUNNING and PAUSED return 422 - cancel it first, because a delete must not silently terminate live phone calls. The conversations the run produced survive as separate resources, still readable with their runId intact. Deleting an already-deleted run is a 404, not an error state.
DELETE
/
runs
/
{id}
Delete run
curl --request DELETE \
--url https://api.instaview.sk/runs/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/runs/{id}"
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}', 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}",
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}"
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}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/runs/{id}")
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
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Soft-deletes a run that is no longer active.
An active run has queued calls that a delete would orphan. The alternative — letting
Deleting a run removes the grouping, not the history.
Only when the run is inert
| Status | Delete |
|---|---|
DRAFT, COMPLETED, CANCELLED | Allowed |
SCHEDULED, RUNNING, PAUSED | 422 — "Cancel the flow run before deleting it" |
DELETE cascade a cancel — was deliberately rejected: it makes an HTTP verb silently terminate live phone calls, which is not something a delete should do by implication. Cancel first; that is the operation whose job is stopping the dialling.
What happens to everything else
| Conversations the run produced | Survive. They are separate resources, still readable at /conversations/{id} with runId populated. |
| Webhooks | Unaffected. conversation.* events belong to the conversation, not the run. |
| Reads of the run | GET /runs/{id} returns 404. |
| Deleting it again | 404, not an error state to handle. |
Error Scenarios
- 404 Not Found: the run does not exist, belongs to another company, or is already deleted
- 422 Unprocessable Entity: the run is still active
- 403 Forbidden: the API key does not hold
delete:runs
Related Resources
Cancel Run
Make an active run inert first
List Run Conversations
Read the results before you delete
Authorizations
API key for authentication using Bearer scheme
Path Parameters
Query Parameters
Required for ATS API keys to specify which company to access. Ignored for standard company API keys.