Organizations
Organizations
Organizations provide Role-Based Access Control (RBAC) for managing teams, projects, and resources. Use organizations to collaborate with team members and control who can access your models, datasets, workflows, and graphs.
Organizations
Get all organizations
organizations = client.get_organizations()Create an organization
from seeme.types import Organization
my_org = Organization(
name="Acme AI",
description="Our AI research team",
slug="acme-ai",
website="https://acme.ai"
)
my_org = client.create_organization(my_org)| Parameter | Type | Description |
|---|---|---|
| organization | Organization | The organization object |
Organization properties:
| Property | Type | Description |
|---|---|---|
| id | str | Unique id |
| name | str | Organization name |
| description | str | Description |
| slug | str | URL-friendly identifier |
| website | str | Organization website |
| owner_id | str | User id of the owner |
| has_logo | bool | Whether it has a logo |
Get an organization
org = client.get_organization(my_org.id)Update an organization
my_org.description = "Leading AI research team"
client.update_organization(my_org)Delete an organization
client.delete_organization(my_org.id)Organization logo
## Upload logo
client.upload_organization_logo(my_org.id, folder="logos", filename="org_logo.png")
# Download logo
client.get_organization_logo(my_org.id, download_location="downloaded_logo.png")
# Delete logo
client.delete_organization_logo(my_org.id)Organization Members
Get members
members = client.get_organization_members(my_org.id)
for member in members:
print(f"{member.username} - {member.role_name}")OrganizationMember properties:
| Property | Type | Description |
|---|---|---|
| id | str | Unique member id |
| organization_id | str | The organization id |
| user_id | str | The user’s id |
| role_id | str | The assigned role id |
| role_name | str | Name of the assigned role |
| str | Member’s email | |
| username | str | Member’s username |
| firstname | str | Member’s first name |
| name | str | Member’s last name |
Invite a member
Invite someone to your organization by email:
member = client.invite_to_organization(
org_id=my_org.id,
email="colleague@example.com",
role_id=editor_role.id
)| Parameter | Type | Description |
|---|---|---|
| org_id | str | The organization id |
| str | Email address to invite | |
| role_id | str | Optional role to assign |
Update member role
member = client.update_organization_member_role(
org_id=my_org.id,
member_id=member.id,
role_id=admin_role.id
)Remove a member
client.remove_organization_member(my_org.id, member.id)Teams
Teams help organize members within an organization.
Get organization teams
teams = client.get_organization_teams(my_org.id)Get all teams
teams = client.get_teams()Create a team
from seeme.types import Team
my_team = Team(
name="Research Team",
description="AI research and development",
organization_id=my_org.id,
slug="research"
)
my_team = client.create_team(my_team)Team properties:
| Property | Type | Description |
|---|---|---|
| id | str | Unique id |
| name | str | Team name |
| description | str | Description |
| organization_id | str | Parent organization id |
| slug | str | URL-friendly identifier |
Get a team
team = client.get_team(my_team.id)Update a team
my_team.description = "Core AI research team"
client.update_team(my_team)Delete a team
client.delete_team(my_team.id)Team logo
client.upload_team_logo(my_team.id, folder="logos", filename="team_logo.png")
client.get_team_logo(my_team.id, download_location="team_logo.png")
client.delete_team_logo(my_team.id)Team members
# Get team members
members = client.get_team_members(my_team.id)
# Add a member
member = client.add_team_member(
team_id=my_team.id,
user_id=user.id,
role_id=contributor_role.id
)
# Update member role
client.update_team_member_role(my_team.id, member.id, new_role.id)
# Remove a member
client.remove_team_member(my_team.id, member.id)Projects
Projects group related resources (models, datasets, workflows, graphs) together.
Get projects
# Get all projects
projects = client.get_projects()
# Filter by organization
projects = client.get_projects(organization_id=my_org.id)
# Filter by team
projects = client.get_projects(team_id=my_team.id)
# Get organization projects
projects = client.get_organization_projects(my_org.id)
# Get team projects
projects = client.get_team_projects(my_team.id)Create a project
from seeme.types import Project
my_project = Project(
name="Image Classification Project",
description="Classify product images",
organization_id=my_org.id,
team_id=my_team.id,
slug="image-classification"
)
my_project = client.create_project(my_project)Project properties:
| Property | Type | Description |
|---|---|---|
| id | str | Unique id |
| name | str | Project name |
| description | str | Description |
| organization_id | str | Parent organization id |
| team_id | str | Associated team id |
| slug | str | URL-friendly identifier |
Get a project
project = client.get_project(my_project.id)Update a project
my_project.description = "Classify e-commerce product images"
client.update_project(my_project)Delete a project
client.delete_project(my_project.id)Project logo
client.upload_project_logo(my_project.id, folder="logos", filename="project_logo.png")
client.get_project_logo(my_project.id, download_location="project_logo.png")
client.delete_project_logo(my_project.id)Project members
# Get project members
members = client.get_project_members(my_project.id)
# Add a member
member = client.add_project_member(
project_id=my_project.id,
user_id=user.id,
role_id=viewer_role.id
)
# Update member role
client.update_project_member_role(my_project.id, member.id, editor_role.id)
# Remove a member
client.remove_project_member(my_project.id, member.id)Project resources
Assign models, datasets, workflows, and graphs to a project:
# Get project resources
resources = client.get_project_resources(my_project.id)
# Assign a model to the project
resource = client.assign_resource_to_project(
project_id=my_project.id,
resource_type="model",
resource_id=my_model.id
)
# Assign a dataset
client.assign_resource_to_project(my_project.id, "dataset", my_dataset.id)
# Assign a workflow
client.assign_resource_to_project(my_project.id, "workflow", my_workflow.id)
# Assign a graph
client.assign_resource_to_project(my_project.id, "graph", my_graph.id)
# Remove a resource
client.remove_resource_from_project(my_project.id, "model", my_model.id)ProjectResource properties:
| Property | Type | Description |
|---|---|---|
| id | str | Unique id |
| project_id | str | The project id |
| resource_type | str | Type: “model”, “dataset”, “workflow”, “graph” |
| resource_id | str | The resource id |
| resource_name | str | Name of the resource |
Roles
Roles define what permissions members have.
Get roles
# Get all roles
roles = client.get_roles()
# Get organization-specific roles
roles = client.get_organization_roles(my_org.id)Create a role
from seeme.types import Role, Permission
custom_role = Role(
name="Data Annotator",
description="Can view and annotate datasets",
organization_id=my_org.id,
permissions=[
Permission.DATASETS_LIST,
Permission.DATASETS_READ,
Permission.DATASET_LABELS_CREATE,
Permission.DATASET_LABELS_UPDATE
]
)
custom_role = client.create_role(custom_role)Role properties:
| Property | Type | Description |
|---|---|---|
| id | str | Unique id |
| name | str | Role name |
| description | str | Description |
| organization_id | str | Organization this role belongs to |
| scope | str | Scope: “organization” or “system” |
| permissions | List[Permission] | List of permission codes |
| is_system_role | bool | Whether it’s a built-in role |
Get a role
role = client.get_role(custom_role.id)Update a role
custom_role.permissions.append(Permission.DATASETS_UPDATE)
client.update_role(custom_role)Delete a role
client.delete_role(custom_role.id)Permissions
Get available permissions
permissions = client.get_permissions()
for perm in permissions:
print(f"{perm.name}: {perm.description}")Common permission patterns
from seeme.types import Permission
# Full access to everything
admin_permissions = [Permission.ALL]
# Read-only access to models and datasets
viewer_permissions = [
Permission.MODELS_LIST,
Permission.MODELS_READ,
Permission.DATASETS_LIST,
Permission.DATASETS_READ
]
# Create and edit models
modeler_permissions = [
Permission.MODELS_LIST,
Permission.MODELS_READ,
Permission.MODELS_CREATE,
Permission.MODELS_UPDATE,
Permission.MODELS_UPLOAD,
Permission.MODEL_VERSIONS_CREATE,
Permission.MODEL_VERSIONS_UPDATE
]
# Full dataset management
data_manager_permissions = [
Permission.DATASETS_ALL,
Permission.DATASET_VERSIONS_CREATE,
Permission.DATASET_VERSIONS_UPDATE,
Permission.DATASET_LABELS_LIST,
Permission.DATASET_LABELS_READ,
Permission.DATASET_LABELS_CREATE,
Permission.DATASET_LABELS_UPDATE,
Permission.DATASET_SPLITS_CREATE,
Permission.DATASET_SPLITS_UPDATE,
Permission.DATASET_ITEMS_LIST,
Permission.DATASET_ITEMS_READ,
Permission.DATASET_ITEMS_CREATE,
Permission.DATASET_ITEMS_UPDATE,
Permission.ANNOTATIONS_ALL
]User Context
Get the current user’s context including their organizations, roles, and permissions:
context = client.get_current_user_context()
print(f"User: {context.user_id}")
print(f"Organizations: {[org.name for org in context.organizations]}")
print(f"Current org: {context.current_organization.name if context.current_organization else 'None'}")
print(f"Roles: {[role.name for role in context.roles]}")