Organizations
One person, several teams
An organization is a group of users with roles — the shape B2B software needs when a workspace, not an individual, is what pays. A user can belong to many, and exactly one is active at a time. The active one decides which entitlements their token carries.
Entitlement inheritance — the part that matters
An organization has a customer record of its own. When a member has that organization active, their token's ent claim is the union of their personal entitlements and the organization's. That is how a company buys one subscription and forty engineers get access without forty purchases.
Switching organization applies on the next refresh
setActive() returns { activeOrganizationId, appliesFrom: 'next_refresh' }. The token in hand keeps its old claims until it is replaced, which is at most ninety seconds. If your UI must reflect the switch immediately, call refresh() after setting it rather than assuming the change is instant.Roles
| Role | Can |
|---|---|
org:admin | Everything: update and delete the organization, invite and remove members, change roles, manage domains |
org:member | Belong, read the roster, inherit entitlements |
org:guest | Present in the vocabulary; carries no rank in the permission checks |
The role also rides in the token, inside the o claim alongside the organization's id and slug — so your backend can authorize on it without a lookup.
The surface
Eighteen methods under auth.organizations, in four groups.
| Group | Methods |
|---|---|
| The organization | create · list · setActive · update · delete |
| Members | members · updateMemberRole · removeMember |
| Joining | invite · listInvitations · revokeInvitation · acceptInvitation · requestJoin · respondRequest |
| Domains | addDomain · listDomains · verifyDomain · removeDomain |
Creating one and inviting people
const { organization, role } = await auth.organizations.create({
name: 'Acme Inc',
slug: 'acme', // optional; generated if omitted
});
// The creator is org:admin.
await auth.organizations.setActive(organization.id);
await auth.refresh(); // pick up the new entitlements now
await auth.organizations.invite({
organizationId: organization.id,
email: 'engineer@acme.com',
role: 'org:member',
});
// On the invitee's side, from the link you emailed them:
await auth.organizations.acceptInvitation(token);Domains: joining without an invitation
A verified domain lets people with matching email addresses join without being invited one at a time. Three modes:
Domains can be claimed two ways: by an organization admin from your app, with the SDK methods above, or by you from Project Settings → Auth → SSO connections. Either way the proof is the same TXT record. The dashboard route matters when you are setting up enterprise SSO before anyone has signed in — a connection cannot route sign-ins until a verified domain points at it, and until now there was no way to create one without an existing org admin.
| Mode | Behaviour |
|---|---|
off | The domain is recorded but grants nothing |
auto_invite | A matching address joins directly |
auto_suggest | A matching address can request to join; an admin answers with respondRequest |
Verification is what makes this safe
Reading it on your backend
const claims = await verifyToken(token, { projectId, environment: 'production' });
claims.o?.id; // active organization
claims.o?.slg; // slug
claims.o?.rol; // role — authorize on this without a lookup
claims.ent; // union of personal + organization entitlementso is absent when no organization is active — a personal session, which is an ordinary state and not an error.
Starting a Journey from an organization
Two Journey triggers come from organizations, with nothing to send from your app:
- Organization Created: someone creates an organization. The Journey runs for the person who created it, so a welcome for the new workspace's owner reaches them.
- Member Joined an Organization: someone joins an existing organization by accepting an invitation or having a join request approved. The Journey runs for the new member, which is the moment to onboard a teammate. The creator becoming the first member does not count as a join, and neither does a directory (SCIM) role grant.
Both are server-only: an app cannot send them to start a Journey for someone else. Every other organization change still arrives as a webhook, which you can forward to BillDog as a custom event to start a Journey from it.
Platform availability
Organizations are on web (auth.organizations), iOS and Android (BillDogOrganizations), and React Native, Expo and Flutter through the bridges. Enterprise directory sync — provisioning members from Okta or Entra, and mapping directory groups to organization roles — is covered under SSO and SCIM.
Next
- Sessions and tokens — the claims in full.
- Overview
Was this page helpful?
Or rate this page: