Skip to content

Groups

A group is the top-level organizational container in Flywheel. Groups own projects and provide a shared namespace for users and roles.

Groups in the hierarchy

Flywheel hierarchy
Group
└── Project
    └── Subject
        └── Session
            └── Acquisition

Every project belongs to exactly one group. A group is identified by its id (a short alphanumeric tag, sometimes called a "group tag") and has a human-readable label.

Group membership and access

Adding a user to a group grants them inherited access to all projects in that group at the specified access level (admin, rw, or ro). Project-level role assignments apply on top of group membership and can further narrow or extend what a user can do. See Permissions and Roles for details.

Key group fields

Field Description
id Short alphanumeric tag (e.g., "neuroimaging-lab")
label Human-readable name displayed in the UI
permissions List of user permission entries (user ID + access level)
projects Finder object for projects belonging to this group
tags List of tag strings available to projects in the group

Listing groups

Iterate through groups
for group in fw.groups():
    print(f"{group.id}: {group.label}")

Note

fw.groups() returns groups on which the logged-in user has group-level permissions or project-level permissions for one or more projects within the group. It does not return all groups existing on the instance.

Getting a group

Get a group by ID
group = fw.get_group(group_id)
print(group.label)

Creating a group

Create a group
new_group_id = fw.add_group(flywheel.Group(id=new_group_id, label=group_label))

Note

The id field must be unique across the site and can only contain lowercase letters, numbers, and hyphens. It cannot be changed after creation.

Updating a group

Update group label
fw.modify_group(new_group_id, {"label": "Updated Group Name"})

Listing projects in a group

List projects in a group
for project in group.projects():
    print(f"{project.id}: {project.label}")

Adding a member

Add a user to a group
fw.add_group_permission(
    group_id,
    flywheel.AccessPermission(id=user_email, access="rw"),
)

Updating a member's access

Update a group member's access level
fw.modify_group_user_permission(
    group_id,
    user_email,
    flywheel.AccessPermissionUpdate("admin"),
)

Removing a member

Remove a user from a group
fw.delete_group_user_permission(group_id, user_email)

Deleting a group

Delete a group
fw.delete_group(new_group_id)

Danger

Deletion is permanent and cascades. Deleting a group removes all of its children recursively — every project, subject, session, acquisition, file, and analysis it contains. This cannot be undone by users in any way, through the SDK or the UI. For emergencies, deleted data can generally be recovered by Flywheel support for a limited time after deletion. Verify the target group before deleting.