Skip to main content
PATCH
/
api
/
v1
/
campaigns
/
{campaign_id}
Update Campaign
curl --request PATCH \
  --url https://api.example.com/api/v1/campaigns/{campaign_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "step_updates": [
    {
      "step": 2,
      "message_template": "<string>"
    }
  ],
  "daily_limit": 5000,
  "sending_window_start": "<string>",
  "sending_window_end": "<string>",
  "min_interval_seconds": 1830,
  "timezone": "<string>",
  "send_days": [
    "<string>"
  ],
  "start_date": "2023-11-07T05:31:56Z",
  "system_prompt": "<string>",
  "playground_discovery_dismissed_at": "2023-11-07T05:31:56Z"
}
'
import requests

url = "https://api.example.com/api/v1/campaigns/{campaign_id}"

payload = {
    "name": "<string>",
    "description": "<string>",
    "step_updates": [
        {
            "step": 2,
            "message_template": "<string>"
        }
    ],
    "daily_limit": 5000,
    "sending_window_start": "<string>",
    "sending_window_end": "<string>",
    "min_interval_seconds": 1830,
    "timezone": "<string>",
    "send_days": ["<string>"],
    "start_date": "2023-11-07T05:31:56Z",
    "system_prompt": "<string>",
    "playground_discovery_dismissed_at": "2023-11-07T05:31:56Z"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: '<string>',
    description: '<string>',
    step_updates: [{step: 2, message_template: '<string>'}],
    daily_limit: 5000,
    sending_window_start: '<string>',
    sending_window_end: '<string>',
    min_interval_seconds: 1830,
    timezone: '<string>',
    send_days: ['<string>'],
    start_date: '2023-11-07T05:31:56Z',
    system_prompt: '<string>',
    playground_discovery_dismissed_at: '2023-11-07T05:31:56Z'
  })
};

