Skip to main content

Bulk trigger launch

Description

Launches a trigger campaign for multiple profiles.

This request is a batch version of the Trigger Launch (API call) request.

note

The request body size is limited by default to 10 Mb, exception for files — 100 Mb.

URL request

Method: POST

http://example.com/api/v1.1/campaigns/triggers/start_batch

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format.
By default – json
trigger_idint1YesTrigger campaign ID
attachJSON array of File object[]NoFile object
contentJSON object

{    "H1": "Weather alert",    "H2": "Welcome" }

NoData you can use in a message template using {apicontent.fieldname} variable
custom_dataJSON object
{
"field": "value"
}
NoData used for integration Action hooks
dataarray

[    {"email": "profile1@example.com"},    {"email": "profile2@example.com"} ]

YesA field in the database and its value, which will be used to search for the desired profile.
Profile matching mode
matchingstring

"email"
"email_profile"
"email_sub"
"phone"
"phone_sub"
"profile_id"
"push_sub"
"custom"
"custom_sub"
"email_phone"
"email_phone_sub"

No, if matched by email from profile or subscriptionsProfile matching mode
By default - email
Learn more.

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
resultarrayProfile IDs to which the campaign was sent

Request example (matching by email)

{
"token": "abcdefghijklmnqrstuvwxyz",
"trigger_id": 8,
"format": "json",
"matching": "email",
"data": [
{
"email": "example1@example.com"
},
{
"email": "example2@example.com"
}
]
}

Request example (matching by custom field)

{
"token": "abcdefghijklmnqrstuvwxyz",
"trigger_id": 96,
"format": "json",
"skip_triggers": false,
"matching": "custom",
"field_name": "Custom_ID",
"data": [
{
"field_value": "003"
},
{
"field_value": "002"
}
]
}

Response example

{
"error": 0,
"error_text": "Successful operation",
"result": [
{
"profile_id": "6606e08f10bcdd88297057a7"
},
{
"profile_id": "66101437dc4594c2934da6da"
}
]
}

Response example when a request constraint is triggered

{
"error":400,
"error_debug":"http: request body too large",
"error_text":"Invalid request"
}