Pause Campaign
curl --request POST \
--url https://app.pixie.ai/api/campaigns/{id}/pause \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.pixie.ai/api/campaigns/{id}/pause"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.pixie.ai/api/campaigns/{id}/pause', 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://app.pixie.ai/api/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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.pixie.ai/api/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))
}HttpResponse<String> response = Unirest.post("https://app.pixie.ai/api/campaigns/{id}/pause")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pixie.ai/api/campaigns/{id}/pause")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"campaign": {
"id": "<string>",
"user_id": "<string>",
"type": "linkedin",
"name": "<string>",
"status": "draft",
"daily_limit": 4503599627370495,
"stop_on_reply": true,
"open_tracking": true,
"signature": "<string>",
"skip_other_campaigns": true,
"operating_hours": {},
"stats": {
"total": 4503599627370495,
"sent": 4503599627370495,
"replied": 4503599627370495,
"bounced": 4503599627370495,
"completed": 4503599627370495,
"timed_out": 4503599627370495,
"connection_sent": 4503599627370495,
"connected": 4503599627370495,
"message_sent": 4503599627370495
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"sender_accounts": [
{
"id": "<string>",
"type": "linkedin",
"email_address": "<string>",
"provider_account_id": "<string>",
"display_name": "<string>",
"status": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"daily_limit": 4503599627370495,
"is_default_sender": true,
"weekly_connection_limit": 4503599627370495,
"weekly_message_limit": 4503599627370495,
"is_premium": true
}
]
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Outbound
Pause Campaign
Halt an active campaign mid-send. Completes waitpoint tokens so Trigger.dev tasks observe the new state.
POST
/
api
/
campaigns
/
{id}
/
pause
Pause Campaign
curl --request POST \
--url https://app.pixie.ai/api/campaigns/{id}/pause \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.pixie.ai/api/campaigns/{id}/pause"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.pixie.ai/api/campaigns/{id}/pause', 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://app.pixie.ai/api/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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.pixie.ai/api/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))
}HttpResponse<String> response = Unirest.post("https://app.pixie.ai/api/campaigns/{id}/pause")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pixie.ai/api/campaigns/{id}/pause")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"campaign": {
"id": "<string>",
"user_id": "<string>",
"type": "linkedin",
"name": "<string>",
"status": "draft",
"daily_limit": 4503599627370495,
"stop_on_reply": true,
"open_tracking": true,
"signature": "<string>",
"skip_other_campaigns": true,
"operating_hours": {},
"stats": {
"total": 4503599627370495,
"sent": 4503599627370495,
"replied": 4503599627370495,
"bounced": 4503599627370495,
"completed": 4503599627370495,
"timed_out": 4503599627370495,
"connection_sent": 4503599627370495,
"connected": 4503599627370495,
"message_sent": 4503599627370495
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"sender_accounts": [
{
"id": "<string>",
"type": "linkedin",
"email_address": "<string>",
"provider_account_id": "<string>",
"display_name": "<string>",
"status": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"daily_limit": 4503599627370495,
"is_default_sender": true,
"weekly_connection_limit": 4503599627370495,
"weekly_message_limit": 4503599627370495,
"is_premium": true
}
]
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}CLI:
pixie campaign pause --id <id>
Overview
Flips anactive campaign to paused. Only active campaigns can be paused — every other status returns 400. The request body is empty.
Under the hood the server does two things:
- A compare-and-set update on
campaigns.status(fast, the only step that can fail the request). - Completes every outstanding Trigger.dev waitpoint token for this campaign’s leads with
{ paused: true }, so sleeping per-lead tasks wake up and re-check the status. This step is best-effort — token-completion failures are logged but do not surface as a 500.
AI agent notes
When to call. After a bounce spike, a misconfigured template, or explicit user intent. Validate on your side first — there’s no server-side dry-run.What changes immediately.
campaigns.status flips to paused synchronously. Sleeping tasks continue to exist on Trigger.dev until their waitpoint tokens resolve, but they will no-op on the pause check at the top of the engine loop.Idempotency. Not idempotent — a second call while already paused returns 400 (Only active campaigns can be paused). Treat that as a safe success for user-facing flows.Follow-up. Poll GET /api/campaigns/{id} to confirm status === "paused" before reporting success to the human. Resume later with POST /api/campaigns/{id}/resume.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Campaign UUID
Response
Campaign paused. Returns the updated campaign row with status: "paused".
The campaign row after the status transition. status is now paused.
Show child attributes
Show child attributes
Was this page helpful?