---
sidebar:
  hidden: true
title: roboto.domain.orgs.org
---
## Module Contents

### Org

```python
class roboto.domain.orgs.org.Org(
    record: roboto.domain.orgs.org_records.OrgRecord,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
)
```

`from roboto.domain.orgs import Org`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L39-L674)

An organization: a workspace in which users share datasets, actions and other resources in Roboto.

Every dataset, action and other resource belongs to one organization. A user can belong to several organizations, with a different set of roles in each (see [`OrgRoleName`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgRoleName)). An organization's tier sets its features and usage limits. Binding an email domain to an organization, and verifying it where Roboto requires that, makes people who sign up with an address in that domain join it.

Get an `Org` from `create`, `from_id`, or `for_self`. To wrap a [`OrgRecord`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgRecord) already fetched from Roboto, build an `Org` from it directly. Each instance holds a copy of the organization's record: `update` updates that copy from Roboto's response, and `refresh` fetches changes made elsewhere.

**Parameters**

- **record** (`roboto.domain.orgs.org_records.OrgRecord`): Record of the organization.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Properties**

- **Org.assets** (`roboto.domain.files.FileSystem`): Files that belong to the organization as a whole, such as runbooks, rather than to a dataset or device.

  A dataset's files are reached through [`files`](/docs/reference/python-sdk/roboto/domain/datasets/dataset#roboto.domain.datasets.dataset.Dataset.files), and a device's configurations through [`configurations`](/docs/reference/python-sdk/roboto/domain/devices/device#roboto.domain.devices.device.Device.configurations).

- **Org.name** (`str`): Human-readable name of the organization.

- **Org.org_id**: Unique ID of the organization, beginning with `og_`.

- **Org.status** (`roboto.domain.orgs.org_records.OrgStatus`): Lifecycle state of the organization.

- **Org.tier** (`roboto.domain.orgs.org_records.OrgTier`): Subscription tier of the organization.

#### Org.add_role_for_user()

```python
def add_role_for_user(
    user_id: str,
    role: roboto.domain.orgs.org_records.OrgRoleName,
) -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L232-L261)

Grant a role to a member of this organization.

A member can hold several roles at once. Granting [`owner`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgRoleName.owner) also grants [`admin`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgRoleName.admin), and granting a role the member already holds changes nothing.

**Parameters**

- **user_id** (`str`): ID of the member, which for a person is their email address.
- **role** (`roboto.domain.orgs.org_records.OrgRoleName`): Role to grant.

**Returns**

- `Org`: This instance. Its record is unchanged until you fetch it again.

**Raises**

- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): `role` is `admin` or `owner` and the member is a service user.
- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The user is not a member of this organization.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): The caller is granting a role to themselves, does not hold a higher role than the member, or grants `owner` without being an owner.

**Usage**

```python
from roboto.domain.orgs import Org, OrgRoleName
org = Org.from_id("og_12345")
org.add_role_for_user("alice@example.com", OrgRoleName.admin)
```

#### Org.bind_email_domain()

```python
def bind_email_domain(email_domain: str) -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L295-L326)

Bind an email domain to this organization.

Where Roboto does not require email domains to be verified, a domain the organization does not hold yet binds with auto-join on, so people who sign up with an address at the domain join this organization. Where Roboto requires verification, this starts a verification of the domain instead, and discards the DNS TXT record that completes it: call `start_email_domain_verification` instead to get the record, or `new_email_domain_verification_record` for a new one. Once the domain is verified, `set_email_domain_auto_join` turns auto-join on. A domain the organization already holds keeps its auto-join setting. Roboto stores the domain in lowercase. Only organization administrators may bind email domains.

**Parameters**

- **email_domain** (`str`): Email domain to bind, such as `example.com`. The caller's own email address must be in it.

**Returns**

- `Org`: This instance. Its record is unchanged until you fetch it again.

**Raises**

- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): The domain is not an email domain, or is on Roboto's list of domains that no organization may bind, which includes public email providers' domains.
- [`RobotoLimitExceededException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoLimitExceededException): The organization is verifying as many email domains at once as it may.
- [`RobotoOrgEmailDomainChangeRefusedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoOrgEmailDomainChangeRefusedException): Another organization holds the domain.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): Roboto does not require email domains to be verified, and the caller's email address is not at the domain.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
org.bind_email_domain("example.com")
```

#### Org.check_email_domain_verification()

```python
def check_email_domain_verification(
    email_domain: str,
) -> roboto.domain.orgs.org_records.OrgEmailDomainRecord
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L328-L359)

