Skip to content
BuildBase

Users and audience overview

Three separate identity concepts - workspace members, app users, and audience contacts - and when each applies.

BuildBase keeps three different ideas of "a person", and most confusion here comes from treating them as one. They live in separate collections and are managed by separate APIs.

ConceptWhat it isManaged from
Workspace memberA user's membership of one workspace, carrying a roleManaging members
UserThe account itself - credentials, profile, devices, sessionsThe console, and bb.users server-side
Audience contactA marketing record. May have no account at allAudience and lists

A person can be all three, and the records stay distinct. Blocking or unsubscribing an audience contact leaves the user account alone, and removing someone from a workspace deletes neither.

// Server-side: the user's membership of a workspace
// Adds an EXISTING account at once; 404 when the address has none.
await bb.users.invite(workspaceId, '[email protected]', 'editor');
// Reaches an address with no account yet: an invitation they accept.
await bb.invitations.create(workspaceId, '[email protected]', 'editor');
await bb.users.updateRole(workspaceId, userId, 'admin');
await bb.users.remove(workspaceId, userId);

// The signed-in user's own profile
const me = await bb.users.getProfile();
await bb.users.updateProfile({ name: 'Alice Chen' });

Before you start

bb.users.invite() respects seat limits. Check useSeatStatus() before offering an invite in your UI, or handle the rejection.

Which API to reach for

You want toUse
Add or remove a teammate who has an accountbb.users.*, or useSaaSWorkspaces() client-side
Invite an address with no account yetbb.invitations.create; see Invitations
Read or edit the signed-in profilebb.users.getProfile() / updateProfile()
Store custom fields on a userUser attributes
Segment people for a campaignAudience and lists
Administer any user in the orgThe console, or /api/users - see below

bb.users is deliberately narrow: it covers the operations an application performs on its own behalf. Org-wide administration is a console job, exposed over the admin API rather than the SDK.

A user's page in the console

When one of your users needs help, look them up here. Users in the console lists everyone with an account in your app, shows whether each has two-step sign-in on, and has filters to find one person. A user's page is the support view you'd otherwise have to build yourself:

On the pageWhat it holds
ProfileName, email and phone, each marked verified or not, and tags. A guest's placeholder address is marked as one
Custom claimsThe facts your backend reads at sign-in (custom claims)
Features, workspaces and listsThe user's feature flags, the workspaces they belong to and the lists they are on
Emails and NotificationsWhat was sent to them
ActivityWhat they did, and when
DevicesEach device and its live sessions: sign one device out, remove it, or revoke one session
Workflow runsThe workflows that ran for them
BillingTheir own plan, if your app sells plans to individual people

And what you can do from it:

  • Block or Unblock: a blocked user cannot sign in, and keeps everything.
  • Reset two-step sign-in, for a lost phone (two-step sign-in).
  • Sign in as this user, to see what they see, read-only by default, and End sign-in-as sessions (signing in as a user).
  • Delete: their personal data goes, their activity stays under "Deleted user" (deleting accounts).

People you are moving from another service arrive here too, with their passwords: see importing users.

Administering users over the API

/api/users is the console's own surface. It is broader than the SDK and correspondingly more dangerous, so treat it as an admin tool.

The table lists the routes that act on users. More serve the console's own screens and are left out: the charts and counts on the Users page, a user's email drafts and template emails, tags (/api/users/tags) and attribute definitions (/api/users/attributes).

MethodPathPurpose
GET/api/usersList users, paginated
GET/api/users/:idOne user
PATCH/api/users/:idUpdate a user
PATCH/api/users/:id/blockBlock - the user cannot sign in
PATCH/api/users/:id/unblockRestore access
PATCH/api/users/:id/change-roleChange the org-level role
PATCH/api/users/:id/tagsReplace the user's tags
GET/api/users/:id/accountsThe sign-in accounts linked to this user (each provider they signed in with)
GET/api/users/:id/workspacesWorkspaces this user belongs to
GET/api/users/:id/devicesKnown devices
GET/api/users/:id/sessionsActive sessions
GET/api/users/:id/activitiesActivity history
GET/api/users/:id/featuresResolved user feature flags
POST/api/users/:id/send-emailSend this user one email, or save it as a draft (Compose email)
GET/api/users/:id/emailsEmail sent to this user
PUT/api/users/:id/claimsSet the user's custom claims
DELETE/api/users/:id/age-gateClear their age answer, so the age question is asked again; owner or admin
DELETE/api/users/:id/mfaReset the user's two-step sign-in
GET/api/users/mfa-status?ids=Whether each listed user has a second step
POST/api/users/importImport users from another system
POST/api/users/:id/impersonateSign in to your app as them
DELETE/api/users/:id/impersonateEnd those sessions early
GET/api/users/:id/deletionWhat deleting this user would forfeit: their subscription, add-ons, credits
DELETE/api/users/:idDelete the user

Sessions and devices can be revoked individually with DELETE /api/users/:id/sessions/:sessionRef and DELETE /api/users/:id/devices/:deviceId - useful for a support flow that signs one device out without ending every session.

Blocking is the reversible option and deletion is not. Prefer PATCH /:id/block for abuse handling. A deletion removes the person's sign-in methods and personal data at once and keeps their activity under "Deleted user"; see Deleting accounts.

Custom claims and signing in as a user have their own pages. Signing in as a user needs a console login: an API token is refused.

To bring users over from another system, POST /api/users/import takes an NDJSON file of up to 1,000 users, with their password hashes and social sign-ins. See Importing users.

Next Steps