Notes#

Create, read, update, and delete notes attached to activities, campaigns, or creators.

Provider required

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

useListNotes#

List notes for an entity, ordered by most recent first.

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

const { data, isLoading } = useListNotes({
  organizationId: 'org_123',
  entityType: 'activity',
  entityId: 'act_abc123',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
entityType'activity' | 'campaign' | 'creator'RequiredType of entity to list notes for.
entityIdstring (UUID)RequiredEntity identifier to list notes for.

Response#

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

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

Scoping required

You must pass entityType ('activity', 'campaign', or 'creator') and entityId to scope the list.

useNote#

Retrieve a single note by ID.

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

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

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredNote identifier.

Response#

Returns { data } with the result.

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

useCreateNote#

Create a new note attached to an entity.

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

const { mutate, isPending } = useCreateNote();

mutate({
  organizationId: 'org_123',
  entityType: 'activity',
  entityId: 'act_abc123',
  content: 'Note content here.',
});

Parameters#

NameTypeRequiredDescription
organizationIdstring (UUID)RequiredOrganization identifier.
entityType'activity' | 'campaign' | 'creator'RequiredType of entity to attach the note to.
entityIdstring (UUID)RequiredEntity identifier to attach the note to.
contentstringRequiredNote content (plain text or markdown).
createdBystring (UUID) | nullUser identifier who created the note.
createdByNamestringDisplay name of the note creator (max 255 characters).

Response#

Returns { data } with the result.

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

useUpdateNote#

Update a note's content.

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

const { mutate, isPending } = useUpdateNote();

mutate({
  noteId: 'note_abc123',
  content: 'Note content here.',
});

Parameters#

NameTypeRequiredDescription
noteIdstring (UUID)RequiredNote identifier to update.
contentstringRequiredUpdated note content.

Response#

Returns { data } with the result.

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

useDeleteNote#

Delete a note and remove it from its parent entity.

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

const { mutate, isPending } = useDeleteNote();

mutate({
  noteId: 'note_abc123',
});

Parameters#

NameTypeRequiredDescription
noteIdstring (UUID)RequiredNote identifier to delete.

Response#

Returns { data } with the result.

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