Verify an email domain for this organization, once its verification's DNS TXT record is published.

Roboto looks up the DNS TXT record of this organization's verification of the domain, and verifies the domain when it finds the record. A domain the organization does not hold yet becomes one it holds, with auto-join on when [`auto_join_on_verify`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.EmailDomainVerificationChallengeRecord.auto_join_on_verify) is `True`; a domain it holds keeps its auto-join setting. When Roboto cannot reach DNS, the method raises `RobotoServiceUnavailableException`; try again in a few minutes. Only organization administrators may verify email domains.

**Parameters**

- **email_domain** (`str`): Email domain to verify, such as `example.com`.

**Returns**

- `roboto.domain.orgs.org_records.OrgEmailDomainRecord`: Record of the verified email domain.

**Raises**

- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): The domain is not an email domain, or is on Roboto's list of domains that no organization may bind.
- [`RobotoOrgEmailDomainChangeRefusedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoOrgEmailDomainChangeRefusedException): The organization has no unexpired verification of the domain, Roboto did not find the record at the domain, or another organization holds the domain. Its `reason` says which.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
org.check_email_domain_verification("example.com").status
# <OrgEmailDomainStatus.Verified: 'verified'>
```

#### Org.create()

```python
@classmethod
def create(
    name: str,
    bind_email_domain: bool = False,
    data_region: roboto.regionalization.RobotoRegion = RobotoRegion.US_WEST,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
    idempotency_key: Optional[str] = None,
) -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L61-L133)

Create an organization, with the caller as its owner.

The SDK retries the request after a timeout or a server error, and every attempt carries the same idempotency key, so the retries create one organization, not several. When the request still fails after the retries, `create` raises `RobotoServiceUnavailableException`: calling it again with the same `idempotency_key` is safe, and finishes the setup of an organization the request created.

**Parameters**

- **name** (`str`): Human-readable name of the organization. Roboto does not require names to be unique.
- **bind_email_domain** (`bool`): Whether to bind the creator's email domain to the new organization, so that people who sign up with an address in the domain join the organization. The organization is created whether or not the domain binds. When it does not bind, a `UserWarning` says why: the domain is one that no organization may bind, such as a public email provider's domain; another organization holds it; or Roboto requires the domain to be verified first, in which case the warning carries the DNS TXT record that verifies it, which Roboto shows only once.
- **data_region** (`roboto.regionalization.RobotoRegion`): Region where Roboto stores the organization's data.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).
- **idempotency_key** (`Optional[str]`): Key that identifies this creation: 1 to 255 printable ASCII characters, not including space. Calling `create` again with the same key returns the organization the first call created. `None` generates a key that only this call's retries use.

**Returns**

- `Org`: The new organization.

**Raises**

- [`RobotoConflictException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoConflictException): `idempotency_key` was used before with a different `name`, `data_region` or `bind_email_domain`, or for an organization that is no longer the caller's, such as one deleted or one the caller left. No organization is created.
- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): Roboto does not support `data_region`, or `idempotency_key` is not 1 to 255 printable ASCII characters other than space.
- [`RobotoLimitExceededException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoLimitExceededException): The caller already owns as many organizations as they may.
- [`RobotoOrgCreationRefusedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoOrgCreationRefusedException): The Roboto deployment's sign-up policy does not let the caller create an organization now. Its `next_step` says what the caller can do instead.

**Usage**

Create an organization:

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

Create an organization in another region, and bind the creator's email domain to it:

```python
from roboto import RobotoRegion
from roboto.domain.orgs import Org
org = Org.create(name="acme-corp", bind_email_domain=True, data_region=RobotoRegion.EU_CENTRAL)
```

#### Org.delete()

```python
def delete() -> None
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L361-L372)

Delete this organization and everything in it, such as its datasets, actions and memberships.

Roboto removes the organization at once and deletes its data afterward. This cannot be undone. Deleting an organization that no longer exists succeeds and changes nothing.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
org.delete()
```

