Batch calls
Cancel a batch call
Cancels a running, scheduled or paused batch and skips the recipients still waiting. Any other state is refused with 409. Needs a Full access key.
POST
/
api
/
v2
/
batch-calls
/
{batchId}
/
cancel
Cancel a batch call
curl --request POST \
--url https://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{}'import requests
url = "https://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel"
payload = {}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://app.cntillion.com/api/v2/batch-calls/{batchId}/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://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel",
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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"agentId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"config": {
"branchId": "<string>",
"ringingTimeoutSeconds": 62,
"concurrencyLimit": 500,
"allowedOverrides": [
"prompt"
],
"phoneLineId": "<string>",
"version": 1,
"import": {
"kind": "empty"
},
"answeringMachineDetection": true,
"channel": "telephony",
"phoneLineIds": [
"<string>"
]
},
"recipientCount": 123,
"input": {
"name": "<string>",
"settings": {
"branchId": "<string>",
"ringingTimeoutSeconds": 62,
"concurrencyLimit": 500,
"allowedOverrides": [
"prompt"
],
"phoneLineId": "<string>",
"answeringMachineDetection": true,
"channel": "telephony",
"phoneLineIds": [
"<string>"
]
},
"timezone": "<string>",
"startsAt": "2023-11-07T05:31:56Z",
"consentConfirmed": true,
"sendRatePerMinute": 10
},
"status": "DRAFT",
"createdAt": "2023-11-07T05:31:56Z",
"launchedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"lastError": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
workspaceApiKeyworkspaceApiKeyHeader
Headers
Body
application/json
The body is of type object.
⌘I
Cancel a batch call
curl --request POST \
--url https://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '{}'import requests
url = "https://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel"
payload = {}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://app.cntillion.com/api/v2/batch-calls/{batchId}/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://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel",
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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cntillion.com/api/v2/batch-calls/{batchId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"agentId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"config": {
"branchId": "<string>",
"ringingTimeoutSeconds": 62,
"concurrencyLimit": 500,
"allowedOverrides": [
"prompt"
],
"phoneLineId": "<string>",
"version": 1,
"import": {
"kind": "empty"
},
"answeringMachineDetection": true,
"channel": "telephony",
"phoneLineIds": [
"<string>"
]
},
"recipientCount": 123,
"input": {
"name": "<string>",
"settings": {
"branchId": "<string>",
"ringingTimeoutSeconds": 62,
"concurrencyLimit": 500,
"allowedOverrides": [
"prompt"
],
"phoneLineId": "<string>",
"answeringMachineDetection": true,
"channel": "telephony",
"phoneLineIds": [
"<string>"
]
},
"timezone": "<string>",
"startsAt": "2023-11-07T05:31:56Z",
"consentConfirmed": true,
"sendRatePerMinute": 10
},
"status": "DRAFT",
"createdAt": "2023-11-07T05:31:56Z",
"launchedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"lastError": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}