Skip to main content

Update trigger campaign

Description

Updates a trigger campaign. Changes campaign settings.

Request URL

Method: POST

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

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"csv"NoResponse data format.
By default – json
idint1YesTrigger campaign ID
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
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)
note

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.

Trigger type parameters

ParameterTypeDescriptionapi_callapi_importactionupdatepixelsubscribe
actionstringAction based trigger typeNoNoYesNoNoNo
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_idintSubscription trigger 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": "abcdefghijklmnqrstuvwxyz",
"id": 42,
"name": "New trigger campaign update",
"content": [
{
"subject": "Maybe not very important message",
"from_email": "",
"from_name": "Alex",
"replyto_email": "",
"replyto_name": "",
"message_id": 8
}
],
"trigger_type": "api_call",
"list_id": 1
}

Response example

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

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
saved_idintTrigger campaign ID
trigger_linkstringTrigger campaign link. Only for trigger_type = "api_call"