Bulk calling
curl --request POST \
--url 'https://api.example.com/api/v1/call/{widget_id}/contacts?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"contact_ids": [
"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04",
"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d"
],
"message": "Hi Adam, check out our new offer!",
"start_new_conversation": true
}
'import requests
url = "https://api.example.com/api/v1/call/{widget_id}/contacts?api_key="
payload = {
"contact_ids": ["a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04", "8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d"],
"message": "Hi Adam, check out our new offer!",
"start_new_conversation": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
contact_ids: ['a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04', '8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d'],
message: 'Hi Adam, check out our new offer!',
start_new_conversation: true
})
};
fetch('https://api.example.com/api/v1/call/{widget_id}/contacts?api_key=', 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.example.com/api/v1/call/{widget_id}/contacts?api_key=",
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([
'contact_ids' => [
'a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04',
'8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d'
],
'message' => 'Hi Adam, check out our new offer!',
'start_new_conversation' => true
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/call/{widget_id}/contacts?api_key="
payload := strings.NewReader("{\n \"contact_ids\": [\n \"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04\",\n \"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d\"\n ],\n \"message\": \"Hi Adam, check out our new offer!\",\n \"start_new_conversation\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/call/{widget_id}/contacts?api_key=")
.header("Content-Type", "application/json")
.body("{\n \"contact_ids\": [\n \"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04\",\n \"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d\"\n ],\n \"message\": \"Hi Adam, check out our new offer!\",\n \"start_new_conversation\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/call/{widget_id}/contacts?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_ids\": [\n \"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04\",\n \"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d\"\n ],\n \"message\": \"Hi Adam, check out our new offer!\",\n \"start_new_conversation\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "Campaign has been queued"
}{
"detail": "Invalid authentication credentials"
}{
"detail": "Invalid Widget ID"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Too Many Requests"
}Calling
Bulk calling
To initiate calls to a list of contacts in bulk
POST
/
api
/
v1
/
call
/
{widget_id}
/
contacts
Bulk calling
curl --request POST \
--url 'https://api.example.com/api/v1/call/{widget_id}/contacts?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"contact_ids": [
"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04",
"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d"
],
"message": "Hi Adam, check out our new offer!",
"start_new_conversation": true
}
'import requests
url = "https://api.example.com/api/v1/call/{widget_id}/contacts?api_key="
payload = {
"contact_ids": ["a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04", "8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d"],
"message": "Hi Adam, check out our new offer!",
"start_new_conversation": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
contact_ids: ['a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04', '8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d'],
message: 'Hi Adam, check out our new offer!',
start_new_conversation: true
})
};
fetch('https://api.example.com/api/v1/call/{widget_id}/contacts?api_key=', 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.example.com/api/v1/call/{widget_id}/contacts?api_key=",
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([
'contact_ids' => [
'a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04',
'8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d'
],
'message' => 'Hi Adam, check out our new offer!',
'start_new_conversation' => true
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/v1/call/{widget_id}/contacts?api_key="
payload := strings.NewReader("{\n \"contact_ids\": [\n \"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04\",\n \"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d\"\n ],\n \"message\": \"Hi Adam, check out our new offer!\",\n \"start_new_conversation\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/call/{widget_id}/contacts?api_key=")
.header("Content-Type", "application/json")
.body("{\n \"contact_ids\": [\n \"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04\",\n \"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d\"\n ],\n \"message\": \"Hi Adam, check out our new offer!\",\n \"start_new_conversation\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/call/{widget_id}/contacts?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_ids\": [\n \"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04\",\n \"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d\"\n ],\n \"message\": \"Hi Adam, check out our new offer!\",\n \"start_new_conversation\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "Campaign has been queued"
}{
"detail": "Invalid authentication credentials"
}{
"detail": "Invalid Widget ID"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Too Many Requests"
}Authorizations
Your API KeyHTTPBearer
Your API key for authentication. You can generate it from the Settings page. Format: starts with in-.
Path Parameters
Widget ID to be used for initiating the call. It must be connected to Twilio, Plivo or Telnyx.
Body
application/json
Payload containing the list of contact IDs and other details.
List of UUIDs that identify the contacts to receive the campaign.
Minimum array length:
1Example:
[
"a3ae8c0f-2e9d-4c18-8c0e-d510e3cacb04",
"8a849d72-93cf-4e6c-b1a3-6c10d4c65f1d"
]
(Only for Chat based assistants, ignored for calling) Message to be sent
Example:
"Hi Adam, check out our new offer!"
(Always True for calling campaigns) Start a brand‑new thread instead of replying in the existing one.
Example:
true
Was this page helpful?

