Costs#
Read-only access to cost records across activities for reporting and analysis.
List costs#
List cost records across activities, including creator details.
typescript
const { items, totalCount, facets } = await bw.costs.list({
pageIndex: 0,
pageSize: 25,
organizationId: 'org_123',
});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. |
| activityId | string (UUID) | — | Filter by activity identifier. |
| creatorId | string (UUID) | — | Filter by creator identifier. |
| campaignId | string (UUID) | — | Filter by campaign identifier. |
Response#
Returns { items, totalCount, facets } with paginated results.
Count costs#
Count cost records with optional activity and creator filters.
typescript
const { count } = await bw.costs.count({
organizationId: 'org_123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| activityId | string (UUID) | — | Filter by activity identifier. |
| creatorId | string (UUID) | — | Filter by creator identifier. |
| campaignId | string (UUID) | — | Filter by campaign identifier. |
Response#
Returns { count } with the total number of matching records.
List cost types#
Retrieve distinct cost type labels used across the organization.
typescript
const { items, totalCount, facets } = await bw.costs.types.list({
pageIndex: 0,
pageSize: 25,
organizationId: 'org_123',
});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. |
Response#
Returns { items, totalCount, facets } with paginated results.
Autocomplete
Use this endpoint to populate autocomplete suggestions when creating or editing cost records.