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
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| format | string | "csv" | No | Response data format. By default – json |
| id | int | 1 | Yes | Trigger campaign ID |
| name | string | "New Awesome Campaign" | Yes | New campaign name |
| is_active | bool | true | No | Activates campaign instantly |
| content | JSON array | [
{
"from_email": "",
"from_name": "",
"message_id": 12,
"replyto_email": "",
"replyto_name": "",
"subject": "Weather alert"
}
] | Yes | Message template object |
| subid | string | "Adv_1" | No | Campaign SubID |
| trigger_type | string | "api_call" | Yes | Trigger type |
| skip_minutes | int | 0 | No | Wait for X minutes before sending |
| resource_id | int | 24 | No | resource ID |
| policy_id | int | 1 | No | Sending policy ID |
| push_sending_mode | string | "fanout" (default) "last" | No | Push notification sending mode (push channels only) |
| attributes | object | "season":"summer_2024" | No | Assigned attributes and their values |
| Smart settings | ||||
| virtual_sender_id | int | 12 | No | Virtual sender ID (Smart accounts) |
| is_random_trk_prefix | bool | false | No | Tracking domain random prefix. (Smart accounts) |
| custom_trk_domain | 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 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
| Parameter | Type | Description | api_call | api_import | action | update | pixel | subscribe |
|---|---|---|---|---|---|---|---|---|
| action | string | Action based trigger type | No | No | Yes | No | No | No |
| update_query | JSON array | { | No | No | No | Yes | No | No |
| link_name | string | Message link name | No | No | Yes | No | No | No |
| message_id | int | Template ID | No | No | Yes | No | No | No |
| list_id | int | Database ID | Yes | Yes | No | Yes | No | No |
| subscribe_resource_id | int | Subscription trigger ID | No | No | No | No | No | Yes |
| channel | string | Subscription channel | No | No | No | No | No | Yes |
| is_new_sub | bool | New resource trigger | No | No | No | No | No | Yes |
| is_new_ch | bool | New channel trigger | No | No | No | No | No | Yes |
| is_new_contact | bool | New contact trigger | No | No | No | No | No | Yes |
| is_status_changed | bool | Subscription status change trigger | No | No | No | No | No | Yes |
| trigger_statuses | array(int) | Subscription status change options | No | No | No | No | No | Yes |
| pixel_id | int | Pixel ID | No | No | No | No | Yes | No |
Request example
- JSON
- XML
{
"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
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>42</id>
<name>New trigger campaign 3</name>
<content array='true'>
<from_email/>
<from_name>James</from_name>
<message_id>15</message_id>
<replyto_email/>
<replyto_name/>
<subject>Maybe very important message</subject>
</content>
<trigger_type>api_call</trigger_type>
<list_id>1</list_id>
</xml>
Response example
- JSON
- XML
{
"data": {
"saved_id": 42,
"trigger_link": "http://trk.example.com:8095/trg/3a345a07f01657e7966566e657a34d023a345a07f01802e7/<email|md5|xxh>"
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<data>
<saved_id>42</saved_id>
<trigger_link>http://trk.example.com:8095/trg/3a345a07f01657e7966566e657a34d023a345a07f01802e7/<email|md5|xxh></trigger_link>
</data>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| saved_id | int | Trigger campaign ID |
| trigger_link | string | Trigger campaign link. Only for trigger_type = "api_call" |