**Returns**

- `None`

#### Org.email_domain_listing()

```python
def email_domain_listing() -> roboto.domain.orgs.org_records.OrgEmailDomainListing
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L374-L387)

Fetch the email domains this organization holds and its unexpired verifications of email domains.

Each domain's record gives its verification status and its auto-join setting.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
for domain in org.email_domain_listing().email_domains:
    print(domain.email_domain, domain.status, domain.auto_join)
```

**Returns**

- `roboto.domain.orgs.org_records.OrgEmailDomainListing`

#### Org.email_domains()

```python
def email_domains() -> collections.abc.Collection[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L389-L398)

Fetch the email domains bound to this organization.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
for domain in org.email_domains():
    print(f"Bound domain: {domain}")
```

**Returns**

- `collections.abc.Collection[str]`

#### Org.for_self()

```python
@classmethod
def for_self(
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> collections.abc.Sequence[Org]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L157-L171)

Fetch every organization the caller belongs to.

**Parameters**

- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Returns**

- `collections.abc.Sequence[Org]`

**Usage**

```python
from roboto.domain.orgs import Org
for org in Org.for_self():
    print(f"Member of: {org.name}")
```

#### Org.for_user()

```python
@classmethod
def for_user(
    user_id: str,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> collections.abc.Sequence[Org]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L174-L194)

Fetch every organization a user belongs to.

**Parameters**

- **user_id** (`str`): ID of the user, which for a person is their email address.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No user exists with the specified ID.

**Returns**

- `collections.abc.Sequence[Org]`

**Usage**

```python
from roboto.domain.orgs import Org
orgs = Org.for_user("alice@example.com")
print(f"Alice is in {len(orgs)} organizations")
```

#### Org.from_id()

```python
@classmethod
def from_id(
    org_id: str,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L136-L154)

Fetch an organization by its ID.

**Parameters**

- **org_id** (`str`): ID of the organization, beginning with `og_`.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No organization has this ID.

**Returns**

- `Org`

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
print(f"Organization: {org.name}")
```

#### Org.invite_user()

