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.
Import
Section titled “Import”from bifrost import organizationsMethod Index
Section titled “Method Index”| Method | Returns | Description |
|---|---|---|
organizations.create() | Organization | Create a new organization (admin only) |
organizations.get() | Organization | Look up by ID |
organizations.list() | list[Organization] | List all organizations (admin only) |
organizations.update() | Organization | Patch fields (admin only) |
organizations.delete() | bool | Soft-delete (sets is_active=False) |
organizations.create()
Section titled “organizations.create()”async def create( name: str, domain: str | None = None, is_active: bool = True,) -> Organization| Parameter | Type | Description |
|---|---|---|
name | str | Organization name |
domain | str | None | Optional domain (used for SSO/auto-provisioning) |
is_active | bool | Whether the org is active |
org = await organizations.create("Acme Corp", domain="acme.com")organizations.get()
Section titled “organizations.get()”async def get(org_id: str) -> OrganizationRaises ValueError if the organization is not found.
org = await organizations.get("org-123")print(org.name, org.domain)organizations.list()
Section titled “organizations.list()”async def list() -> list[Organization]Returns every organization. Platform-admin only.
for org in await organizations.list(): print(f"{org.name} ({org.domain})")organizations.update()
Section titled “organizations.update()”async def update(org_id: str, **updates: Any) -> OrganizationAccepts 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)organizations.delete()
Section titled “organizations.delete()”async def delete(org_id: str) -> boolSoft-deletes the organization (sets is_active to False). Raises ValueError if not found.
await organizations.delete("org-123")Organization
Section titled “Organization”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.