roboto.domain.orgs.org#

Module Contents#

class roboto.domain.orgs.org.Org(record, roboto_client=None)#

A collaborative workspace for multiple Roboto users.

Organizations are the primary grouping mechanism in Roboto, allowing multiple users to collaborate on datasets, actions, and other resources. Each organization has its own isolated namespace for resources and can have different limits and functionality depending on its tier (free or premium).

Organization names are unique within the Roboto platform. Users can be members of multiple organizations with different roles (user, admin, owner). Organizations can also be configured with email domain binding to automatically add users with matching email domains.

Parameters:
add_role_for_user(user_id, role)#

Add a role to a user in this organization.

Grants the specified role to a user who is already a member of the organization. Users can have multiple roles simultaneously.

Parameters:
Returns:

This Org instance for method chaining.

Raises:
Return type:

Org

Examples

Grant admin role to a user:

>>> from roboto import Org, OrgRoleName
>>> org = Org.from_id("org_12345")
>>> org.add_role_for_user("alice@example.com", OrgRoleName.admin)
bind_email_domain(email_domain)#

Bind an email domain to this organization.

Users with email addresses from the bound domain will automatically be added to this organization when they sign up for Roboto.

Parameters:

email_domain (str) – Email domain to bind (e.g., “example.com”).

Returns:

This Org instance for method chaining.

Raises:
Return type:

Org

Examples

Bind a company email domain:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> org.bind_email_domain("acme.com")
classmethod create(name, bind_email_domain=False, data_region=RobotoRegion.US_WEST, roboto_client=None)#

Create a new organization.

Creates a new organization with the specified name and configuration.

Parameters:
  • name (str) – Name for the organization.

  • bind_email_domain (bool) – Whether to automatically bind the email domain from the creator’s email address to this organization.

  • data_region (roboto.regionalization.RobotoRegion) – Geographic region where the organization’s data will be stored.

  • roboto_client (Optional[roboto.http.RobotoClient]) – Optional Roboto client instance. If not provided, uses the default client.

Returns:

A new Org instance representing the created organization.

Raises:
Return type:

Org

Examples

Create a basic organization:

>>> from roboto import Org
>>> org = Org.create("my-company")
>>> print(f"Created org: {org.name}")

Create an organization with email domain binding:

>>> from roboto import Org, RobotoRegion
>>> org = Org.create(
...     name="acme-corp",
...     bind_email_domain=True,
...     data_region=RobotoRegion.EU_WEST
... )
delete()#

Delete this organization permanently.

Permanently removes the organization and all associated data including datasets, actions, and user memberships. This action cannot be undone.

Raises:
Return type:

None

Examples

Delete an organization:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> org.delete()  # Permanently removes the organization
email_domains()#

Retrieve all email domains bound to this organization.

Returns:

Collection of email domain strings bound to this organization.

Raises:

RobotoUnauthorizedException – The caller lacks permission to view email domains.

Return type:

collections.abc.Collection[str]

Examples

List bound email domains:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> domains = org.email_domains()
>>> for domain in domains:
...     print(f"Bound domain: {domain}")
classmethod for_self(roboto_client=None)#

Retrieve all organizations the current user is a member of.

Parameters:

roboto_client (Optional[roboto.http.RobotoClient]) – Optional Roboto client instance. If not provided, uses the default client.

Returns:

Sequence of Org instances for organizations the user belongs to.

Raises:

RobotoUnauthorizedException – No valid authentication credentials provided.

Return type:

collections.abc.Sequence[Org]

Examples

List user’s organizations:

>>> from roboto import Org
>>> orgs = Org.for_self()
>>> for org in orgs:
...     print(f"Member of: {org.name}")
classmethod for_user(user_id, roboto_client=None)#

Retrieve all organizations a specific user is a member of.

Parameters:
  • user_id (str) – Unique identifier for the user.

  • roboto_client (Optional[roboto.http.RobotoClient]) – Optional Roboto client instance. If not provided, uses the default client.

Returns:

Sequence of Org instances for organizations the user belongs to.

Raises:
Return type:

collections.abc.Sequence[Org]

Examples

List another user’s organizations:

>>> from roboto import Org
>>> orgs = Org.for_user("alice@example.com")
>>> print(f"Alice is in {len(orgs)} organizations")
classmethod from_id(org_id, roboto_client=None)#

Load an existing organization by its unique ID.

Parameters:
  • org_id (str) – Unique identifier for the organization to retrieve.

  • roboto_client (Optional[roboto.http.RobotoClient]) – Optional Roboto client instance. If not provided, uses the default client.

Returns:

