Skip to main content

Task for bulk trigger launch

Description

Launches a trigger campaign for multiple profiles.

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

Returns a response with the task id, without waiting for completion.

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_task

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format
By default – "json"
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
{
"_fname": "John",
"_lname": "Doe"
}
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 subscriptions
Profile matching mode.

By default - email

Learn more.
emailstring"john@example.com""matching":"email" - both profile data and subscriptions
"matching":"email_profile" - profile data only

"matching":"email_sub" - subscription data only
Email address
phonestring"+79000000000""matching":"phone" - by phone number from profile or subscriptions

"matching":"phone_sub" - by phone number from subscriptions
Phone number
profile_idstring"abcdefghijklmnqrstuvwxyz""matching":"profile_id"Profile ID
field_namestring"matching":"custom"Name of the custom profile data field
field_value"matching":"custom"Value of the custom profile data field
custom_requestJSON object
{
"email": {
"$in": [
"asd@dsfsd.com",
"zxcv@sdfsd.com"
]
}
}
When no matching
specified
Custom MongoDB database query

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
task_idstringTask ID

Request example (matching by email)

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

Request example (matching by custom field)

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

Response example

{
"error": 0,
"error_text": "Successful operation",
"task_id": "30421978-7f6d-4f39-913f-fb6cad8e2477"
}

Response example when a request constraint is triggered

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