Campaigns#
Group activities into campaigns for aggregate reporting.
Authentication required
Authorization header. See the Authentication guide for setup instructions.GET /v1/campaigns#
Retrieve a paginated list of campaigns for an organization.
GET /v1/campaigns?page_index=0&page_size=25&organization_id=org_123
Authorization: Bearer {token}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| pageIndex | integer | Required | Zero-based page index for pagination. |
| pageSize | integer | Required | Number of items per page (1-100). |
| organizationId | string (UUID) | Required | Organization identifier. |
| searchTerm | string | — | Free-text search term to filter results (max 200 characters). |
| sortBy | string | — | Column name to sort by. |
| sortDirection | 'asc' | 'desc' | — | Sort direction: ascending or descending. |
| status | 'active' | 'scheduled' | 'completed' | 'draft' | — | Filter by campaign status. |
| creatorId | string (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.
GET /v1/campaigns/stats?organization_id=org_123
Authorization: Bearer {token}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| status | 'active' | 'scheduled' | 'completed' | 'draft' | — | Filter by campaign status. |
| creatorId | string (UUID) | — | Filter by creator identifier. |
| searchTerm | string | — | Free-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.
GET /v1/campaigns/:id
Authorization: Bearer {token}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Campaign identifier. |
Response#
Returns { data } with the result.
Underlying SDK method: bw.campaigns({ id })
POST /v1/campaigns#
Create a new campaign.
POST /v1/campaigns
Authorization: Bearer {token}
Content-Type: application/json
{
"organization_id": "org_123",
"name": "My Campaign"
}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| name | string | Required | Campaign name. |
| startAt | string (ISO 8601) | null | — | Campaign start date. |
| endAt | string (ISO 8601) | null | — | Campaign end date. |
| budget | number | null | — | Total 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.
PATCH /v1/campaigns/:id
Authorization: Bearer {token}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Campaign identifier to update. |
| name | string | — | Updated campaign name (1-255 characters). |
| startAt | string (ISO 8601) | null | — | Updated start date. |
| endAt | string (ISO 8601) | null | — | Updated end date. |
| budget | number | null | — | Updated 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.
DELETE /v1/campaigns/:id
Authorization: Bearer {token}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Campaign identifier to delete. |
Response#
Returns { data } with the result.
Underlying SDK method: bw.campaigns.delete(params)
Destructive action
POST /v1/campaigns/:id/activities#
Link an activity to a campaign.
POST /v1/campaigns/:id/activities
Authorization: Bearer {token}
Content-Type: application/json
{
"campaign_id": "camp_abc123",
"activity_id": "act_abc123"
}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| campaignId | string (UUID) | Required | Campaign identifier to link the activity to. |
| activityId | string (UUID) | Required | Activity identifier to link. |
Response#
Returns { data } with the result.
Underlying SDK method: bw.campaigns.activities.link(params)
DELETE /v1/campaigns/:id/activities/:activityId#
Unlink an activity from a campaign.
DELETE /v1/campaigns/:id/activities/:activityId
Authorization: Bearer {token}
Content-Type: application/json
{
"campaign_activity_id": "ca_abc123"
}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| campaignActivityId | string (UUID) | Required | Campaign-activity association identifier to remove. |
Response#
Returns { data } with the result.
Underlying SDK method: bw.campaigns.activities.unlink(params)