Bulk trigger campaigns

Use this endpoint to trigger multiple campaigns.

API at a glance

Description: This API allows you to trigger campaigns in bulk. You can trigger the same campaign for multiple users or different campaigns for different users in a single API call.

🚧

Note

The endpoint works for campaigns that are set to trigger using an API call.

Authentication & testing

Testing the API on this page

How to try it here

  • Use your User API Key as the Username (leave Password blank).
  • User API Key Location
  • Select the appropriate API endpoint based on your Blueshift region.
  • API - Select Region
  • Enter the necessary parameters and click Try It to run the request.
Authentication using Base64 encoding

Note for developers

API requests require authentication using HTTP Basic Authentication with an API key. The API key serves as the username, while the password field should be left empty. The format to encode is: your_api_key: (note the trailing colon).

This string must be Base64-encoded and included in the request's Authorization header as follows:

Authorization: Basic encoded_value

You can generate the encoded value using a trusted Base64 encoder.


Postman collection

Try it with Postman: Explore the API using Blueshift's Postman collection.


Things to know before you start

  • Batch processing: This API is designed for high-volume campaign triggers.
  • Idempotency: Use the transaction_uuid field to prevent duplicate messages. If a request with the same transaction_uuid is received, the system returns a 200 status code along with a message noting the request was already processed.
  • Priority processing: Set _bsft_high_priority to true for time-sensitive campaigns. Blueshift processes all high-priority campaigns first (FIFO), followed by standard campaigns (FIFO).
  • Email attachments: You can include file attachments by providing URLs in the email_attachments array.
  • Campaign UUID: You can copy the campaign UUID from the URL of the campaign on the Blueshift app. For example, if you open a campaign in the Blueshift app, its URL looks like https://app.getblueshift.com/dashboard#/app/campaigns/<CAMPAIGN_UUID>/details.
  • Use case: Best for batch processing transactional emails, daily digests, or system alerts where multiple campaign triggers need to be sent at once.
👍

Finding the campaign UUID

The campaign UUID is visible in the browser's address bar when you open a campaign. For example: https://app.getblueshift.com/dashboard#/app/campaigns/<CAMPAIGN_UUID>/edit_v3/journey

Request parameters

Check out the request parameters

Body parameters

ParameterTypeRequiredDescription
payloadsarray✅ YesAn array of objects, where each object contains the details for a specific campaign trigger.

Payloads object

Note: These parameters apply to each object inside the payloads array.

Parameter

Type

Required

Description

email

string

✅ Yes

The email address of the user for whom you want to trigger the campaign.

campaign_uuid

string

✅ Yes

The UUID of the campaign to be triggered.

transaction_uuid

string

❌ No

A unique UUID (must be well-formed UUID v4) to prevent duplicate messages. The API returns a 200 status code for duplicate requests along with a message noting the request was already processed.

_bsft_high_priority

boolean

❌ No

Set to true to process this as a high-priority campaign. Blueshift processes all high-priority campaigns first (FIFO), followed by standard campaigns (FIFO).

  • Default: false.

email_attachments

array

❌ No

An array of file URLs to send as attachments with the email.

  • Example: ["https://cdn.example.com/file1.pdf"]

Example requests & responses

Bulk trigger multiple campaigns

Request

{
  "payloads": [
    {
      "email": "[email protected]",
      "campaign_uuid": "857ad5a5-1cd1-4c8a-bd9b-b2cdbb6595cc",
      "email_attachments": [
        "https://cdn.getblueshift.com/examples/sample.pdf"
      ],
      "_bsft_high_priority": true
    },
    {
      "email": "[email protected]",
      "campaign_uuid": "a0d1a0f3-6596-4e1c-b487-3639e05b6d2f",
      "transaction_uuid": "123e4567-e89b-12d3-a456-426614174000"
    }
  ]
}

Response

[
  {
    "success": true
  },
  {
    "success": true
  }
]
API error responses

Note
The following error codes are commonly returned by Blueshift APIs. Depending on the specific endpoint, not all may apply.

Status code

Description

Example responses

400 Bad Request

The request is invalid due to missing or incorrect parameters. This includes missing fields, invalid values, formatting issues, or conflicts such as duplicate data.

{ "errors": { "name": ["can't be blank"] } }

{ "errors": { "startdate": ["can't be blank"] } }

401 Unauthorized

API authentication failed due to an invalid or missing API key.

{ "message": "Not authorized" }

403 Forbidden

The API key does not have sufficient permissions to perform this action.

{ "message": "Permission denied" }

404 Not Found

The specified campaign was not found. Verify the campaign UUID.

{ "message": "Campaign not found" }

422 Unprocessable Entity

  • The campaign cannot be paused due to its current status (e.g., already completed or archived).
  • One or more scheduling parameters may be invalid (if applicable).

{ "message": "Campaign cannot be paused in its current status." }

{ "message": "Invalid schedule values" }

429 Too Many Requests

The request limit has been exceeded. Reduce request frequency.

{ "message": "Rate limit exceeded" }

500 Internal Server Error

An unexpected server error occurred. Contact support if the issue persists.

{ "message": "Internal Server Error - Please contact support for more information." }

502 Bad Gateway

The server received an invalid response. Retry the request.

{ "message": "Bad Gateway - Please retry the request." }

503 Service Unavailable

The service is temporarily unavailable. Try again later.

{ "message": "Service Unavailable - The service is temporarily unavailable. Try again later." }

504 Gateway Timeout

The server took too long to respond. Retry the request with exponential backoff.

{ "message": "Gateway Timeout - The server took too long to respond. Retry with exponential backoff." }

Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!