Update broadcast campaign
Description
Updates campaign details, changes an existing campaign settings.
Request URL
Method: POST
https://example.com/api/v1.1/campaigns/broadcasts/update
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
id | int | 1 | Yes | Campaign ID |
format | string | "json" | No | Response data format. By default – json |
name | string | "Broadcast campaign name" | Yes | Campaign name |
is_active | bool | true | No | Activate or deactivate campaign |
data_type | string | "list" | Yes | Audience source type |
data_id | int | 12 | Yes | Audience source ID |
resource_id | int | 24 | No | Resource ID |
content | JSON array | Yes | Message template object | |
subid | string | "Adv_1" | No | Campaign SubID |
start_schedule | JSON object | No | Start schedule object | |
limit | int | 0 | No | Campaign cycle limitation |
aglimit_count | int | 0 | No | Increase limit each cycle — number |
agllimit_percent | float | 99.0 | No | Increase limit each cycle — percent |
policy_id | int | 1 | No | Sending policy ID |
push_sending_mode | string | "fanout" (default) "last" | No | Push notification sending mode (push channels only) |
Smart settings | ||||
virtual_sender_id | int | 12 | No | Virtual sender ID (Smart accounts) |
is_random_tracking_prefix | bool | false | No | Random tracking domain prefix (Smart accounts) |
custom_tracking_domains | JSON array | ["trk.example.com", "trk2.example.com"] | No | Tracking domains list (Smart accounts) |
blind_carbon_copy | JSON array | ["john@example.com", "george@example.com"] | No | Hidden copy email addresses (Smart accounts) |
unconditional_sending | bool | true | No | Send messages regardless of subscription status (Smart accounts) |
watched_list_id | int | 12 | No | Campaign watchers database ID (Smart accounts) |
watcher_limit | int | 100 | No | Watchers limit (Smart accounts) |
info
You cannot change the channel in a saved campaign. When passing such parameters as send_channel, content_type, send_email_content, send_sms_content, send_push_content, the request will not return an error, but it will not update the sending channel either.
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"virtual_sender_id": 5,
"content": [
{
"from_email": "example@example.com",
"from_name": "Alexandra",
"message_id": 14,
"replyto_email": "example@example.com",
"replyto_name": "Victoria",
"subject": "Hi!"
}
],
"custom_tracking_domains": [
"trk.example.com",
"trk.example.org"
],
"data_id": 1,
"data_type": "list",
"id": 90,
"is_active": true,
"limit": 10,
"name": "Broadcast",
"resource_id": 20,
"start_schedule": {
"start_hours": [
1,
2,
3,
4
],
"start_mdays": [
1
],
"start_mins": [
1,
2,
3,
4
],
"start_months": [
12
],
"start_wdays": [],
"start_years": [
2024
]
}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<virtual_sender_id>5</virtual_sender_id>
<content array='true'>
<from_email>broadcast1@altcraft.com</from_email>
<from_name>Margorita</from_name>
<message_id>14</message_id>
<replyto_email>example@example.com</replyto_email>
<replyto_name>Victoria</replyto_name>
<subject>Good morning!</subject>
</content>
<custom_tracking_domains>trk.example.com</custom_tracking_domains>
<custom_tracking_domains>trk.example.org</custom_tracking_domains>
<data_id>1</data_id>
<data_type>list</data_type>
<id>89</id>
<is_active>true</is_active>
<limit>10</limit>
<name>Broadcast</name>
<resource_id>20</resource_id>
<start_schedule>
<start_hours>1</start_hours>
<start_hours>2</start_hours>
<start_hours>3</start_hours>
<start_hours>4</start_hours>
<start_mins>1</start_mins>
<start_mins>2</start_mins>
<start_mins>3</start_mins>
<start_mins>4</start_mins>
<start_mdays array='true'>1</start_mdays>
<start_months array='true'>12</start_months>
<start_wdays array='true'></start_wdays>
<start_years array='true'>2024</start_years>
</start_schedule>
</xml>
Response example
- JSON
- XML
{
"data": {
"saved_id": 90
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<saved_id>90</saved_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
saved_id | int | Campaign ID |