Launch a draft campaign
curl --request POST \
--url https://api.getcluster.ai/v1/campaigns/{campaign_id}/launch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"send_window_mode": "next_send_window"
}
'import requests
url = "https://api.getcluster.ai/v1/campaigns/{campaign_id}/launch"
payload = { "send_window_mode": "next_send_window" }
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({send_window_mode: 'next_send_window'})
};
fetch('https://api.getcluster.ai/v1/campaigns/{campaign_id}/launch', 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.getcluster.ai/v1/campaigns/{campaign_id}/launch",
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([
'send_window_mode' => 'next_send_window'
]),
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://api.getcluster.ai/v1/campaigns/{campaign_id}/launch"
payload := strings.NewReader("{\n \"send_window_mode\": \"next_send_window\"\n}")
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://api.getcluster.ai/v1/campaigns/{campaign_id}/launch")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"send_window_mode\": \"next_send_window\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcluster.ai/v1/campaigns/{campaign_id}/launch")
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 = "{\n \"send_window_mode\": \"next_send_window\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"campaign_type": "<string>",
"delivery_mode": "<string>",
"stats": {
"active_contact_count": 0,
"completed_contact_count": 0,
"failed_contact_count": 0,
"excluded_contact_count": 0,
"connection_request_sent_count": 0,
"message_sent_count": 0,
"email_sent_count": 0,
"profile_visit_sent_count": 0,
"like_post_sent_count": 0,
"reply_count": 0
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"list_id": "<string>",
"contact_count": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"paused_reason": {
"code": "<string>",
"message": "<string>"
},
"finished_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}Campaigns
Launch a draft campaign
Enrolls the campaign’s leads and starts sending. Requires an Idempotency-Key header: sending the same key again returns the campaign as it is now and launches nothing. Returns 409 when the campaign was already launched with another key, or is paused, completed or archived. Returns 400 when something is missing, such as a sender for a channel its steps use.
POST
/
v1
/
campaigns
/
{campaign_id}
/
launch
Launch a draft campaign
curl --request POST \
--url https://api.getcluster.ai/v1/campaigns/{campaign_id}/launch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"send_window_mode": "next_send_window"
}
'import requests
url = "https://api.getcluster.ai/v1/campaigns/{campaign_id}/launch"
payload = { "send_window_mode": "next_send_window" }
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({send_window_mode: 'next_send_window'})
};
fetch('https://api.getcluster.ai/v1/campaigns/{campaign_id}/launch', 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.getcluster.ai/v1/campaigns/{campaign_id}/launch",
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([
'send_window_mode' => 'next_send_window'
]),
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://api.getcluster.ai/v1/campaigns/{campaign_id}/launch"
payload := strings.NewReader("{\n \"send_window_mode\": \"next_send_window\"\n}")
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://api.getcluster.ai/v1/campaigns/{campaign_id}/launch")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"send_window_mode\": \"next_send_window\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcluster.ai/v1/campaigns/{campaign_id}/launch")
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 = "{\n \"send_window_mode\": \"next_send_window\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"campaign_type": "<string>",
"delivery_mode": "<string>",
"stats": {
"active_contact_count": 0,
"completed_contact_count": 0,
"failed_contact_count": 0,
"excluded_contact_count": 0,
"connection_request_sent_count": 0,
"message_sent_count": 0,
"email_sent_count": 0,
"profile_visit_sent_count": 0,
"like_post_sent_count": 0,
"reply_count": 0
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"list_id": "<string>",
"contact_count": 123,
"scheduled_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"paused_reason": {
"code": "<string>",
"message": "<string>"
},
"finished_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"message": "<string>",
"field": "<string>"
}
]
}
}Authorizations
Body
application/json
Response
Successful Response