fetch('https://api.example.com/api/v1/campaigns/{campaign_id}', 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.example.com/api/v1/campaigns/{campaign_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => '<string>',
    'description' => '<string>',
    'step_updates' => [
        [
                'step' => 2,
                'message_template' => '<string>'
        ]
    ],
    'daily_limit' => 5000,
    'sending_window_start' => '<string>',
    'sending_window_end' => '<string>',
    'min_interval_seconds' => 1830,
    'timezone' => '<string>',
    'send_days' => [
        '<string>'
    ],
    'start_date' => '2023-11-07T05:31:56Z',
    'system_prompt' => '<string>',
    'playground_discovery_dismissed_at' => '2023-11-07T05:31:56Z'
  ]),
  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.example.com/api/v1/campaigns/{campaign_id}"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"step_updates\": [\n    {\n      \"step\": 2,\n      \"message_template\": \"<string>\"\n    }\n  ],\n  \"daily_limit\": 5000,\n  \"sending_window_start\": \"<string>\",\n  \"sending_window_end\": \"<string>\",\n  \"min_interval_seconds\": 1830,\n  \"timezone\": \"<string>\",\n  \"send_days\": [\n    \"<string>\"\n  ],\n  \"start_date\": \"2023-11-07T05:31:56Z\",\n  \"system_prompt\": \"<string>\",\n  \"playground_discovery_dismissed_at\": \"2023-11-07T05:31:56Z\"\n}")

	req, _ := http.NewRequest("PATCH", 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.patch("https://api.example.com/api/v1/campaigns/{campaign_id}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"step_updates\": [\n    {\n      \"step\": 2,\n      \"message_template\": \"<string>\"\n    }\n  ],\n  \"daily_limit\": 5000,\n  \"sending_window_start\": \"<string>\",\n  \"sending_window_end\": \"<string>\",\n  \"min_interval_seconds\": 1830,\n  \"timezone\": \"<string>\",\n  \"send_days\": [\n    \"<string>\"\n  ],\n  \"start_date\": \"2023-11-07T05:31:56Z\",\n  \"system_prompt\": \"<string>\",\n  \"playground_discovery_dismissed_at\": \"2023-11-07T05:31:56Z\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/campaigns/{campaign_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"<string>\",\n  \"description\": \"<string>\",\n  \"step_updates\": [\n    {\n      \"step\": 2,\n      \"message_template\": \"<string>\"\n    }\n  ],\n  \"daily_limit\": 5000,\n  \"sending_window_start\": \"<string>\",\n  \"sending_window_end\": \"<string>\",\n  \"min_interval_seconds\": 1830,\n  \"timezone\": \"<string>\",\n  \"send_days\": [\n    \"<string>\"\n  ],\n  \"start_date\": \"2023-11-07T05:31:56Z\",\n  \"system_prompt\": \"<string>\",\n  \"playground_discovery_dismissed_at\": \"2023-11-07T05:31:56Z\"\n}"

response = http.request(request)
puts response.read_body
{
  "campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "type": "<string>",
  "daily_limit": 123,
  "sending_window_start": "<string>",
  "sending_window_end": "<string>",
  "min_interval_seconds": 123,
  "timezone": "<string>",
  "steps_config": [
    {
      "step": 2,
      "delay_days": 1,
      "channel": "email",
      "variants": [
        {
          "label": "<string>",
          "weight": 50,
          "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "sender_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      ],
      "ai_personalization_enabled": true,
      "track_clicks": false,
      "message_template": "<string>"
    }
  ],
  "send_days": [
    "<string>"
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "start_date": "2023-11-07T05:31:56Z",
  "alias_ids": [
    "<string>"
  ],
  "connected_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "total_leads": 123,
  "processed_leads": 0,
  "launch_job_id": "<string>",
  "launch_requested_at": "2023-11-07T05:31:56Z",
  "launch_error": "<string>",
  "system_prompt": "<string>",
  "unreviewed_launch_policy": "launch_default",
  "paused_reason": "<string>",
  "playground_discovery_dismissed_at": "2023-11-07T05:31:56Z"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

campaign_id
string<uuid>
required

Body

application/json

Request model for updating a campaign.

name
string | null
Required string length: 1 - 255
description
string | null
Maximum string length: 1000
step_updates
StepTemplateUpdate · object[] | null
daily_limit
integer | null
Required range: 1 <= x <= 10000
sending_window_start
string<time> | null
sending_window_end
string<time> | null
min_interval_seconds
integer | null
Required range: 60 <= x <= 3600
timezone
string | null
send_days
string[] | null
launch_type
enum<string> | null

Campaign launch type values.

Available options:
immediate,
scheduled
start_date
string<date-time> | null
system_prompt
string | null

Campaign-level personalization prompt override. Send explicit null to clear the existing value (sets the column to NULL); omit the field entirely to leave it unchanged. Empty string is rejected by the 100-char min-length guard — use null to clear.

Required string length: 100 - 5000
unreviewed_launch_policy
enum<string> | null

Policy applied when scheduled launch fires without playground review.

Available options:
launch_default,
hold,
cancel
playground_discovery_dismissed_at
string<date-time> | null

ISO timestamp of when the user dismissed the playground discovery banner on the campaign detail page. Send explicit null to clear the dismissal (banner re-appears); omit to leave unchanged. Narrow-PATCH surface — AC16 requires that a dismissal write must not clobber system_prompt or unreviewed_launch_policy on the same row, which the model_fields_set PATCH semantics enforce.

Response

Successful Response

Response model for campaign.

campaign_id
string<uuid>
required

Unique campaign identifier

user_id
string<uuid>
required

Owner user ID

dataset_id
string<uuid>
required

Associated dataset ID

name
string
required

Campaign name

type
string
required

Campaign type (email, linkedin, mixed)

status
enum<string>
required

Current campaign status

Available options:
draft,
launching,
scheduled,
active,
draining,
paused,
completed,
failed
launch_type
enum<string>
required

Launch type

Available options:
immediate,
scheduled
daily_limit
integer
required

Max actions per day

sending_window_start
string<time>
required

Daily sending window start

sending_window_end
string<time>
required

Daily sending window end

min_interval_seconds
integer
required

Min seconds between actions

timezone
string
required

Timezone for sending window

steps_config
CampaignStepConfig · object[]
required

Steps configuration

send_days
string[]
required

Days of week to send

created_at
string<date-time>
required

Creation timestamp

updated_at
string<date-time>
required

Last update timestamp

description
string | null

Campaign description

start_date
string<date-time> | null

Scheduled start date

alias_ids
string[] | null

Bavimail alias IDs

connected_account_id
string<uuid> | null

Connected account for LinkedIn

total_leads
integer | null

Total leads in campaign

processed_leads
integer
default:0

Leads not in pending/active status

launch_job_id
string | null

ARQ job ID for background launch

launch_requested_at
string<date-time> | null

When launch was requested

launch_error
string | null

Error message if launch failed

system_prompt
string | null

Campaign-level personalization prompt override (migration 108).

unreviewed_launch_policy
enum<string>
default:launch_default

Policy for scheduled launch without playground review (migration 108).

Available options:
launch_default,
hold,
cancel
paused_reason
string | null

Reason the campaign is paused, e.g. 'pending_personalization_review' (migration 108).

playground_discovery_dismissed_at
string<date-time> | null

When the owner dismissed the playground discovery banner (migration 108).