Skip to main content

Create trigger campaign

Description

Creates a new trigger campaign.

Request URL

Method: POST

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

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"csv"NoResponse data format.
By default – json
namestring"New Awesome Campaign"YesNew campaign name
is_activebooltrueNoActivates campaign instantly
contentJSON array
[
   {
      "from_email": "",
      "from_name": "",
      "message_id": 12,
      "replyto_email": "",
      "replyto_name": "",
      "subject": "Weather alert"
   }
]
YesMessage template object
subidstring"Adv_1"NoCampaign SubID
trigger_typestring"api_call"YesTrigger type
skip_minutesint0NoWait for X minutes before sending
resource_idint24Noresource ID
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_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.
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.
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_trk_prefixboolfalseNoTracking domain random prefix.
(Smart accounts)
custom_trk_domainJSON array["trk.example.com", "trk2.example.com"]NoTracking domains list
(Smart accounts)
blind_carbon_copyJSON array["john@example.com", "george@example.com"]NoHidden copy email addresses
(Smart accounts)
unconditional_sendingbooltrueNoSend messages ignoring subscription status
(Smart accounts)
info

Unconditional sending is available only for On-premise and Off-premise licensed instances. To activate it add "unc_campaign" to EXTRAS object of main.json configuration file.

Trigger type parameters

ParameterTypeDescriptionapi_callapi_importactionupdatepixelsubscribe
actionstringAction based triggerNoNoYesNoNoNo
update_queryJSON array
{ 
"fieldname": "custom_ID",
"fieldtype": "int",
"operator": "equal",
"value": "2000"
}
NoNoNoYesNoNo
link_namestringMessage link nameNoNoYesNoNoNo
message_idintTemplate IDNoNoYesNoNoNo
list_idintDatabase IDYesYesNoYesNoNo
subscribe_resource_idintResource IDNoNoNoNoNoYes
channelstringSubscription channelNoNoNoNoNoYes
is_new_subboolNew resource triggerNoNoNoNoNoYes
is_new_chboolNew channel triggerNoNoNoNoNoYes
is_new_contactboolNew contact triggerNoNoNoNoNoYes
is_status_changedboolSubscription status change triggerNoNoNoNoNoYes
trigger_statusesarray(int)Subscription status change optionsNoNoNoNoNoYes
pixel_idintPixel IDNoNoNoNoYesNo

Request example

{
"token": "e94ce55afc8e4e07bd64afb4427f8a5c",
"name": "New trigger campaign 3",
"content":
[
{
"subject": "Maybe very important message",
"from_email": "",
"from_name": "James",
"replyto_email": "",
"replyto_name": "",
"message_id": 8
}
],
"trigger_type": "api_call",
"send_channel": "email",
"list_id": 1

}

Response example

{
"data": {
"saved_id": 42,
"trigger_link": "http://trk.example.com:8095/trg/3a345a07f01802e7966599e657a34d023a345a07f01802e7/<email|md5|xxh>"
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
saved_idintNew trigger campaign ID
trigger_linkstringtrigger link. Only for trigger_type = "api_call"