Activities#

Work with creator content activities using the Brandwave TypeScript SDK.

Provider required

All hooks require a BrandwaveProvider ancestor in your component tree. See the React Hooks overview for setup instructions.

useListActivities#

Retrieve a paginated list of activities for an organization.

typescript
import { useListActivities } from '@brandwave/react';

const { data, isLoading } = useListActivities({
  pageIndex: 0,
  pageSize: 25,
  organizationId: 'org_123',
});

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.
channel'instagram' | 'youtube' | 'tiktok' | 'twitter' | 'linkedin' | 'reddit'Filter by social media platform.
creatorIdstring (UUID)Filter by creator identifier.
campaignIdstring (UUID)Filter by campaign identifier.

Response#

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

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

useCountActivities#

Get the total number of activities matching the given filters.

typescript
import { useCountActivities } from '@brandwave/react';

const { data, isLoading } = useCountActivities({
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
channel'instagram' | 'youtube' | 'tiktok' | 'twitter' | 'linkedin' | 'reddit'Filter by social media platform.
creatorIdstring (UUID)Filter by creator identifier.
campaignIdstring (UUID)Filter by campaign identifier.

Response#

Returns { count } with the total number of matching records.

Underlying SDK method: bw.activities.count(params)

useActivityStats#

Aggregate statistics for activities matching the given filters.

typescript
import { useActivityStats } from '@brandwave/react';

const { data, isLoading } = useActivityStats({
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
channel'instagram' | 'youtube' | 'tiktok' | 'twitter' | 'linkedin' | 'reddit'Filter by social media platform.
creatorIdstring (UUID)Filter by creator identifier.
campaignIdstring (UUID)Filter by campaign identifier.
searchTermstringFree-text search term to filter results (max 200 characters).

Response#

Returns { data } with the result.

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

useCreateActivity#

Create a new activity with optional creator auto-linking.

typescript
import { useCreateActivity } from '@brandwave/react';

const { mutate, isPending } = useCreateActivity();

mutate({
  organizationId: 'org_123',
  channel: 'instagram',
  activity: '...',
  name: 'My Campaign',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
channel'instagram' | 'youtube' | 'tiktok' | 'twitter' | 'linkedin' | 'reddit'RequiredSocial media platform for this activity.
activity'instagram_story' | 'instagram_post' | 'instagram_reel' | 'youtube_video' | 'youtube_short' | 'tiktok_video' | 'twitter_post' | 'linkedin_post' | 'reddit_post'RequiredSpecific content type within a platform.
namestringRequiredActivity name or title (max 500 characters).
startAtstring (ISO 8601) | nullWhen the activity was published or started.
endAtstring (ISO 8601) | nullWhen the activity ended (e.g., story expiry).
creatorIdstring (UUID)Creator to auto-link to this activity.

Response#

Returns { data } with the result.

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

useUpdateActivity#

Update an activity's details, social media channel, content link, or metrics.

typescript
import { useUpdateActivity } from '@brandwave/react';

const { mutate, isPending } = useUpdateActivity();

mutate({
  id: 'abc-123',
  name: 'My Campaign',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredActivity identifier to update.
channel'instagram' | 'youtube' | 'tiktok' | 'twitter' | 'linkedin' | 'reddit'Updated social media platform.
activity'instagram_story' | 'instagram_post' | 'instagram_reel' | 'youtube_video' | 'youtube_short' | 'tiktok_video' | 'twitter_post' | 'linkedin_post' | 'reddit_post'Updated content type.
namestringRequiredUpdated activity name (max 500 characters).
startAtstring (ISO 8601) | nullUpdated start date.
endAtstring (ISO 8601) | nullUpdated end date.
contentHrefstring (URL) | nullURL to the original content (max 2,048 characters).
viewsCountinteger | nullManual view count override (non-negative integer).
likeCountinteger | nullManual like count override (non-negative integer).
replyCountinteger | nullManual reply count override (non-negative integer).

Response#

Returns { data } with the result.

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

Content link changes reset metrics

Changing the contentLink triggers a metric refresh. Previous metric snapshots are preserved but the latest values will update.

useDeleteActivity#

Permanently delete an activity and its associated records.

typescript
import { useDeleteActivity } from '@brandwave/react';

const { mutate, isPending } = useDeleteActivity();

mutate({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredActivity identifier to delete.

Response#

Returns { data } with the result.

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

Destructive action

Deleting an activity permanently removes all linked metrics, costs, creator associations, and notes. This action cannot be undone.

Connect a social media post URL to an activity for automatic metric tracking.

typescript
import { useConnectActivityContentLink } from '@brandwave/react';

const { mutate, isPending } = useConnectActivityContentLink();

mutate({
  activityId: 'act_abc123',
  platform: 'instagram',
  contentUrl: '...',
});

Parameters#

NameTypeRequiredDescription
activityIdstring (UUID)RequiredActivity identifier to connect the content link to.
platform'instagram' | 'youtube' | 'tiktok' | 'twitter' | 'linkedin' | 'reddit'RequiredSocial media platform for this content.
contentUrlstringRequiredURL to the social media content (max 2,048 characters).

Response#

Returns { data } with the result.

Underlying SDK method: bw.activities.contentLink.connect(params)

Metric refresh

Connecting a content link triggers an immediate metric fetch for the linked post.

Disconnect a content link from an activity, stopping automatic metric tracking.

typescript
import { useDisconnectActivityContentLink } from '@brandwave/react';

const { mutate, isPending } = useDisconnectActivityContentLink();

mutate({
  activityId: 'act_abc123',
});

Parameters#

NameTypeRequiredDescription
activityIdstring (UUID)RequiredActivity identifier to disconnect the content link from.

Response#

Returns { data } with the result.

Underlying SDK method: bw.activities.contentLink.disconnect(params)

useListActivityCreators#

List creators linked to an activity with pagination.

typescript
import { useListActivityCreators } from '@brandwave/react';

const { data, isLoading } = useListActivityCreators({
  pageIndex: 0,
  pageSize: 25,
  organizationId: 'org_123',
  activityId: 'act_abc123',
});

Parameters#

NameTypeRequiredDescription
pageIndexintegerRequiredZero-based page index for pagination.
pageSizeintegerRequiredNumber of items per page (1-100).
organizationIdstring (UUID)RequiredOrganization identifier.
activityIdstring (UUID)RequiredActivity identifier to list creators for.

Response#

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

Underlying SDK method: bw.activities.creators.list(params)

useCountActivityCreators#

Count the number of creators linked to an activity.

typescript
import { useCountActivityCreators } from '@brandwave/react';

const { data, isLoading } = useCountActivityCreators({
  organizationId: 'org_123',
  activityId: 'act_abc123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
activityIdstring (UUID)RequiredActivity identifier to count creators for.

Response#

Returns { count } with the total number of matching records.

Underlying SDK method: bw.activities.creators.count(params)

Associate a creator with an activity.

typescript
import { useLinkActivityCreator } from '@brandwave/react';

const { mutate, isPending } = useLinkActivityCreator();

mutate({
  activityId: 'act_abc123',
  creatorId: 'con_abc123',
});

Parameters#

NameTypeRequiredDescription
activityIdstring (UUID)RequiredActivity identifier to link.
creatorIdstring (UUID)RequiredCreator identifier to link.

Response#

Returns { data } with the result.

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

Remove a creator association from an activity.

typescript
import { useUnlinkActivityCreator } from '@brandwave/react';

const { mutate, isPending } = useUnlinkActivityCreator();

mutate({
  activityId: 'act_abc123',
  creatorId: 'con_abc123',
});

Parameters#

NameTypeRequiredDescription
activityIdstring (UUID)RequiredActivity identifier to unlink from.
creatorIdstring (UUID)RequiredCreator identifier to unlink.

Response#

Returns { data } with the result.

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

Cascading deletion

Unlinking a creator removes all cost records associated with that creator on this activity.

useCreateActivityCost#

Add a cost line item to an activity with amount and currency code.

typescript
import { useCreateActivityCost } from '@brandwave/react';

const { mutate, isPending } = useCreateActivityCost();

mutate({
  activityId: 'act_abc123',
  amount: 150.00,
  type: 'instagram_post',
  currency: '...',
});

Parameters#

NameTypeRequiredDescription
activityIdstring (UUID)RequiredActivity identifier to add the cost to.
amountnumberRequiredCost amount (must be greater than zero, max 100M).
typestringRequiredCost type label, e.g. "creator_fee", "production" (max 100 characters).
currencystringRequiredISO 4217 currency code, e.g. "USD", "NZD" (exactly 3 characters).
descriptionstring | nullOptional description of this cost line item (max 1,000 characters).
creatorIdstring (UUID) | nullCreator this cost is attributed to.

Response#

Returns { data } with the result.

Underlying SDK method: bw.activities.costs.create(params)

Auto-linking

If the activity has exactly one linked creator, the cost is automatically attributed to that creator.

useUpdateActivityCost#

Update a cost line item on an activity, including creator attribution.

typescript
import { useUpdateActivityCost } from '@brandwave/react';

const { mutate, isPending } = useUpdateActivityCost();

mutate({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredCost record identifier to update.
amountnumberUpdated cost amount (must be greater than zero, max 100M).
typestringUpdated cost type label (max 100 characters).
descriptionstring | nullUpdated description (max 1,000 characters).
creatorIdstring (UUID) | nullUpdated creator attribution.

Response#

Returns { data } with the result.

Underlying SDK method: bw.activities.costs.update(params)

useDeleteActivityCost#

Remove a cost line item from an activity.

typescript
import { useDeleteActivityCost } from '@brandwave/react';

const { mutate, isPending } = useDeleteActivityCost();

mutate({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredCost record identifier to delete.

Response#

Returns { data } with the result.

Underlying SDK method: bw.activities.costs.delete(params)

useMetricConfidence#

Assess the statistical confidence of an activity's metrics.

typescript
import { useMetricConfidence } from '@brandwave/react';

const { data, isLoading } = useMetricConfidence({
  organizationId: 'org_123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
startDatestring | nullStart date for confidence calculation window.
endDatestring | nullEnd date for confidence calculation window.

Response#

Returns { data } with the result.

Underlying SDK method: bw.activities.metrics.confidence(params)

useListSparklines#

Fetch sparkline chart data for one or more activities.

typescript
import { useListSparklines } from '@brandwave/react';

const { data, isLoading } = useListSparklines({
  activityIds: '...',
});

Parameters#

NameTypeRequiredDescription
activityIdsArray<string (UUID)>RequiredArray of activity identifiers to fetch sparkline data for.

Response#

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

Underlying SDK method: bw.activities.sparklines.list(params)

useActivity#

Retrieve a single activity by ID with full details.

typescript
import { useActivity } from '@brandwave/react';

const { data, isLoading } = useActivity({
  id: 'abc-123',
});

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredActivity identifier.

Response#

Returns { data } with the result.

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