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.
| Concept | What it is | Managed from |
|---|---|---|
| Workspace member | A user's membership of one workspace, carrying a role | Managing members |
| User | The account itself - credentials, profile, devices, sessions | The console, and bb.users server-side |
| Audience contact | A marketing record. May have no account at all | Audience 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 to | Use |
|---|---|
| Add or remove a teammate who has an account | bb.users.*, or useSaaSWorkspaces() client-side |
| Invite an address with no account yet | bb.invitations.create; see Invitations |
| Read or edit the signed-in profile | bb.users.getProfile() / updateProfile() |
| Store custom fields on a user | User attributes |
| Segment people for a campaign | Audience and lists |
| Administer any user in the org | The 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 page | What it holds |
|---|---|
| Profile | Name, email and phone, each marked verified or not, and tags. A guest's placeholder address is marked as one |
| Custom claims | The facts your backend reads at sign-in (custom claims) |
| Features, workspaces and lists | The user's feature flags, the workspaces they belong to and the lists they are on |
| Emails and Notifications | What was sent to them |
| Activity | What they did, and when |
| Devices | Each device and its live sessions: sign one device out, remove it, or revoke one session |
| Workflow runs | The workflows that ran for them |
| Billing | Their 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).
| Method | Path | Purpose |
|---|---|---|
GET | /api/users | List users, paginated |
GET | /api/users/:id | One user |
PATCH | /api/users/:id | Update a user |
PATCH | /api/users/:id/block | Block - the user cannot sign in |
PATCH | /api/users/:id/unblock | Restore access |
PATCH | /api/users/:id/change-role | Change the org-level role |
PATCH | /api/users/:id/tags | Replace the user's tags |
GET | /api/users/:id/accounts | The sign-in accounts linked to this user (each provider they signed in with) |
GET | /api/users/:id/workspaces | Workspaces this user belongs to |
GET | /api/users/:id/devices | Known devices |
GET | /api/users/:id/sessions | Active sessions |
GET | /api/users/:id/activities | Activity history |
GET | /api/users/:id/features | Resolved user feature flags |
POST | /api/users/:id/send-email | Send this user one email, or save it as a draft (Compose email) |
GET | /api/users/:id/emails | Email sent to this user |
PUT | /api/users/:id/claims | Set the user's custom claims |
DELETE | /api/users/:id/age-gate | Clear their age answer, so the age question is asked again; owner or admin |
DELETE | /api/users/:id/mfa | Reset the user's two-step sign-in |
GET | /api/users/mfa-status?ids= | Whether each listed user has a second step |
POST | /api/users/import | Import users from another system |
POST | /api/users/:id/impersonate | Sign in to your app as them |
DELETE | /api/users/:id/impersonate | End those sessions early |
GET | /api/users/:id/deletion | What deleting this user would forfeit: their subscription, add-ons, credits |
DELETE | /api/users/:id | Delete 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
- User attributes - custom fields on a user.
- Audience and lists - contacts, tags, and import.
- Managing members - roles and seats in a workspace.