Skip to content

Organizations Module

SDK reference for organization CRUD operations

The organizations module provides CRUD over organizations. All mutations require platform-admin privileges. get() works for any caller within scope.

from bifrost import organizations
MethodReturnsDescription
organizations.create()OrganizationCreate a new organization (admin only)
organizations.get()OrganizationLook up by ID
organizations.list()list[Organization]List all organizations (admin only)
organizations.update()OrganizationPatch fields (admin only)
organizations.delete()boolSoft-delete (sets is_active=False)
async def create(
name: str,
domain: str | None = None,
is_active: bool = True,
) -> Organization
ParameterTypeDescription
namestrOrganization name
domainstr | NoneOptional domain (used for SSO/auto-provisioning)
is_activeboolWhether the org is active
org = await organizations.create("Acme Corp", domain="acme.com")
async def get(org_id: str) -> Organization

Raises ValueError if the organization is not found.

org = await organizations.get("org-123")
print(org.name, org.domain)
async def list() -> list[Organization]

Returns every organization. Platform-admin only.

for org in await organizations.list():
print(f"{org.name} ({org.domain})")
async def update(org_id: str, **updates: Any) -> Organization

Accepts name, domain, and is_active as keyword arguments. Other keys are ignored. Raises ValueError if the org is not found.

await organizations.update("org-123", name="Acme Corporation", is_active=True)
async def delete(org_id: str) -> bool

Soft-deletes the organization (sets is_active to False). Raises ValueError if not found.

await organizations.delete("org-123")

Defined in bifrost.models. Fields include id, name, domain, is_active, and timestamps. Provider/managed-org relationships are exposed where applicable; see bifrost.models for the canonical definition.