Organizations#
Manage organizations, team members, invitations, and organization-level settings.
List organizations#
List organizations the current user belongs to, with membership details.
const { items, totalCount, facets } = await bw.organizations.list({
pageIndex: 0,
pageSize: 25,
userId: 'user_abc123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| pageIndex | integer | Required | Zero-based page index for pagination. |
| pageSize | integer | Required | Number of items per page (1-100). |
| userId | string (UUID) | Required | User identifier to list organizations for. |
Response#
Returns { items, totalCount, facets } with paginated results.
Get organization#
Retrieve a single organization by ID.
const { data } = await bw.organizations.get({ id: 'abc-123' });Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Organization identifier. |
Response#
Returns { data } with the result.
Create organization#
Create an organization with a name, timezone, and currency, then assign the requesting user as owner.
const { data } = await bw.organizations.create({
userId: 'user_abc123',
name: 'My Campaign',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| userId | string (UUID) | Required | User identifier of the organization owner. |
| name | string | Required | Organization name. |
| ianaTimezone | 'UTC' | 'America/New_York' | 'America/Chicago' | 'America/Denver' | 'America/Los_Angeles' | 'America/Anchorage' | 'Pacific/Honolulu' | 'America/Toronto' | 'America/Vancouver' | 'Europe/London' | 'Europe/Paris' | 'Europe/Berlin' | 'Australia/Sydney' | 'Australia/Melbourne' | 'Pacific/Auckland' | 'Asia/Tokyo' | 'Asia/Singapore' | null | — | IANA timezone identifier. |
| currency | 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD' | 'NZD' | 'JPY' | 'SGD' | — | ISO 4217 currency code. |
Response#
Returns { data } with the result.
Complete organic signup#
Create a first-time organic signup workspace using the submitted organization name, timezone, and currency, then join the default demo org as a viewer and switch the active organization to the demo workspace.
const { data } = await bw.organizations.completeOrganicSignup({
userId: 'user_abc123',
name: 'My Campaign',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| userId | string (UUID) | Required | User identifier completing first-time organic onboarding. |
| name | string | Required | Name of the real organization to create for the user. |
| ianaTimezone | 'UTC' | 'America/New_York' | 'America/Chicago' | 'America/Denver' | 'America/Los_Angeles' | 'America/Anchorage' | 'Pacific/Honolulu' | 'America/Toronto' | 'America/Vancouver' | 'Europe/London' | 'Europe/Paris' | 'Europe/Berlin' | 'Australia/Sydney' | 'Australia/Melbourne' | 'Pacific/Auckland' | 'Asia/Tokyo' | 'Asia/Singapore' | null | — | IANA timezone identifier. |
| currency | 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD' | 'NZD' | 'JPY' | 'SGD' | — | ISO 4217 currency code. |
Response#
Returns { data } with the result.
Update organization#
Update an organization's name, description, timezone, currency, conversion value for ROI calculations, or attribution window.
const { data } = await bw.organizations.update({
id: 'abc-123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Organization identifier to update. |
| name | string | — | Updated organization name (1-255 characters). |
| ianaTimezone | 'UTC' | 'America/New_York' | 'America/Chicago' | 'America/Denver' | 'America/Los_Angeles' | 'America/Anchorage' | 'Pacific/Honolulu' | 'America/Toronto' | 'America/Vancouver' | 'Europe/London' | 'Europe/Paris' | 'Europe/Berlin' | 'Australia/Sydney' | 'Australia/Melbourne' | 'Pacific/Auckland' | 'Asia/Tokyo' | 'Asia/Singapore' | null | — | Updated IANA timezone. |
| currency | 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD' | 'NZD' | 'JPY' | 'SGD' | — | Updated currency code. |
| conversionValue | number | — | Average customer value for ROI calculations (non-negative). |
| defaultAttributionWindowDays | integer | null | — | Number of days for the attribution window (must be greater than zero). |
Response#
Returns { data } with the result.
Delete organization#
Permanently delete an organization and all associated data.
const { data } = await bw.organizations.delete({
id: 'abc-123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Required | Organization identifier to delete. |
Response#
Returns { data } with the result.
Destructive action
List organization users#
List users in an organization with pagination and search.
const { items, totalCount, facets } = await bw.organizations.users.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. |
| 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. |
Response#
Returns { items, totalCount, facets } with paginated results.
Add organization user#
Add an existing user to an organization with a specified role.
const { data } = await bw.organizations.users.add({
organizationId: 'org_123',
userId: 'user_abc123',
role: 'member',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| userId | string (UUID) | Required | User identifier to add. |
| role | 'owner' | 'member' | 'viewer' | Required | Role to assign (owner, member, or viewer). |
Response#
Returns { data } with the result.
Update organization user role#
Update a user's role within an organization.
const { data } = await bw.organizations.users.updateRole({
organizationId: 'org_123',
userId: 'user_abc123',
role: 'member',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| userId | string (UUID) | Required | User identifier whose role is being changed. |
| role | 'owner' | 'member' | 'viewer' | Required | New role to assign (owner, member, or viewer). |
Response#
Returns { data } with the result.
Remove organization user#
Remove a user's membership from an organization.
const { data } = await bw.organizations.users.remove({
organizationId: 'org_123',
userId: 'user_abc123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| userId | string (UUID) | Required | User identifier to remove. |
Response#
Returns { data } with the result.
Invite organization user#
Invite a user to an organization by email.
const { data } = await bw.organizations.users.invite({
email: 'user@example.com',
organizationId: 'org_123',
role: 'member',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
string | Required | Email address to send the invite to. | |
| organizationId | string (UUID) | Required | Organization identifier. |
| role | 'owner' | 'member' | 'viewer' | Required | Role to assign to the invited user (owner, member, or viewer). |
Response#
Returns { data } with the result.
Authorization required
Accept organization invite#
Accept a pending organization invite.
const { data } = await bw.organizations.users.acceptInvite({
organizationId: 'org_123',
userId: 'user_abc123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| userId | string (UUID) | Required | User identifier accepting the invite. |
Response#
Returns { data } with the result.
Decline organization invite#
Decline a pending organization invite.
const { data } = await bw.organizations.users.declineInvite({
organizationId: 'org_123',
userId: 'user_abc123',
});Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| organizationId | string (UUID) | Required | Organization identifier. |
| userId | string (UUID) | Required | User identifier declining the invite. |
Response#
Returns { data } with the result.
Process invite signup#
Process invite metadata for a newly signed-up user.
const { data } = await bw.organizations.users.processInviteSignup();Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| userId | string (UUID) | Required | Authenticated user whose invite metadata should be processed. |
Response#
Returns { data } with the result.