Skip to main content
The Campaigns API lets you programmatically manage the audience and message delivery of evergreen (continuous) campaigns in your BluBash workspace. You can add contacts individually or in bulk with per-contact scheduling, cancel queued messages before they are sent, and inspect message status at any point in the delivery lifecycle.
The Campaigns feature must be enabled on your workspace subscription to use the write endpoints. Read endpoints (list and get messages) may work even without the feature enabled. If you attempt a write operation without the feature, you will receive a 403 Forbidden response.

Base URL

Authentication

All requests require your Workspace API Key in the X-API-Key header.
To obtain your API key, go to Settings → API Keys in your workspace admin panel.

Prerequisites

Evergreen campaigns must be created and configured in the BluBash platform before you can use this API. The API covers audience ingestion and message dispatch only.
1

Create an evergreen campaign in the platform

In the BluBash admin panel, create a new campaign with kind = EVERGREEN.
2

Configure channel, message, and rate limits

Set up the channel, message template, and rate limit rules for the campaign.
3

Copy the campaignId

Save the campaign and copy the campaignId shown in the platform. You will use this ID in every API call below.

Add contacts to audience

Adds one or more contacts to a campaign and defines the send schedule per contact. Each entry in the items array represents one contact and its scheduling configuration.
To add a single contact, send the items array with one element — the endpoint is the same for both single and batch operations.

Request body

string
An IANA timezone name (e.g. America/New_York) applied to all items whose datetime has no UTC offset and no schedule.timezone specified.
array
required
An array of contact + schedule objects. At least one item is required.

Contact resolution

When you provide identifier instead of contact_id, the platform resolves the contact in this order:
  1. Looks up the contact by the channel identifier (e.g. normalized WhatsApp number).
  2. If not found and email is provided, searches by email (case-insensitive).
    • If found without a channel identifier, links the identifier to the contact.
    • If found with a different channel identifier, returns a 400 error to prevent silent identity merging.
  3. If still not found, creates a new contact using name, email, and identifier.

Scheduling rules

If datetime has no UTC offset and no timezone is provided (either in schedule.timezone or default_schedule_timezone), the request returns a 400 error.

Example request

Response fields

array
required
One entry per input item, in the same order as the request.

Example response


Cancel a queued message

Cancels the delivery of a specific campaign message that is still in the queue. Cancelling one message does not affect any other messages in the campaign.
Only messages with status QUEUED can be cancelled. Messages that are already SENDING, SENT, or FAILED cannot be cancelled.

Response


List campaign messages

Returns a paginated list of messages for the campaign, each with its current status.

Query parameters

number
default:"50"
Number of results to return per page.
number
default:"0"
Number of results to skip for pagination.

Get a specific message

Returns the details and current status of a single campaign message.

Message statuses


1

Configure the campaign in the platform

Create an evergreen campaign in the BluBash admin panel and copy the campaignId.
2

Add contacts to the audience

Call POST /api/v1/campaigns/:campaignId/audience with your items array.
3

Choose a schedule per contact

Use schedule.type = immediate for instant delivery, or schedule.type = absolute with a datetime for scheduled delivery.
4

Cancel if needed

If you need to stop a queued message, call POST /api/v1/campaigns/:campaignId/messages/:messageId/cancel.
5

Monitor message status

Use GET /api/v1/campaigns/:campaignId/messages to inspect delivery status across the campaign.

Code examples


Error reference