curl -X PATCH https://api.sendpilot.ai/v1/campaigns/camp_xyz789 \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "pause"
}'
curl -X PATCH https://api.sendpilot.ai/v1/campaigns/camp_xyz789 \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "resume"
}'
// Pause campaign
const response = await fetch('https://api.sendpilot.ai/v1/campaigns/camp_xyz789', {
method: 'PATCH',
headers: {
'X-API-Key': process.env.SENDPILOT_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'pause' // or 'resume'
})
});
const result = await response.json();
import requests
response = requests.patch(
'https://api.sendpilot.ai/v1/campaigns/camp_xyz789',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={'action': 'pause'} # or 'resume'
)
result = response.json()
{
"success": true,
"campaignId": "camp_xyz789",
"action": "pause",
"newStatus": "paused",
"message": "Campaign paused successfully"
}
{
"success": true,
"campaignId": "camp_xyz789",
"action": "resume",
"newStatus": "active",
"message": "Campaign resumed successfully"
}
{
"statusCode": 400,
"error": "Bad Request",
"code": "INVALID_CAMPAIGN_STATE",
"message": "Cannot pause campaign. Current status is 'PAUSED', expected 'STARTED'"
}
{
"statusCode": 404,
"error": "Not Found",
"code": "CAMPAIGN_NOT_FOUND",
"message": "Campaign with ID 'camp_xyz789' not found in this workspace"
}
Campaigns
Update Campaign
Pause or resume a campaign
PATCH
/
v1
/
campaigns
/
{id}
curl -X PATCH https://api.sendpilot.ai/v1/campaigns/camp_xyz789 \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "pause"
}'
curl -X PATCH https://api.sendpilot.ai/v1/campaigns/camp_xyz789 \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "resume"
}'
// Pause campaign
const response = await fetch('https://api.sendpilot.ai/v1/campaigns/camp_xyz789', {
method: 'PATCH',
headers: {
'X-API-Key': process.env.SENDPILOT_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'pause' // or 'resume'
})
});
const result = await response.json();
import requests
response = requests.patch(
'https://api.sendpilot.ai/v1/campaigns/camp_xyz789',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={'action': 'pause'} # or 'resume'
)
result = response.json()
{
"success": true,
"campaignId": "camp_xyz789",
"action": "pause",
"newStatus": "paused",
"message": "Campaign paused successfully"
}
{
"success": true,
"campaignId": "camp_xyz789",
"action": "resume",
"newStatus": "active",
"message": "Campaign resumed successfully"
}
{
"statusCode": 400,
"error": "Bad Request",
"code": "INVALID_CAMPAIGN_STATE",
"message": "Cannot pause campaign. Current status is 'PAUSED', expected 'STARTED'"
}
{
"statusCode": 404,
"error": "Not Found",
"code": "CAMPAIGN_NOT_FOUND",
"message": "Campaign with ID 'camp_xyz789' not found in this workspace"
}
Update a campaign’s state. Currently supports pausing and resuming campaigns.
Request
string
required
Your API key
string
required
The campaign ID
string
required
The action to perform. Options:
pause, resumeResponse
boolean
Whether the action was successful
string
Campaign identifier
string
The action that was performed
string
The new status of the campaign
string
Confirmation message
curl -X PATCH https://api.sendpilot.ai/v1/campaigns/camp_xyz789 \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "pause"
}'
curl -X PATCH https://api.sendpilot.ai/v1/campaigns/camp_xyz789 \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "resume"
}'
// Pause campaign
const response = await fetch('https://api.sendpilot.ai/v1/campaigns/camp_xyz789', {
method: 'PATCH',
headers: {
'X-API-Key': process.env.SENDPILOT_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: 'pause' // or 'resume'
})
});
const result = await response.json();
import requests
response = requests.patch(
'https://api.sendpilot.ai/v1/campaigns/camp_xyz789',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={'action': 'pause'} # or 'resume'
)
result = response.json()
{
"success": true,
"campaignId": "camp_xyz789",
"action": "pause",
"newStatus": "paused",
"message": "Campaign paused successfully"
}
{
"success": true,
"campaignId": "camp_xyz789",
"action": "resume",
"newStatus": "active",
"message": "Campaign resumed successfully"
}
{
"statusCode": 400,
"error": "Bad Request",
"code": "INVALID_CAMPAIGN_STATE",
"message": "Cannot pause campaign. Current status is 'PAUSED', expected 'STARTED'"
}
{
"statusCode": 404,
"error": "Not Found",
"code": "CAMPAIGN_NOT_FOUND",
"message": "Campaign with ID 'camp_xyz789' not found in this workspace"
}
When a campaign is paused or resumed, the corresponding webhook event (
campaign.paused or campaign.resumed) will be sent to your registered webhook endpoints.Authorizations
API key for authentication
Path Parameters
Campaign ID
Body
application/json
Action to perform on the campaign
Available options:
pause, resume