Skip to main content

Create regular campaign

Description

Creates a new regular campaign.

Request URL

Method: POST

https://example.com/api/v1.1/campaigns/regulars/add/

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format.
By default – json
namestring"Broadcast campaign name"YesCampaign name
is_activebooltrueNoActivate campaign on creation
data_typestring"list"YesAudience source type
data_idint12YesAudience source ID
resource_idint24NoResource ID
contentJSON array
YesMessage template object
send_channelstring"email"
"sms"
"push"
YesSending channel
content_typestring"email"NoDeprecated. If you pass this parameter, the campaign will use the email channel for sending, no matter what value you specify. It is recommended to use send_channel.
send_email_contentbooltrueNoDeprecated. If you pass this parameter, the campaign will use the email channel for sending, no matter what value you specify. It is recommended to use send_channel.
send_push_contentbooltrueNoDeprecated. If you pass this parameter, the campaign will use the email channel for sending, no matter what value you specify. It is recommended to use send_channel.
send_sms_contentbooltrueNoDeprecated. If you pass this parameter, the campaign will use the email channel for sending, no matter what value you specify. It is recommended to use send_channel.
subidstring"Adv_1"NoCampaign SubID
start_scheduleJSON object
NoStart schedule object
limitint0NoCampaign cycle limitation
aglimit_countint0NoIncrease limit each cycle — number
agllimit_percentfloat99.0NoIncrease limit each cycle — percent
policy_idint1NoSending policy ID
push_sending_modestring"fanout" (default)
"last"
NoPush notification sending mode (push channels only)
Smart settings
virtual_sender_idint12NoVirtual sender ID
(Smart accounts)
is_random_tracking_prefixboolfalseNoRandom tracking domain prefix
(Smart accounts)
custom_tracking_domainsJSON array["trk.example.com", "trk2.example.com"]NoTracking domain list
(Smart accounts)
blind_carbon_copyJSON array["john@example.com", "george@example.com"]NoHidden copy email addresses
(Smart accounts)
unconditional_sendingbooltrueNoSend messages regardless of subscription status
(Smart accounts)
watched_list_idint12NoCampaign watchers database ID
(Smart accounts)
watcher_limitint100NoWatchers limit
(Smart accounts)

Request example

{
"content": [
{
"from_email": "broadcast@altcraft.com",
"from_name": "",
"message_id": 2549,
"replyto_email": "broadcast@altcraft.com",
"replyto_name": "",
"subject": "Hello"
}
],
"custom_tracking_domains": [
"trk.example.com",
"trk.example.org"
],
"data_id": 2690,
"data_type": "segment",
"is_active": true,
"limit": 1,
"name": "Regular campaign name",
"resource_id": 400,
"send_channel": "email",
"start_schedule": {
"start_hours": [
1,
2,
3,
4
],
"start_mdays": [
1
],
"start_mins": [
1,
2,
3,
4
],
"start_months": [
12
],
"start_wdays": [],
"start_years": [
2020
]
},
"token": "abcdefghijklmnqrstuvwxyz",
"virtual_sender_id": 7
}

Response example

{
"data": {
"saved_id": 4800
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypedescription
errorintError code
error_textstringError text
saved_idintNew campaign ID