Status: built (2026-10-05) as the Backend API and Management API, and in the tokens. Tests: apps/auth-broker/tests/organizations.test.ts. The end-user components (switcher, profile, members) come with COMPONENTS.md; SSO, SCIM and domain enrollment build on this (ENTERPRISE.md).
B2B products have organizations: a customer company with members, roles and settings. Passkin keeps them per project, with roles and permissions you define, and — the part that matters at runtime — tells your backend which organization a request is for and what the person may do there, in the token, with no extra lookup.
The model
- An organization (
org_…) has a name, a slug (acme-rockets), a logo,metadata(members can read it) andprivate_metadata(backend only), and an optional member limit. - A member is a user of the project with a role. A role is a set of permissions; a person may also hold permissions directly.
- Roles are the project's:
org:adminandorg:memberare built in (they stay), you add your own (org:billing_manager). Permissions are Passkin'sorg:profile:manage,org:members:read,org:members:manage,org:domains:manage,org:sso:manage,org:audit:read,org:api_keys:manage(API-KEYS.md), plus any you create (billing:manage). A role may only contain permissions that exist. - Everything is scoped to the project: an organization, role or invitation from another project is a 404.
The API
The same routes in two places: the Backend API with your secret key at /v1/…, and the dashboard's Management API at
/v1/manage/projects/:pid/…. (:oid is an org_… id or a slug.)
GET /organizations ?query ?limit ?offset · POST · GET|PATCH|DELETE /organizations/:oid |
POST takes name, slug?, logo_url?, metadata?, private_metadata?, max_members?, require_mfa? (below), and created_by? (a user id: they become its first admin) |
GET|POST /organizations/:oid/members · PATCH|DELETE …/members/:user_id |
POST {user_id, role?} (default org:member); PATCH {role} |
GET /users/:id/organizations |
a user's organizations with role and permissions |
GET|POST /organizations/:oid/invitations · POST …/invitations/:id/revoke |
{email} or {emails}, role?, redirect_url?, locale? |
GET|POST /roles · PATCH|DELETE /roles/:key |
{key: "org:billing_manager", name, description?, permissions: [...]} |
GET|POST /permissions · DELETE /permissions/:key |
{key: "billing:manage", description?} |
Errors say why (exists 409, invalid 400, not_found 404, limit 409, in_use 409 — a role or permission still in use cannot be
deleted). Changes are written to the project's activity log and sent as webhooks: organization.created|updated|deleted,
organization.member.added|updated|removed, organization.invitation.created|accepted|revoked (subscribe to organization.*).
Invitations
An invitation is permission for an address, proven by signing in — the same rule as project invitations (ACCESS.md). Passkin emails the person (bounded, linking only to the project's own sites); when they sign in as that address they join the organization with the invited role. It also admits them to a project that is closed to everyone else. Invitations last 14 days and can be revoked; inviting someone already in is refused.
In the token
Sign in acting in an organization with &organization=<id or slug> on the authorization request — the person must belong
to it, or the application gets error=access_denied. Without the parameter the session acts in the person's only
organization (the project setting organizations.auto_select, on by default), or in none when they have several. Both the ID
token and the access token then carry:
{ "org_id": "org_…", "org_slug": "acme-rockets", "org_role": "org:billing", "org_permissions": ["billing:manage"] }
Switching is a refresh: grant_type=refresh_token&organization=<id or slug> returns tokens acting in that organization
(a person who does not belong gets invalid_request); organization= (empty) acts in none. Leaving an organization takes effect
at the next token, with no action needed: a token for an organization the person no longer belongs to simply has no org_* claims.
Your backend checks permissions, not role names:
const { payload } = await jwtVerify(token, JWKS, { issuer, audience, typ: "at+jwt" });
if (!payload.org_permissions?.includes("billing:manage")) return new Response("Forbidden", { status: 403 });
// every query is scoped by payload.org_id
Claim templates can read organization.id|slug|name|role|permissions|metadata.<key>; the org_* names are reserved.
Requiring a second step of members
An organization can demand more than one factor of its members — what WorkOS and Clerk's enterprise plans sell as "enforce MFA for the organization":
PATCH /v1/organizations/:oid { "require_mfa": true } # Backend API (secret key); also at /v1/manage/projects/:pid/organizations/:oid
PATCH /v1/me/organizations/:oid { "require_mfa": true } # an organization's own admin (permission org:profile:manage), as the components do
While a person belongs to an organization with require_mfa, every sign-in to the project needs a second step, exactly as when the project requires it for everyone (STEP-UP.md): a passkey, or a first factor and then an authenticator app, a recovery code or a text. A member with none gets no session and no code, and lands on "A second step is required" with a button to set one up in Passkin ID. The session says so in the token (amr, acr), a one-factor session is not reused to get around it, and the phone's own Google/Apple sheet is refused with interaction_required (the browser flow can ask).
Two decisions worth knowing:
- It holds from the first sign-in. A person the product created or imported before they ever signed in is already a member; Passkin matches them by the passport they are linked to, or by their verified address before they are, so the policy cannot be skipped by being first.
- It is the project's sign-in, not an organization-scoped one. The rule applies to any sign-in of a member, whichever organization they then act in — a token does not exist for "this organization only" until the person has signed in, and asking only when they pick it would leave the other doors open. Members of an organization that does not require it are unaffected, and so are other projects.
The setting is shown to every member (what they are held to is not a secret from them); the dashboard has it on the organization's page, and the React and web-component organization profiles have it as a checkbox that only an admin can change. Enterprise single sign-on is governed by its identity provider's own policy and does not come through here.
Tests: apps/auth-broker/tests/org-mfa.test.ts, native.test.ts, and the component tests.
Settings (PATCH /v1/manage/projects/:pid)
"organizations": { "allow_user_create": false, "auto_select": true, "max_per_user": null } — what end users may do (the
user-facing routes arrive with the components; allow_user_create and max_per_user are stored for them).
Not built yet
The user-facing API for the components (a member with org:members:manage invites teammates using their own token; create an
organization when allow_user_create), a hosted organization chooser on the sign-in page when a person has several, verified
domains with automatic enrollment (arrives with SSO), per-organization session policy, an MFA rule that varies by role, last-admin protection for
those end-user routes (the building block, keepAdmin, exists), and organization-level API keys. The dashboard's Organizations pages cover everything above.