Create a draft campaign with its sequence
curl --request POST \
--url https://api.getcluster.ai/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sequence": {
"steps": [
{
"name": "<string>",
"subject": "<string>",
"body": "<string>",
"wait_days": 0
}
]
},
"linkedin_sender_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"email_sender_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.getcluster.ai/v1/campaigns"
payload = {
"name": "<string>",
"sequence": { "steps": [
{
"name": "<string>",
"subject": "<string>",
"body": "<string>",
"wait_days": 0
}
] },
"linkedin_sender_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"email_sender_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sequence: {
steps: [
{
name: '<string>',
subject: '<string>',
body: JSON.stringify('<string>'),
wait_days: 0
}
]
},
linkedin_sender_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
email_sender_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.getcluster.ai/v1/campaigns', 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",
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([
'name' => '<string>',
'sequence' => [
'steps' => [
[
'name' => '<string>',
'subject' => '<string>',
'body' => '<string>',
'wait_days' => 0
]
]
],
'linkedin_sender_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'email_sender_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.getcluster.ai/v1/campaigns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sequence\": {\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"wait_days\": 0\n }\n ]\n },\n \"linkedin_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"email_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sequence\": {\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"wait_days\": 0\n }\n ]\n },\n \"linkedin_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"email_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcluster.ai/v1/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"sequence\": {\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"wait_days\": 0\n }\n ]\n },\n \"linkedin_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"email_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\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>"
}
]
}
}Campaigns
Create a draft campaign with its sequence
The campaign starts as a draft and sends nothing until it is launched. Add its leads with POST /campaigns/{id}/leads. Send an Idempotency-Key header to make a retry safe: the same key returns the campaign it first created, and 422 if the request changed. Without one, a retry creates a second draft.
POST
/
v1
/
campaigns
Create a draft campaign with its sequence
curl --request POST \
--url https://api.getcluster.ai/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sequence": {
"steps": [
{
"name": "<string>",
"subject": "<string>",
"body": "<string>",
"wait_days": 0
}
]
},
"linkedin_sender_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"email_sender_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.getcluster.ai/v1/campaigns"
payload = {
"name": "<string>",
"sequence": { "steps": [
{
"name": "<string>",
"subject": "<string>",
"body": "<string>",
"wait_days": 0
}
] },
"linkedin_sender_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"email_sender_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sequence: {
steps: [
{
name: '<string>',
subject: '<string>',
body: JSON.stringify('<string>'),
wait_days: 0
}
]
},
linkedin_sender_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
email_sender_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.getcluster.ai/v1/campaigns', 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",
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([
'name' => '<string>',
'sequence' => [
'steps' => [
[
'name' => '<string>',
'subject' => '<string>',
'body' => '<string>',
'wait_days' => 0
]
]
],
'linkedin_sender_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'email_sender_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.getcluster.ai/v1/campaigns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sequence\": {\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"wait_days\": 0\n }\n ]\n },\n \"linkedin_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"email_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sequence\": {\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"wait_days\": 0\n }\n ]\n },\n \"linkedin_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"email_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcluster.ai/v1/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"sequence\": {\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"wait_days\": 0\n }\n ]\n },\n \"linkedin_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"email_sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\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>"
}
]
}
}Authorizations
Body
application/json
Response
Successful Response