Pause a campaign
curl --request POST \
--url https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"status": "<string>",
"templateId": "<string>",
"recipientListId": "<string>",
"recipientCount": 123,
"sentCount": 123,
"deliveredCount": 123,
"readCount": 123,
"failedCount": 123,
"skippedCount": 123,
"scheduledAt": 123,
"launchedAt": 123,
"completedAt": 123,
"createdAt": 123,
"updatedAt": 123
}
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}Campaigns
Pause a campaign
POST
/
api
/
projects
/
{projectSlug}
/
campaigns
/
{id}
/
pause
Pause a campaign
curl --request POST \
--url https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polymorfa.com/api/projects/{projectSlug}/campaigns/{id}/pause",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"status": "<string>",
"templateId": "<string>",
"recipientListId": "<string>",
"recipientCount": 123,
"sentCount": 123,
"deliveredCount": 123,
"readCount": 123,
"failedCount": 123,
"skippedCount": 123,
"scheduledAt": 123,
"launchedAt": 123,
"completedAt": 123,
"createdAt": 123,
"updatedAt": 123
}
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}Authorizations
Polymorfa organization key (titan_ prefix), project token (titan_pt_ prefix), or client token (titan_ct_ prefix), where the operation permits that audience.