Notes#

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

List notes#

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

typescript
const { items, totalCount, facets } = await bw.notes.list({
  organizationId: '1c7743a8-6410-4a9e-9f3b-2c1d5e8a4b01',
  entityType: 'activity',
  entityId: '7f2e9b34-5c81-4d6a-8e07-9a3b1c5d2f02',
});

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.

Scoping required

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

Get note#

Retrieve a single note by ID.

typescript
const { data } = await bw.notes({ id: 'e2d4a6b8-0c1f-4e3a-95d7-8b6c4a2e0f06' });

Parameters#

NameTypeRequiredDescription
idstring (UUID)RequiredNote identifier.

Response#

Returns { data } with the result.

Create note#

Create a new note attached to an entity.

typescript
const { data } = await bw.notes.create({
  organizationId: '1c7743a8-6410-4a9e-9f3b-2c1d5e8a4b01',
  entityType: 'activity',
  entityId: '7f2e9b34-5c81-4d6a-8e07-9a3b1c5d2f02',
  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.

Update note#

Update a note's content.

typescript
const { data } = await bw.notes.update({
  noteId: '5e1a8c92-7b34-4d0f-9c6a-2e8b4f7d0a05',
  content: 'Note content here.',
});

Parameters#

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

Response#

Returns { data } with the result.

Delete note#

Delete a note and remove it from its parent entity.

typescript
const { data } = await bw.notes.delete({
  noteId: '5e1a8c92-7b34-4d0f-9c6a-2e8b4f7d0a05',
});

Parameters#

NameTypeRequiredDescription
noteIdstring (UUID)RequiredNote identifier to delete.

Response#

Returns { data } with the result.