```python
def invite_user(
    user_id: str,
    *,
    role: roboto.domain.orgs.org_records.OrgRoleName = OrgRoleName.user,
) -> roboto.domain.orgs.org_invite.OrgInvite
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L400-L444)

Invite a user to join this organization.

Roboto emails the invitation to the user, who need not have a Roboto account yet. The user joins with `role` when they accept it ([`accept()`](/docs/reference/python-sdk/roboto/domain/orgs/org_invite#roboto.domain.orgs.org_invite.OrgInvite.accept)). The invitation expires 14 days after it is sent.

**Parameters**

- **user_id** (`str`): ID of the user to invite, which is their email address.
- **role** (`roboto.domain.orgs.org_records.OrgRoleName`): Role the invited user gets by accepting. Only an organization owner or a Roboto administrator may invite someone as [`admin`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgRoleName.admin), and no invitation may carry `owner`.

**Returns**

- `roboto.domain.orgs.org_invite.OrgInvite`: The new invitation.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The organization has been deleted.
- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): `role` is `owner`; the user is already a member or is a service user; the user's email address is outside the email domains the Roboto deployment accepts; or the deployment does not support invitation roles, in which case it still created the invitation, with the `user` role, and declining the invitation withdraws it.
- [`RobotoConflictException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoConflictException): The user already has a pending invitation to the organization.
- [`RobotoLimitExceededException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoLimitExceededException): The organization's members and pending invitations already reach its limit on members.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): `role` is `admin` and the caller is not an owner of the organization, or the Roboto deployment lets only organization administrators invite users and the caller is not one.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
invite = org.invite_user("alice@example.com")
print(f"Invitation created: {invite.invite_id}")
```

#### Org.invites()

```python
def invites() -> collections.abc.Collection[roboto.domain.orgs.org_invite.OrgInvite]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L446-L458)

Fetch this organization's pending invitations, oldest first.

Pending invitations past their expiry are included, with the status [`Expired`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgInviteStatus.Expired).

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
for invite in org.invites():
    print(f"Pending invite for: {invite.invited_user_id}")
```

**Returns**

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

#### Org.new_email_domain_verification_record()

```python
def new_email_domain_verification_record(
    email_domain: str,
) -> roboto.domain.orgs.org_operations.EmailDomainVerificationChallengeResponse
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L460-L488)

Create a verification of an email domain for this organization, with a new DNS TXT record.

The new record replaces the record of any verification of the domain the organization has, which then no longer completes it. Only organization administrators may verify email domains.

**Parameters**

- **email_domain** (`str`): Email domain to verify, such as `example.com`.

**Returns**

- `roboto.domain.orgs.org_operations.EmailDomainVerificationChallengeResponse`: The verification, and the DNS TXT record to publish at the domain. Roboto shows the record's value only in this response.

**Raises**

- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): The domain is not an email domain, or is on Roboto's list of domains that no organization may bind.
- [`RobotoLimitExceededException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoLimitExceededException): The organization is verifying as many other email domains at once as it may.
- [`RobotoOrgEmailDomainChangeRefusedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoOrgEmailDomainChangeRefusedException): Another organization holds the domain.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
record = org.new_email_domain_verification_record("example.com").verification_txt_record
print(record.name, record.value)
```

#### Org.refresh()

```python
def refresh() -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L490-L505)

Fetch this organization's record from Roboto, replacing the copy this instance holds.

**Returns**

- `Org`: This instance, with its record updated from Roboto's response.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The organization has been deleted.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
org.refresh()
```

#### Org.remove_role_from_user()

```python
def remove_role_from_user(
    user_id: str,
    role: roboto.domain.orgs.org_records.OrgRoleName,
) -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L263-L293)

Revoke a role from a member of this organization.

The user stays a member; `remove_user` removes them. Revoking [`admin`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgRoleName.admin) also revokes [`owner`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgRoleName.owner), and revoking a role the member does not hold changes nothing. A member can revoke their own roles.

**Parameters**

- **user_id** (`str`): ID of the member, which for a person is their email address.
- **role** (`roboto.domain.orgs.org_records.OrgRoleName`): Role to revoke: `admin` or `owner`.

**Returns**

- `Org`: This instance. Its record is unchanged until you fetch it again.

**Raises**

- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): `role` is `user`, which every member holds; or `role` is `owner` and the member is the organization's only owner.
- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The user is not a member of this organization.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): The member is someone else, and the caller does not hold a higher role than them.

**Usage**

```python
from roboto.domain.orgs import Org, OrgRoleName
org = Org.from_id("og_12345")
org.remove_role_from_user("alice@example.com", OrgRoleName.admin)
```

#### Org.remove_user()

```python
def remove_user(user_id: str) -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L507-L530)

Remove a member from this organization, with all their roles in it.

Removing a user who is not a member succeeds and changes nothing.

**Parameters**

- **user_id** (`str`): ID of the member to remove, which for a person is their email address.

**Returns**

- `Org`: This instance. Its record is unchanged until you fetch it again.

**Raises**

- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): The member is the organization's only owner, or is an owner removing themselves.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): The member is someone else, and the caller does not hold a higher role than them.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
org.remove_user("alice@example.com")
```

#### Org.set_email_domain_auto_join()

```python
def set_email_domain_auto_join(
    email_domain: str,
    enabled: bool,
) -> roboto.domain.orgs.org_records.OrgEmailDomainRecord
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L532-L559)

Turn auto-join on or off for an email domain this organization holds.

With auto-join on, people who sign up with an address at the domain join this organization. Turning it on needs a verified domain, or one Roboto has provisionally approved with an approval that has not expired. Only organization administrators may change auto-join.

**Parameters**

- **email_domain** (`str`): Email domain to change, such as `example.com`.
- **enabled** (`bool`): Whether to turn auto-join on.

**Returns**