Org instance for the specified organization ID.

Raises:
Return type:

Org

Examples

Load an organization by ID:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> print(f"Organization: {org.name}")
invite_user(user_id)#

Invite a user to join this organization.

Creates an invitation that the specified user can accept to become a member of this organization.

Parameters:

user_id (str) – Unique identifier for the user to invite.

Returns:

OrgInvite instance representing the created invitation.

Raises:
Return type:

roboto.domain.orgs.org_invite.OrgInvite

Examples

Invite a user to the organization:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> invite = org.invite_user("alice@example.com")
>>> print(f"Invitation created: {invite.invite_id}")
invites()#

Retrieve all pending invitations for this organization.

Returns:

Collection of OrgInvite instances for pending invitations.

Raises:

RobotoUnauthorizedException – The caller lacks permission to view invitations.

Return type:

collections.abc.Collection[roboto.domain.orgs.org_invite.OrgInvite]

Examples

List pending invitations:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> invites = org.invites()
>>> for invite in invites:
...     print(f"Pending invite for: {invite.invited_user_id}")
property name: str#

Human-readable name of this organization.

Returns:

The organization’s name.

Return type:

str

property org_id#

Unique identifier for this organization.

Returns:

The organization’s unique ID.

refresh()#

Refresh this organization’s data from the server.

Fetches the latest organization data from Roboto and updates this instance’s internal state.

Returns:

This Org instance with updated data.

Raises:
Return type:

Org

Examples

Refresh organization data:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> org.refresh()  # Updates with latest data from server
remove_role_from_user(user_id, role)#

Remove a role from a user in this organization.

Revokes the specified role from a user. The user remains a member of the organization unless all roles are removed.

Parameters:
Returns:

This Org instance for method chaining.

Raises:
Return type:

Org

Examples

Remove admin role from a user:

>>> from roboto import Org, OrgRoleName
>>> org = Org.from_id("org_12345")
>>> org.remove_role_from_user("alice@example.com", OrgRoleName.admin)
remove_user(user_id)#

Remove a user from this organization.

Completely removes the user from the organization, revoking all roles and access to organization resources.

Parameters:

user_id (str) – Unique identifier for the user to remove.

Returns:

This Org instance for method chaining.

Raises:
Return type:

Org

Examples

Remove a user from the organization:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> org.remove_user("alice@example.com")
property status: roboto.domain.orgs.org_records.OrgStatus#

Current status of this organization.

Returns:

The organization’s status (provisioning, active, or de-provisioning).

Return type:

roboto.domain.orgs.org_records.OrgStatus

property tier: roboto.domain.orgs.org_records.OrgTier#

Subscription tier of this organization.

Returns:

The organization’s tier (free or premium).

Return type:

roboto.domain.orgs.org_records.OrgTier

to_dict()#

Convert this organization to a dictionary representation.

Returns a JSON-serializable dictionary containing all organization data.

Returns:

Dictionary representation of the organization.

Return type:

dict[str, Any]

Examples

Export organization data:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> org_data = org.to_dict()
>>> print(f"Org created: {org_data.get('created')}")
unbind_email_domain(email_domain)#

Remove an email domain binding from this organization.

Users with email addresses from this domain will no longer be automatically added to the organization.

Parameters:

email_domain (str) – Email domain to unbind (e.g., “example.com”).

Returns:

This Org instance for method chaining.

Raises:
Return type:

Org

Examples

Unbind an email domain:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> org.unbind_email_domain("old-company.com")
update(update)#

Update this organization’s properties.

Updates the organization with the provided changes and refreshes this instance with the updated data.

Parameters:

update (roboto.domain.orgs.org_operations.UpdateOrgRequest) – Update request containing the changes to apply.

Returns:

This Org instance with updated data.

Raises:
Return type:

Org

Examples

Update organization name:

>>> from roboto import Org, UpdateOrgRequest, OrgRecordUpdates
>>> org = Org.from_id("org_12345")
>>> update = UpdateOrgRequest(
...     updates=OrgRecordUpdates(name="New Company Name")
... )
>>> org.update(update)
users()#

Retrieve all users who are members of this organization.

Returns:

Collection of OrgUserRecord instances representing organization members.

Raises:

RobotoUnauthorizedException – The caller lacks permission to view organization members.

Return type:

collections.abc.Collection[roboto.domain.orgs.org_records.OrgUserRecord]

Examples

List organization members:

>>> from roboto import Org
>>> org = Org.from_id("org_12345")
>>> users = org.users()
>>> for user_record in users:
...     print(f"Member: {user_record.user.name} ({user_record.roles})")