Cancel a run
curl --request POST \
--url https://api.instaview.sk/runs/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/runs/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.instaview.sk/runs/{id}/cancel', 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}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/cancel"
req, _ := http.NewRequest("POST", 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.post("https://api.instaview.sk/runs/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/runs/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "RUNNING",
"affectedCalls": 42
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Runs
Cancel Run
Stops the run for good and closes out its un-dialled conversations. Terminal - there is no resume. A call already connected is left to finish; its retry is refused rather than rescheduled.
POST
/
runs
/
{id}
/
cancel
Cancel a run
curl --request POST \
--url https://api.instaview.sk/runs/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.instaview.sk/runs/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.instaview.sk/runs/{id}/cancel', 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}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/cancel"
req, _ := http.NewRequest("POST", 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.post("https://api.instaview.sk/runs/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instaview.sk/runs/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "RUNNING",
"affectedCalls": 42
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Stops a run for good.
Terminal, unlike pause
Cancel closes out the run’s un-dialled conversations and there is no way back — no resume, and attaching a contact to a cancelled run is a422. If you want to stop temporarily, pause instead.
A call that is already connected is left to finish. Its retry is refused rather than rescheduled, so the run stops growing without cutting somebody off mid-sentence.
{ "status": "CANCELLED", "affectedCalls": 30 }
affectedCalls is how many un-dialled calls were closed out.
What survives
The conversations the run already produced. They are separate resources: their transcripts, recordings and analysis stay readable at/conversations/{id}, with runId still populated. Cancelling stops future calls; it does not erase the ones that happened.
Cancel before you delete
A run must be inert before it can be deleted, and cancel is what makes an active run inert. See Delete Run.Error Scenarios
- 404 Not Found: the run does not exist, or belongs to another company
- 422 Unprocessable Entity: the run is already cancelled or completed
- 403 Forbidden: the API key does not hold
write:runs
Related Resources
Pause Run
Stop reversibly instead
Delete Run
Remove it once it is inert
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.
Response
Transition applied
The run's status after the transition
Available options:
DRAFT, SCHEDULED, RUNNING, PAUSED, COMPLETED, CANCELLED Example:
"RUNNING"
How many of the run's calls this request moved: queued by a launch, withdrawn by a pause, restored by a resume, closed out by a cancel. Not calls placed - a 2xx means queued, not dialled.
Example:
42