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=org_123
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=org_123
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": "org_123",
  "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": "camp_abc123",
  "activity_id": "act_abc123"
}

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": "ca_abc123"
}

Parameters#

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

Response#

Returns { data } with the result.

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