Campaigns#

Group activities into campaigns for aggregate reporting.

Authentication required

All endpoints require a Bearer token in the Authorization header. See the Authentication guide for setup instructions.

GET /v1/campaigns#

Retrieve a paginated list of campaigns for an organization.

bash
GET /v1/campaigns?page_index=0&page_size=25&organization_id=1c7743a8-6410-4a9e-9f3b-2c1d5e8a4b01
Authorization: Bearer {token}

Parameters#

NameTypeRequiredDescription
pageIndexintegerRequiredZero-based page index for pagination.
pageSizeintegerRequiredNumber of items per page (1-100).
organizationIdstring (UUID)RequiredOrganization identifier.
searchTermstringFree-text search term to filter results (max 200 characters).
sortBystringColumn name to sort by.
sortDirection'asc' | 'desc'Sort direction: ascending or descending.
status'active' | 'scheduled' | 'completed' | 'draft'Filter by campaign status.
creatorIdstring (UUID)Filter by creator identifier.

Response#

Returns { items, totalCount, facets } with paginated results.

Underlying SDK method: bw.campaigns.list(params)

GET /v1/campaigns/stats#

Aggregate statistics for campaigns matching the given filters.

bash
GET /v1/campaigns/stats?organization_id=1c7743a8-6410-4a9e-9f3b-2c1d5e8a4b01
Authorization: Bearer {token}

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
status'active' | 'scheduled' | 'completed' | 'draft'Filter by campaign status.
creatorIdstring (UUID)Filter by creator identifier.
searchTermstringFree-text search term to filter results (max 200 characters).

Response#

Returns { data } with the result.

Underlying SDK method: bw.campaigns.stats(params)

GET /v1/campaigns/:id#

Retrieve a single campaign by ID with full details.

bash
GET /v1/campaigns/:id
Authorization: Bearer {token}

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredCampaign identifier.

Response#

Returns { data } with the result.

Underlying SDK method: bw.campaigns({ id })

POST /v1/campaigns#

Create a new campaign.

bash
POST /v1/campaigns
Authorization: Bearer {token}
Content-Type: application/json

{
  "organization_id": "1c7743a8-6410-4a9e-9f3b-2c1d5e8a4b01",
  "name": "My Campaign"
}

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
namestringRequiredCampaign name.
startAtstring (ISO 8601) | nullCampaign start date.
endAtstring (ISO 8601) | nullCampaign end date.
budgetnumber | nullTotal campaign budget (non-negative, max 1B).

Response#

Returns { data } with the result.

Underlying SDK method: bw.campaigns.create(params)

PATCH /v1/campaigns/:id#

Update a campaign's details, status, budget, or dates.

bash
PATCH /v1/campaigns/:id
Authorization: Bearer {token}

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredCampaign identifier to update.
namestringUpdated campaign name (1-255 characters).
startAtstring (ISO 8601) | nullUpdated start date.
endAtstring (ISO 8601) | nullUpdated end date.
budgetnumber | nullUpdated budget (non-negative, max 1B).

Response#

Returns { data } with the result.

Underlying SDK method: bw.campaigns.update(params)

DELETE /v1/campaigns/:id#

Permanently delete a campaign and unlink all associated activities.

bash
DELETE /v1/campaigns/:id
Authorization: Bearer {token}

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredCampaign identifier to delete.

Response#

Returns { data } with the result.

Underlying SDK method: bw.campaigns.delete(params)

Destructive action

Deleting a campaign permanently removes the campaign and unlinks all associated activities. This action cannot be undone.

Link an activity to a campaign.

bash
POST /v1/campaigns/:id/activities
Authorization: Bearer {token}
Content-Type: application/json

{
  "campaign_id": "3a8d1f56-9e42-4b7c-a1d8-6f0e2b9c4a03",
  "activity_id": "7f2e9b34-5c81-4d6a-8e07-9a3b1c5d2f02"
}

Parameters#

NameTypeRequiredDescription
campaignIdstring (UUID)RequiredCampaign identifier to link the activity to.
activityIdstring (UUID)RequiredActivity identifier to link.

Response#

Returns { data } with the result.

Underlying SDK method: bw.campaigns.activities.link(params)

Unlink an activity from a campaign.

bash
DELETE /v1/campaigns/:id/activities/:activityId
Authorization: Bearer {token}
Content-Type: application/json

{
  "campaign_activity_id": "2d8b6f43-9a17-4e5c-b7d0-3f9a1c6e8d10"
}

Parameters#

NameTypeRequiredDescription
campaignActivityIdstring (UUID)RequiredCampaign-activity association identifier to remove.

Response#

Returns { data } with the result.

Underlying SDK method: bw.campaigns.activities.unlink(params)