curl --request PATCH \
--url https://api.mailbeast.ai/v1/campaigns/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Q4 Launch (revised)",
"schedule": {
"mode": "advanced",
"intervals": [
{
"day": 1,
"startMinutes": 570,
"endMinutes": 1050,
"enabled": true
}
],
"timezone": "America/New_York",
"sendingDays": [
1,
2,
3,
4,
5
],
"sendingMinutesStart": 540,
"sendingMinutesEnd": 1020,
"dailyLimit": 50,
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"settings": {
"trackOpens": true,
"trackClicks": true,
"sendAsTextOnly": false,
"stopOnReply": true,
"useAllAccounts": false,
"stopOnBounce": true,
"stopCompanyOnReply": true,
"highBounceAutoProtection": false,
"skipInvalidEmails": true,
"skipUnknownEmails": true,
"skipRiskyEmails": false,
"sendFirstAsText": false,
"emailProviderMatching": true,
"unsubscribeLinkHeader": true,
"unsubscribeLinkBody": false,
"autoBlacklistOnUnsubscribe": false,
"newLeadsRatio": 80,
"abTestingOptimization": false,
"keepActiveWhenNoLeads": true,
"hubspotSyncEnabled": true
},
"sequence": [
{
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"variants": [
{
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"isActive": true
}
],
"delayDays": 0,
"delayHours": 0
}
],
"accounts": [
"123e4567-e89b-12d3-a456-426614174000"
],
"tags": [
"5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f"
]
}
'import requests
url = "https://api.mailbeast.ai/v1/campaigns/{id}"
payload = {
"name": "Q4 Launch (revised)",
"schedule": {
"mode": "advanced",
"intervals": [
{
"day": 1,
"startMinutes": 570,
"endMinutes": 1050,
"enabled": True
}
],
"timezone": "America/New_York",
"sendingDays": [1, 2, 3, 4, 5],
"sendingMinutesStart": 540,
"sendingMinutesEnd": 1020,
"dailyLimit": 50,
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"settings": {
"trackOpens": True,
"trackClicks": True,
"sendAsTextOnly": False,
"stopOnReply": True,
"useAllAccounts": False,
"stopOnBounce": True,
"stopCompanyOnReply": True,
"highBounceAutoProtection": False,
"skipInvalidEmails": True,
"skipUnknownEmails": True,
"skipRiskyEmails": False,
"sendFirstAsText": False,
"emailProviderMatching": True,
"unsubscribeLinkHeader": True,
"unsubscribeLinkBody": False,
"autoBlacklistOnUnsubscribe": False,
"newLeadsRatio": 80,
"abTestingOptimization": False,
"keepActiveWhenNoLeads": True,
"hubspotSyncEnabled": True
},
"sequence": [
{
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"variants": [
{
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"isActive": True
}
],
"delayDays": 0,
"delayHours": 0
}
],
"accounts": ["123e4567-e89b-12d3-a456-426614174000"],
"tags": ["5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f"]
}
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: 'Q4 Launch (revised)',
schedule: {
mode: 'advanced',
intervals: [{day: 1, startMinutes: 570, endMinutes: 1050, enabled: true}],
timezone: 'America/New_York',
sendingDays: [1, 2, 3, 4, 5],
sendingMinutesStart: 540,
sendingMinutesEnd: 1020,
dailyLimit: 50,
startDate: '2023-11-07T05:31:56Z',
endDate: '2023-11-07T05:31:56Z'
},
settings: {
trackOpens: true,
trackClicks: true,
sendAsTextOnly: false,
stopOnReply: true,
useAllAccounts: false,
stopOnBounce: true,
stopCompanyOnReply: true,
highBounceAutoProtection: false,
skipInvalidEmails: true,
skipUnknownEmails: true,
skipRiskyEmails: false,
sendFirstAsText: false,
emailProviderMatching: true,
unsubscribeLinkHeader: true,
unsubscribeLinkBody: false,
autoBlacklistOnUnsubscribe: false,
newLeadsRatio: 80,
abTestingOptimization: false,
keepActiveWhenNoLeads: true,
hubspotSyncEnabled: true
},
sequence: [
{
subject: 'Quick question about {{company_name}}',
body: JSON.stringify('<p>Hi {{first_name}}, …</p>'),
variants: [
{
subject: 'Quick question about {{company_name}}',
body: JSON.stringify('<p>Hi {{first_name}}, …</p>'),
isActive: true
}
],
delayDays: 0,
delayHours: 0
}
],
accounts: ['123e4567-e89b-12d3-a456-426614174000'],
tags: ['5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f']
})
};
fetch('https://api.mailbeast.ai/v1/campaigns/{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.mailbeast.ai/v1/campaigns/{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' => 'Q4 Launch (revised)',
'schedule' => [
'mode' => 'advanced',
'intervals' => [
[
'day' => 1,
'startMinutes' => 570,
'endMinutes' => 1050,
'enabled' => true
]
],
'timezone' => 'America/New_York',
'sendingDays' => [
1,
2,
3,
4,
5
],
'sendingMinutesStart' => 540,
'sendingMinutesEnd' => 1020,
'dailyLimit' => 50,
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z'
],
'settings' => [
'trackOpens' => true,
'trackClicks' => true,
'sendAsTextOnly' => false,
'stopOnReply' => true,
'useAllAccounts' => false,
'stopOnBounce' => true,
'stopCompanyOnReply' => true,
'highBounceAutoProtection' => false,
'skipInvalidEmails' => true,
'skipUnknownEmails' => true,
'skipRiskyEmails' => false,
'sendFirstAsText' => false,
'emailProviderMatching' => true,
'unsubscribeLinkHeader' => true,
'unsubscribeLinkBody' => false,
'autoBlacklistOnUnsubscribe' => false,
'newLeadsRatio' => 80,
'abTestingOptimization' => false,
'keepActiveWhenNoLeads' => true,
'hubspotSyncEnabled' => true
],
'sequence' => [
[
'subject' => 'Quick question about {{company_name}}',
'body' => '<p>Hi {{first_name}}, …</p>',
'variants' => [
[
'subject' => 'Quick question about {{company_name}}',
'body' => '<p>Hi {{first_name}}, …</p>',
'isActive' => true
]
],
'delayDays' => 0,
'delayHours' => 0
]
],
'accounts' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'tags' => [
'5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f'
]
]),
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.mailbeast.ai/v1/campaigns/{id}"
payload := strings.NewReader("{\n \"name\": \"Q4 Launch (revised)\",\n \"schedule\": {\n \"mode\": \"advanced\",\n \"intervals\": [\n {\n \"day\": 1,\n \"startMinutes\": 570,\n \"endMinutes\": 1050,\n \"enabled\": true\n }\n ],\n \"timezone\": \"America/New_York\",\n \"sendingDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"sendingMinutesStart\": 540,\n \"sendingMinutesEnd\": 1020,\n \"dailyLimit\": 50,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n },\n \"settings\": {\n \"trackOpens\": true,\n \"trackClicks\": true,\n \"sendAsTextOnly\": false,\n \"stopOnReply\": true,\n \"useAllAccounts\": false,\n \"stopOnBounce\": true,\n \"stopCompanyOnReply\": true,\n \"highBounceAutoProtection\": false,\n \"skipInvalidEmails\": true,\n \"skipUnknownEmails\": true,\n \"skipRiskyEmails\": false,\n \"sendFirstAsText\": false,\n \"emailProviderMatching\": true,\n \"unsubscribeLinkHeader\": true,\n \"unsubscribeLinkBody\": false,\n \"autoBlacklistOnUnsubscribe\": false,\n \"newLeadsRatio\": 80,\n \"abTestingOptimization\": false,\n \"keepActiveWhenNoLeads\": true,\n \"hubspotSyncEnabled\": true\n },\n \"sequence\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"variants\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"isActive\": true\n }\n ],\n \"delayDays\": 0,\n \"delayHours\": 0\n }\n ],\n \"accounts\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"tags\": [\n \"5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f\"\n ]\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.mailbeast.ai/v1/campaigns/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Q4 Launch (revised)\",\n \"schedule\": {\n \"mode\": \"advanced\",\n \"intervals\": [\n {\n \"day\": 1,\n \"startMinutes\": 570,\n \"endMinutes\": 1050,\n \"enabled\": true\n }\n ],\n \"timezone\": \"America/New_York\",\n \"sendingDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"sendingMinutesStart\": 540,\n \"sendingMinutesEnd\": 1020,\n \"dailyLimit\": 50,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n },\n \"settings\": {\n \"trackOpens\": true,\n \"trackClicks\": true,\n \"sendAsTextOnly\": false,\n \"stopOnReply\": true,\n \"useAllAccounts\": false,\n \"stopOnBounce\": true,\n \"stopCompanyOnReply\": true,\n \"highBounceAutoProtection\": false,\n \"skipInvalidEmails\": true,\n \"skipUnknownEmails\": true,\n \"skipRiskyEmails\": false,\n \"sendFirstAsText\": false,\n \"emailProviderMatching\": true,\n \"unsubscribeLinkHeader\": true,\n \"unsubscribeLinkBody\": false,\n \"autoBlacklistOnUnsubscribe\": false,\n \"newLeadsRatio\": 80,\n \"abTestingOptimization\": false,\n \"keepActiveWhenNoLeads\": true,\n \"hubspotSyncEnabled\": true\n },\n \"sequence\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"variants\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"isActive\": true\n }\n ],\n \"delayDays\": 0,\n \"delayHours\": 0\n }\n ],\n \"accounts\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"tags\": [\n \"5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mailbeast.ai/v1/campaigns/{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\": \"Q4 Launch (revised)\",\n \"schedule\": {\n \"mode\": \"advanced\",\n \"intervals\": [\n {\n \"day\": 1,\n \"startMinutes\": 570,\n \"endMinutes\": 1050,\n \"enabled\": true\n }\n ],\n \"timezone\": \"America/New_York\",\n \"sendingDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"sendingMinutesStart\": 540,\n \"sendingMinutesEnd\": 1020,\n \"dailyLimit\": 50,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n },\n \"settings\": {\n \"trackOpens\": true,\n \"trackClicks\": true,\n \"sendAsTextOnly\": false,\n \"stopOnReply\": true,\n \"useAllAccounts\": false,\n \"stopOnBounce\": true,\n \"stopCompanyOnReply\": true,\n \"highBounceAutoProtection\": false,\n \"skipInvalidEmails\": true,\n \"skipUnknownEmails\": true,\n \"skipRiskyEmails\": false,\n \"sendFirstAsText\": false,\n \"emailProviderMatching\": true,\n \"unsubscribeLinkHeader\": true,\n \"unsubscribeLinkBody\": false,\n \"autoBlacklistOnUnsubscribe\": false,\n \"newLeadsRatio\": 80,\n \"abTestingOptimization\": false,\n \"keepActiveWhenNoLeads\": true,\n \"hubspotSyncEnabled\": true\n },\n \"sequence\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"variants\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"isActive\": true\n }\n ],\n \"delayDays\": 0,\n \"delayHours\": 0\n }\n ],\n \"accounts\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"tags\": [\n \"5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Q4 Product Launch Outreach",
"status": "draft",
"schedule": {
"mode": "simple",
"intervals": [
{
"day": 1,
"startMinutes": 570,
"endMinutes": 1050,
"enabled": true
}
],
"timezone": "America/New_York",
"sendingMinutesStart": 540,
"sendingMinutesEnd": 1020,
"dailyLimit": 50,
"sendingDays": [
1,
2,
3,
4,
5
],
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"settings": {
"trackOpens": true,
"trackClicks": true,
"sendAsTextOnly": false,
"stopOnReply": true,
"useAllAccounts": false,
"stopOnBounce": true,
"stopCompanyOnReply": true,
"highBounceAutoProtection": false,
"skipInvalidEmails": true,
"skipUnknownEmails": true,
"skipRiskyEmails": false,
"sendFirstAsText": false,
"emailProviderMatching": true,
"unsubscribeLinkHeader": true,
"unsubscribeLinkBody": false,
"autoBlacklistOnUnsubscribe": false,
"newLeadsRatio": 80,
"abTestingOptimization": false,
"keepActiveWhenNoLeads": false,
"hubspotSyncEnabled": true
},
"metrics": {
"leadsCount": 150,
"sent": 120,
"opens": 90,
"clicks": 25,
"replies": 12
},
"tags": [
{
"id": "5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f",
"name": "client-acme",
"color": "#4F46E5"
}
],
"subsequences": [
{
"id": "5b2f3c4d-6e7f-4a81-9b0c-1d2e3f4a5b6c",
"name": "Interested - book a call",
"status": "active"
}
],
"createdAt": "2026-07-11T08:00:00.000Z",
"updatedAt": "2026-07-11T10:30:00.000Z",
"sequence": [
{
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"delayDays": 0,
"delayHours": 0,
"variants": [
{
"id": "b3f1a2c4-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"label": "A",
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"isActive": true
}
]
}
],
"accounts": [
"3f1c2b7e-9a4d-4e18-b2c1-6d8f5a0e7c93"
]
}{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "One or more fields are invalid.",
"status": 400,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"details": [
"name should not be empty"
]
}
}{
"error": {
"type": "authentication_error",
"code": "unauthenticated",
"message": "Missing or invalid API key.",
"status": 401,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "authorization_error",
"code": "permission_denied",
"message": "This API key is missing the required scope.",
"status": 403,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "not_found",
"message": "Resource not found.",
"status": 404,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "conflict",
"message": "The request conflicts with an existing resource.",
"status": 409,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used with a different request body. Use a new key for a new operation.",
"status": 422,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Retry after the interval in the Retry-After header.",
"status": 429,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"retryAfter": 30
}
}Update a campaign
Partial update - only the supplied sections are touched. accounts, tags and sequence, when present, REPLACE the existing set.
Requires one of the following scopes: campaigns:write, campaigns:all, all:all.
curl --request PATCH \
--url https://api.mailbeast.ai/v1/campaigns/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Q4 Launch (revised)",
"schedule": {
"mode": "advanced",
"intervals": [
{
"day": 1,
"startMinutes": 570,
"endMinutes": 1050,
"enabled": true
}
],
"timezone": "America/New_York",
"sendingDays": [
1,
2,
3,
4,
5
],
"sendingMinutesStart": 540,
"sendingMinutesEnd": 1020,
"dailyLimit": 50,
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"settings": {
"trackOpens": true,
"trackClicks": true,
"sendAsTextOnly": false,
"stopOnReply": true,
"useAllAccounts": false,
"stopOnBounce": true,
"stopCompanyOnReply": true,
"highBounceAutoProtection": false,
"skipInvalidEmails": true,
"skipUnknownEmails": true,
"skipRiskyEmails": false,
"sendFirstAsText": false,
"emailProviderMatching": true,
"unsubscribeLinkHeader": true,
"unsubscribeLinkBody": false,
"autoBlacklistOnUnsubscribe": false,
"newLeadsRatio": 80,
"abTestingOptimization": false,
"keepActiveWhenNoLeads": true,
"hubspotSyncEnabled": true
},
"sequence": [
{
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"variants": [
{
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"isActive": true
}
],
"delayDays": 0,
"delayHours": 0
}
],
"accounts": [
"123e4567-e89b-12d3-a456-426614174000"
],
"tags": [
"5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f"
]
}
'import requests
url = "https://api.mailbeast.ai/v1/campaigns/{id}"
payload = {
"name": "Q4 Launch (revised)",
"schedule": {
"mode": "advanced",
"intervals": [
{
"day": 1,
"startMinutes": 570,
"endMinutes": 1050,
"enabled": True
}
],
"timezone": "America/New_York",
"sendingDays": [1, 2, 3, 4, 5],
"sendingMinutesStart": 540,
"sendingMinutesEnd": 1020,
"dailyLimit": 50,
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"settings": {
"trackOpens": True,
"trackClicks": True,
"sendAsTextOnly": False,
"stopOnReply": True,
"useAllAccounts": False,
"stopOnBounce": True,
"stopCompanyOnReply": True,
"highBounceAutoProtection": False,
"skipInvalidEmails": True,
"skipUnknownEmails": True,
"skipRiskyEmails": False,
"sendFirstAsText": False,
"emailProviderMatching": True,
"unsubscribeLinkHeader": True,
"unsubscribeLinkBody": False,
"autoBlacklistOnUnsubscribe": False,
"newLeadsRatio": 80,
"abTestingOptimization": False,
"keepActiveWhenNoLeads": True,
"hubspotSyncEnabled": True
},
"sequence": [
{
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"variants": [
{
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"isActive": True
}
],
"delayDays": 0,
"delayHours": 0
}
],
"accounts": ["123e4567-e89b-12d3-a456-426614174000"],
"tags": ["5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f"]
}
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: 'Q4 Launch (revised)',
schedule: {
mode: 'advanced',
intervals: [{day: 1, startMinutes: 570, endMinutes: 1050, enabled: true}],
timezone: 'America/New_York',
sendingDays: [1, 2, 3, 4, 5],
sendingMinutesStart: 540,
sendingMinutesEnd: 1020,
dailyLimit: 50,
startDate: '2023-11-07T05:31:56Z',
endDate: '2023-11-07T05:31:56Z'
},
settings: {
trackOpens: true,
trackClicks: true,
sendAsTextOnly: false,
stopOnReply: true,
useAllAccounts: false,
stopOnBounce: true,
stopCompanyOnReply: true,
highBounceAutoProtection: false,
skipInvalidEmails: true,
skipUnknownEmails: true,
skipRiskyEmails: false,
sendFirstAsText: false,
emailProviderMatching: true,
unsubscribeLinkHeader: true,
unsubscribeLinkBody: false,
autoBlacklistOnUnsubscribe: false,
newLeadsRatio: 80,
abTestingOptimization: false,
keepActiveWhenNoLeads: true,
hubspotSyncEnabled: true
},
sequence: [
{
subject: 'Quick question about {{company_name}}',
body: JSON.stringify('<p>Hi {{first_name}}, …</p>'),
variants: [
{
subject: 'Quick question about {{company_name}}',
body: JSON.stringify('<p>Hi {{first_name}}, …</p>'),
isActive: true
}
],
delayDays: 0,
delayHours: 0
}
],
accounts: ['123e4567-e89b-12d3-a456-426614174000'],
tags: ['5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f']
})
};
fetch('https://api.mailbeast.ai/v1/campaigns/{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.mailbeast.ai/v1/campaigns/{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' => 'Q4 Launch (revised)',
'schedule' => [
'mode' => 'advanced',
'intervals' => [
[
'day' => 1,
'startMinutes' => 570,
'endMinutes' => 1050,
'enabled' => true
]
],
'timezone' => 'America/New_York',
'sendingDays' => [
1,
2,
3,
4,
5
],
'sendingMinutesStart' => 540,
'sendingMinutesEnd' => 1020,
'dailyLimit' => 50,
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z'
],
'settings' => [
'trackOpens' => true,
'trackClicks' => true,
'sendAsTextOnly' => false,
'stopOnReply' => true,
'useAllAccounts' => false,
'stopOnBounce' => true,
'stopCompanyOnReply' => true,
'highBounceAutoProtection' => false,
'skipInvalidEmails' => true,
'skipUnknownEmails' => true,
'skipRiskyEmails' => false,
'sendFirstAsText' => false,
'emailProviderMatching' => true,
'unsubscribeLinkHeader' => true,
'unsubscribeLinkBody' => false,
'autoBlacklistOnUnsubscribe' => false,
'newLeadsRatio' => 80,
'abTestingOptimization' => false,
'keepActiveWhenNoLeads' => true,
'hubspotSyncEnabled' => true
],
'sequence' => [
[
'subject' => 'Quick question about {{company_name}}',
'body' => '<p>Hi {{first_name}}, …</p>',
'variants' => [
[
'subject' => 'Quick question about {{company_name}}',
'body' => '<p>Hi {{first_name}}, …</p>',
'isActive' => true
]
],
'delayDays' => 0,
'delayHours' => 0
]
],
'accounts' => [
'123e4567-e89b-12d3-a456-426614174000'
],
'tags' => [
'5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f'
]
]),
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.mailbeast.ai/v1/campaigns/{id}"
payload := strings.NewReader("{\n \"name\": \"Q4 Launch (revised)\",\n \"schedule\": {\n \"mode\": \"advanced\",\n \"intervals\": [\n {\n \"day\": 1,\n \"startMinutes\": 570,\n \"endMinutes\": 1050,\n \"enabled\": true\n }\n ],\n \"timezone\": \"America/New_York\",\n \"sendingDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"sendingMinutesStart\": 540,\n \"sendingMinutesEnd\": 1020,\n \"dailyLimit\": 50,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n },\n \"settings\": {\n \"trackOpens\": true,\n \"trackClicks\": true,\n \"sendAsTextOnly\": false,\n \"stopOnReply\": true,\n \"useAllAccounts\": false,\n \"stopOnBounce\": true,\n \"stopCompanyOnReply\": true,\n \"highBounceAutoProtection\": false,\n \"skipInvalidEmails\": true,\n \"skipUnknownEmails\": true,\n \"skipRiskyEmails\": false,\n \"sendFirstAsText\": false,\n \"emailProviderMatching\": true,\n \"unsubscribeLinkHeader\": true,\n \"unsubscribeLinkBody\": false,\n \"autoBlacklistOnUnsubscribe\": false,\n \"newLeadsRatio\": 80,\n \"abTestingOptimization\": false,\n \"keepActiveWhenNoLeads\": true,\n \"hubspotSyncEnabled\": true\n },\n \"sequence\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"variants\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"isActive\": true\n }\n ],\n \"delayDays\": 0,\n \"delayHours\": 0\n }\n ],\n \"accounts\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"tags\": [\n \"5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f\"\n ]\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.mailbeast.ai/v1/campaigns/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Q4 Launch (revised)\",\n \"schedule\": {\n \"mode\": \"advanced\",\n \"intervals\": [\n {\n \"day\": 1,\n \"startMinutes\": 570,\n \"endMinutes\": 1050,\n \"enabled\": true\n }\n ],\n \"timezone\": \"America/New_York\",\n \"sendingDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"sendingMinutesStart\": 540,\n \"sendingMinutesEnd\": 1020,\n \"dailyLimit\": 50,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n },\n \"settings\": {\n \"trackOpens\": true,\n \"trackClicks\": true,\n \"sendAsTextOnly\": false,\n \"stopOnReply\": true,\n \"useAllAccounts\": false,\n \"stopOnBounce\": true,\n \"stopCompanyOnReply\": true,\n \"highBounceAutoProtection\": false,\n \"skipInvalidEmails\": true,\n \"skipUnknownEmails\": true,\n \"skipRiskyEmails\": false,\n \"sendFirstAsText\": false,\n \"emailProviderMatching\": true,\n \"unsubscribeLinkHeader\": true,\n \"unsubscribeLinkBody\": false,\n \"autoBlacklistOnUnsubscribe\": false,\n \"newLeadsRatio\": 80,\n \"abTestingOptimization\": false,\n \"keepActiveWhenNoLeads\": true,\n \"hubspotSyncEnabled\": true\n },\n \"sequence\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"variants\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"isActive\": true\n }\n ],\n \"delayDays\": 0,\n \"delayHours\": 0\n }\n ],\n \"accounts\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"tags\": [\n \"5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mailbeast.ai/v1/campaigns/{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\": \"Q4 Launch (revised)\",\n \"schedule\": {\n \"mode\": \"advanced\",\n \"intervals\": [\n {\n \"day\": 1,\n \"startMinutes\": 570,\n \"endMinutes\": 1050,\n \"enabled\": true\n }\n ],\n \"timezone\": \"America/New_York\",\n \"sendingDays\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"sendingMinutesStart\": 540,\n \"sendingMinutesEnd\": 1020,\n \"dailyLimit\": 50,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n },\n \"settings\": {\n \"trackOpens\": true,\n \"trackClicks\": true,\n \"sendAsTextOnly\": false,\n \"stopOnReply\": true,\n \"useAllAccounts\": false,\n \"stopOnBounce\": true,\n \"stopCompanyOnReply\": true,\n \"highBounceAutoProtection\": false,\n \"skipInvalidEmails\": true,\n \"skipUnknownEmails\": true,\n \"skipRiskyEmails\": false,\n \"sendFirstAsText\": false,\n \"emailProviderMatching\": true,\n \"unsubscribeLinkHeader\": true,\n \"unsubscribeLinkBody\": false,\n \"autoBlacklistOnUnsubscribe\": false,\n \"newLeadsRatio\": 80,\n \"abTestingOptimization\": false,\n \"keepActiveWhenNoLeads\": true,\n \"hubspotSyncEnabled\": true\n },\n \"sequence\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"variants\": [\n {\n \"subject\": \"Quick question about {{company_name}}\",\n \"body\": \"<p>Hi {{first_name}}, …</p>\",\n \"isActive\": true\n }\n ],\n \"delayDays\": 0,\n \"delayHours\": 0\n }\n ],\n \"accounts\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ],\n \"tags\": [\n \"5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Q4 Product Launch Outreach",
"status": "draft",
"schedule": {
"mode": "simple",
"intervals": [
{
"day": 1,
"startMinutes": 570,
"endMinutes": 1050,
"enabled": true
}
],
"timezone": "America/New_York",
"sendingMinutesStart": 540,
"sendingMinutesEnd": 1020,
"dailyLimit": 50,
"sendingDays": [
1,
2,
3,
4,
5
],
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"settings": {
"trackOpens": true,
"trackClicks": true,
"sendAsTextOnly": false,
"stopOnReply": true,
"useAllAccounts": false,
"stopOnBounce": true,
"stopCompanyOnReply": true,
"highBounceAutoProtection": false,
"skipInvalidEmails": true,
"skipUnknownEmails": true,
"skipRiskyEmails": false,
"sendFirstAsText": false,
"emailProviderMatching": true,
"unsubscribeLinkHeader": true,
"unsubscribeLinkBody": false,
"autoBlacklistOnUnsubscribe": false,
"newLeadsRatio": 80,
"abTestingOptimization": false,
"keepActiveWhenNoLeads": false,
"hubspotSyncEnabled": true
},
"metrics": {
"leadsCount": 150,
"sent": 120,
"opens": 90,
"clicks": 25,
"replies": 12
},
"tags": [
{
"id": "5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f",
"name": "client-acme",
"color": "#4F46E5"
}
],
"subsequences": [
{
"id": "5b2f3c4d-6e7f-4a81-9b0c-1d2e3f4a5b6c",
"name": "Interested - book a call",
"status": "active"
}
],
"createdAt": "2026-07-11T08:00:00.000Z",
"updatedAt": "2026-07-11T10:30:00.000Z",
"sequence": [
{
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"delayDays": 0,
"delayHours": 0,
"variants": [
{
"id": "b3f1a2c4-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"label": "A",
"subject": "Quick question about {{company_name}}",
"body": "<p>Hi {{first_name}}, …</p>",
"isActive": true
}
]
}
],
"accounts": [
"3f1c2b7e-9a4d-4e18-b2c1-6d8f5a0e7c93"
]
}{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "One or more fields are invalid.",
"status": 400,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"details": [
"name should not be empty"
]
}
}{
"error": {
"type": "authentication_error",
"code": "unauthenticated",
"message": "Missing or invalid API key.",
"status": 401,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "authorization_error",
"code": "permission_denied",
"message": "This API key is missing the required scope.",
"status": 403,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "not_found",
"message": "Resource not found.",
"status": 404,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "conflict",
"message": "The request conflicts with an existing resource.",
"status": 409,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used with a different request body. Use a new key for a new operation.",
"status": 422,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Retry after the interval in the Retry-After header.",
"status": 429,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"retryAfter": 30
}
}Authorizations
Headers
Optional. A unique key you generate (max 255 chars, such as a UUID) that makes this request safe to retry. Retrying with the same key replays the original response instead of repeating the operation. Reusing a key with a different body returns 422.
255"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Body
When supplied, REPLACES the attached SMTP account set — the mailboxes the campaign sends from when settings.useAllAccounts is false. While useAllAccounts is true the campaign sends from every connected mailbox and this list does not limit it.
100["123e4567-e89b-12d3-a456-426614174000"]
When supplied, REPLACES the campaign's tags ([] removes them all). Campaign tag ids to put on the campaign. Read the ids from tags[] on any campaign; tags themselves are created in the dashboard. Mailbox tag ids are a different dictionary and are rejected.
50["5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f"]