- `roboto.domain.orgs.org_records.OrgEmailDomainRecord`: Record of the email domain, with the change applied.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): This organization does not hold the domain.
- [`RobotoOrgEmailDomainChangeRefusedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoOrgEmailDomainChangeRefusedException): `enabled` is `True`, auto-join is off, and the domain is neither verified nor provisionally approved by Roboto with an approval that has not expired.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
org.set_email_domain_auto_join("example.com", enabled=False)
```

#### Org.start_email_domain_verification()

```python
def start_email_domain_verification(
    email_domain: str,
) -> roboto.domain.orgs.org_operations.BindEmailDomainResponse
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L561-L598)

Bind an email domain to this organization, or start a verification of it where Roboto requires one.

Where Roboto requires email domains to be verified, a domain the organization holds verified, or provisionally approved by Roboto with an approval that has not expired, is returned bound, and any other domain gets a verification. A verification already in progress is returned without its DNS TXT record, which Roboto shows only once; `new_email_domain_verification_record` issues a new record. Publish the record at the domain, then call `check_email_domain_verification`. Where Roboto does not require verification, the domain binds at once, and a domain the organization already holds is returned as it is. Only organization administrators may bind email domains.

**Parameters**

- **email_domain** (`str`): Email domain to bind, such as `example.com`.

**Returns**

- `roboto.domain.orgs.org_operations.BindEmailDomainResponse`: What became of the domain: [`Bound`](/docs/reference/python-sdk/roboto/domain/orgs/org_operations#roboto.domain.orgs.org_operations.EmailDomainBindingOutcome.Bound), with the domain as the organization holds it; or [`VerificationStarted`](/docs/reference/python-sdk/roboto/domain/orgs/org_operations#roboto.domain.orgs.org_operations.EmailDomainBindingOutcome.VerificationStarted), with the verification and, when this call started it, the DNS TXT record to publish.

**Raises**

- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): The domain is not an email domain, or is on Roboto's list of domains that no organization may bind.
- [`RobotoLimitExceededException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoLimitExceededException): The organization is verifying as many email domains at once as it may.
- [`RobotoOrgEmailDomainChangeRefusedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoOrgEmailDomainChangeRefusedException): Another organization holds the domain.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): Roboto does not require email domains to be verified, and the caller's email address is not at the domain.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
response = org.start_email_domain_verification("example.com")
if response.verification_txt_record is not None:
    print(response.verification_txt_record.name, response.verification_txt_record.value)
```

#### Org.to_dict()

```python
def to_dict() -> dict[str, Any]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L662-L674)

Return this organization's record as a JSON-serializable dictionary.

**Returns**

- `dict[str, Any]`: [`OrgRecord`](/docs/reference/python-sdk/roboto/domain/orgs/org_records#roboto.domain.orgs.org_records.OrgRecord) of the organization, as a JSON-compatible dictionary.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
org_data = org.to_dict()
print(f"Org created: {org_data.get('created')}")
```

#### Org.unbind_email_domain()

```python
def unbind_email_domain(email_domain: str) -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L640-L660)

Unbind an email domain from this organization, and remove any verification of the domain in progress.

People who sign up with an address in the domain no longer join the organization. Unbinding a domain the organization does not hold succeeds and changes nothing.

**Parameters**

- **email_domain** (`str`): Email domain to unbind, such as `example.com`.

**Returns**

- `Org`: This instance. Its record is unchanged until you fetch it again.

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
org.unbind_email_domain("example.com")
```

#### Org.update()

```python
def update(update: roboto.domain.orgs.org_operations.UpdateOrgRequest) -> Org
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L600-L624)

Update this organization's name or status.

Only a Roboto administrator may set the status.

**Parameters**

- **update** (`roboto.domain.orgs.org_operations.UpdateOrgRequest`): Changes to apply. A field left `None` is unchanged.

**Returns**

- `Org`: This instance, with its record updated from Roboto's response.

**Raises**

- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): `update` sets the organization's status, and the caller is not a Roboto administrator.

**Usage**

Rename an organization:

```python
from roboto.domain.orgs import Org, UpdateOrgRequest, OrgRecordUpdates
org = Org.from_id("og_12345")
request = UpdateOrgRequest(updates=OrgRecordUpdates(name="New Company Name"))
org.update(request)
```

#### Org.users()

```python
def users() -> collections.abc.Collection[roboto.domain.orgs.org_records.OrgUserRecord]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/orgs/org.py#L626-L638)

Fetch this organization's members, each with their roles.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The caller cannot see this organization.

**Returns**

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

**Usage**

```python
from roboto.domain.orgs import Org
org = Org.from_id("og_12345")
for user_record in org.users():
    print(f"Member: {user_record.user.name} ({user_record.roles})")
```
