Send an API-triggered broadcast
Trigger a broadcast (not a newsletter) and optionally provide data to populate liquid placeholders in the message.
The shape of the request depends on how you define your audience: default (the recipients set in the UI), custom filter conditions, a list of emails, a list of customer IDs, a map of users, or a data file.
You can only trigger broadcasts to send to people you've already added to your workspace. A broadcast cannot add or identify new people. If you reference people who don't exist in your broadcast audience, the broadcast will fail by default. You can override this behavior by setting the email_ignore_missing and/or id_ignore_missing flags to true. The broadcast will skip over any people who don't exist in your workspace and send to the remaining recipients.
You can reference properties in the data object in your broadcast using liquid—{{trigger.<property_in_data_obj>}}.
If your broadcast produces a 422 error, you can get more information about the errors to see what went wrong.
This endpoint is rate-limited to one request every 10 seconds. After exceeding this, you'll receive a status of 429. Learn more about API-triggered broadcast limits above.
Broadcasts are optimized to send messages to a large audience and not for one-to-one interactions. Use our transactional API or event-triggered campaigns to respond to your audience on an individual, one-to-one basis.
- Type: integerbroadcast
_id requiredThe ID of the broadcast that you want to trigger.
Send your broadcast to the default set of recipients defined in the UI.
- Type: objectdata
Contains information you want to use to populate your broadcast.
- Type: booleanemail
_add _duplicates an email address associated with more than one profile id is an error.
- Type: booleanemail
_ignore _missing If false, a missing email causes the broadcast to error and fail. If true, the broadcast will skip over any people in your audience who don't have emails, and continue sending to the rest of your audience.
- Type: booleanid
_ignore _missing If false, a missing customer ID causes the broadcast to error and fail. If true, the broadcast will skip over any people in your audience who don't have IDs, and continue sending to the rest of your audience.
- application/json
- 401
Unauthorized request. Make sure that you provided the right credentials.
- 404
The
broadcast_iddoes not exist. - application/json
curl https://api.customer.io/v1/campaigns/1/triggers \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"data": {
"headline": "Roadrunner spotted in Albuquerque!",
"date": 1511315635,
"text": "We received reports of a roadrunner in your immediate area! Head to your dashboard to view more information!"
},
"email_add_duplicates": false,
"email_ignore_missing": false,
"id_ignore_missing": false
}'
{
"id": 3
}A successful request returns the trigger ID.