Campaigns
Execute a campaign action
Execute a lifecycle action on a campaign. Each action is only allowed from certain statuses; any other combination returns 400.
START: draft to activePAUSE: active to pausedRESUME: paused to activeCOMPLETE: active to completedARCHIVE: draft, active, or paused to archivedUNARCHIVE: archived to draftDELETE: draft or archived to deleted
START requires at least one enrolled contact (404 otherwise). START and RESUME return 400 when an auto-email step that has not finished has no template, when the campaign has email steps but no connected sending inbox (START only), or when the organization uses Max Active Contacts and the campaign’s value is 0, unset, or above inbox capacity. START also returns 403 (code tosNotAccepted) until the user accepts the Engage Terms of Service in the Seamless.AI app.
POST
/
campaigns
/
{id}
/
actions
Execute a campaign action
curl --request POST \
--url https://api.seamless.ai/api/client/v2/campaigns/{id}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.seamless.ai/api/client/v2/campaigns/{id}/actions"
payload = {}
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({})
};
fetch('https://api.seamless.ai/api/client/v2/campaigns/{id}/actions', 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.seamless.ai/api/client/v2/campaigns/{id}/actions",
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"
],
]);
$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.seamless.ai/api/client/v2/campaigns/{id}/actions"
payload := strings.NewReader("{}")
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.seamless.ai/api/client/v2/campaigns/{id}/actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seamless.ai/api/client/v2/campaigns/{id}/actions")
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 = "{}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"campaignId": 123,
"action": "START",
"status": "active"
}
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}Authorizations
OAuth2ApiKeyAuth
Body
application/json
Was this page helpful?
⌘I
Execute a campaign action
curl --request POST \
--url https://api.seamless.ai/api/client/v2/campaigns/{id}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.seamless.ai/api/client/v2/campaigns/{id}/actions"
payload = {}
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({})
};
fetch('https://api.seamless.ai/api/client/v2/campaigns/{id}/actions', 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.seamless.ai/api/client/v2/campaigns/{id}/actions",
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"
],
]);
$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.seamless.ai/api/client/v2/campaigns/{id}/actions"
payload := strings.NewReader("{}")
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.seamless.ai/api/client/v2/campaigns/{id}/actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seamless.ai/api/client/v2/campaigns/{id}/actions")
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 = "{}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"campaignId": 123,
"action": "START",
"status": "active"
}
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}{
"msg": "<string>",
"code": "<string>"
}