Organizations

Organizations are a B2B grouping layer inside a realm. A single realm can contain many organizations; a user can belong to many organizations simultaneously; and each organization can carry custom key-value metadata. Together, these primitives cover the most common multi-tenant SaaS pattern: customers are organizations, users are members.

New to B2B identity?

For conceptual background on how customer-facing (B2B/CIAM) identity differs from workforce IAM, see What is CIAM? and Branding, Portals & Org Policies in the Learn section.

Why Organizations?

Realms provide isolation at the deployment level — one realm per product, or per environment. Organizations sit one level below that. They let you model the business structure of your customers without spinning up a new realm per customer.

Use organizations when:

  • Your users belong to customer accounts that have distinct identities (company name, billing plan, external IDs).
  • You need to list every organization a given user belongs to, or every member of a given organization.
  • You want to attach arbitrary metadata to a customer account (CRM ID, subscription tier, feature flags) without extending the user schema.

Use a separate realm per tenant instead when you need complete credential isolation, different authentication policies, or different token lifetimes per tenant.

Organization Fields

FieldTypeRequiredDescription
idUUID v7Auto-generated identifier
realm_idUUIDThe realm this organization belongs to
nameString (1–255)YesHuman-readable label
aliasString (1–255)YesURL-safe identifier — lowercase alphanumeric, -, and _. Unique per realm
domainString (≤255)NoOptional email domain. Stored and validated but not yet used for automatic onboarding — see Roadmap below
redirect_urlStringNoOptional callback URL
descriptionStringNoOptional free-text description
enabledBooleanNoDefaults to true. A disabled organization rejects new member additions
created_atDateTime (UTC)Creation timestamp
updated_atDateTime (UTC)Last-modified timestamp

Realm Scoping

Every organization belongs to exactly one realm. All API endpoints are realm-scoped:

/realms/{realm_name}/organizations

A user and the organization they join must be in the same realm. Cross-realm membership is rejected.

The alias must be unique within the realm. Attempting to create or update an organization with a duplicate alias returns a AlreadyExists error.

The enabled Flag

Setting enabled: false on an organization freezes membership additions — the POST /members endpoint will reject new requests. Existing members are unaffected. Use this to suspend an organization without deleting it or removing all its members.

Permissions

ActionRequired permission
List, view organizationManageRealm or ManageUsers or ViewUsers
Create, update organizationManageRealm or ManageUsers
Manage members and attributesManageRealm or ManageUsers
Delete organizationManageRealm only

There are no organization-specific permissions. All access control uses the realm-level permissions above.

Roadmap

The following features are planned but not yet implemented:

  • Organization-scoped roles: membership is currently flat — there is no per-member role or permission within an organization.
  • Domain-based auto-onboarding: the domain field is stored and validated, but FerrisKey does not yet automatically assign users to an organization based on their email domain.
  • Organization policies: forced SSO, domain-matching rules, and org-level authentication policies are aspirational and not shipped.
  • Soft delete: deletes are hard (permanent). There is no archive or restore flow.

When to Use Organizations vs. Separate Realms

ScenarioRecommendation
B2B SaaS, customers share auth policiesOrganizations within one realm
Customers need completely different token lifetimes or IdP federationSeparate realms per customer
Internal multi-team productOrganizations within one realm
Regulated multi-tenant isolation (data residency)Separate realms