# Organizations

An organization pays for the workspaces under it. Their jobs are charged to the organization balance. Use one when a company has several teams and wants one balance and one budget.

A workspace is on its own or under one parent. The parent is an organization or the default workspace of a person. A parent cannot have a parent.

## Create an organization

Open the first breadcrumb menu in the console header and choose **New organization**.

Only an owner or an admin of an organization can add funds, withdraw money or list deposits. See [Workspace members](https://inference.ai.exchange/docs/members.md).

## Change the profile and the logo

1. Open **Settings** in the account menu of the organization.
2. In the **Profile** row, select **Edit profile**, change the name or description, and select **Save changes**.

To change the logo, select it or drop an image on it. The logo must be a PNG, JPEG or WebP image of 1 MB or less. An owner, an admin, or a member with the **Settings** level of edit can change it. Select **Remove** to go back to the generated picture. The handle never changes.

## Let people join with an email domain

People who sign up with an email address at your company domain can join as members. Only an owner or an admin can set this up.

1. In the **Verified domains** row, select **Add domain** and enter the domain, such as `example.com`.
2. Add the TXT record that the page shows at your DNS provider. The name is `_liquid-verify.` followed by the domain.
3. Select **Verify domain**. Try again if DNS has not updated.

- A domain has no effect until it is verified, and only one organization can verify it.
- A public email domain, such as `gmail.com`, is not allowed.
- A person joins only with an address that their identity provider verified. People who already have an account need an invitation.
- **Remove** stops new people from joining. The people who joined stay members.

The [audit log](https://inference.ai.exchange/docs/audit-log.md) records `ADD_DOMAIN`, `VERIFY_DOMAIN`, `REMOVE_DOMAIN` and `JOIN_BY_DOMAIN`.

## Invite people by email

An owner or an admin can invite a person. A member with the **Members** level of invite can invite the member role.

1. Open **Members** and select **Invite people**.
2. Enter the email address and choose a role. Only an owner can invite an owner.
3. Select **Create invitation**. The exchange emails the link. If the dialog says the email was not sent, copy the link and send it yourself.

- The link works for 7 days. The page shows it only once.
- **New link** and **Send again** email a new link. **Revoke** stops an invitation.

The person must sign in or sign up with the invited address. An account with another address cannot accept it. A person with an account can also **Accept** or **Decline** in the bell in the header. They join with the invited role.

The [audit log](https://inference.ai.exchange/docs/audit-log.md) records `INVITE_MEMBER`, `RESEND_INVITATION`, `REVOKE_INVITATION`, `ACCEPT_INVITATION` and `DECLINE_INVITATION`.

## Leave an organization

Select **Leave organization** on the **Settings** page and confirm.

- You lose the access that the organization gave you, including your member roles in its workspaces.
- A role that you hold directly in a workspace stays. An organization owner can change or remove it.
- The same occurs when an owner or an admin removes you.

An organization keeps at least one owner. The last owner must make another person an owner first.

## Move funds between workspaces

Move money between workspaces that you own or administer. The money of an organization stays in it, so the exchange refuses a move between an organization and a workspace outside it (`outside_organization`).

1. Open **Credits** for the workspace that holds the money.
2. In **Move funds**, select **Move funds**, choose the receiving workspace and the amount, and confirm.

The paid part of the balance moves first. Credit moves only for an amount over it.

- A workspace under an organization holds no money, so it is not an end of a move.
- You must be an owner or an admin of both workspaces, with a recent sign-in.

The [audit log](https://inference.ai.exchange/docs/audit-log.md) records `TRANSFER_FUNDS` in both workspaces.

## Close a workspace

Only an owner or an admin can close a workspace. The exchange refuses the close while the workspace holds a balance (`holds_money`) or a job is in flight (`open_hold`). Move the balance to another workspace first.

- An organization cannot move its balance out. See [Close an organization that holds money](#close-an-organization-that-holds-money).
- An operator can reinstate a closed workspace until it is purged. A workspace under a closed organization comes back only after the organization.

## Create a workspace in an organization

Open the workspace menu while you act for an organization, and select **New workspace**.

1. Enter a name.
2. Choose who joins. **Everyone** is the default. Clear it to select members one by one.
3. Select **Create**.

Each added person gets a notice in the bell and the default access of a member. An owner or an admin can change it in the [member's drawer](https://inference.ai.exchange/docs/members.md).

## Choose who can access a workspace

A workspace under an organization has one of two settings. Owners and admins of the workspace can change it in **Settings**, in the **Who can access** card.

- **All organization members**: each member of the organization is a member of the workspace, including people who join the organization later. Choosing this adds all current members at once, with a notice in the bell.
- **Only members that an admin adds**: an owner or an admin adds each person. The exchange removes no one when you choose this. Each person keeps access until removed or until they leave the organization.

A new workspace uses the first setting. A workspace that you move under an organization uses the second. The [audit log](https://inference.ai.exchange/docs/audit-log.md) records `SET_WORKSPACE_ACCESS_MODE`.

## Put a workspace under an organization

Who can move a workspace:

- An owner or an admin of the workspace and of each parent that the change touches.
- A member with the **Workspaces** level of create in the new parent, for their own workspace.
- A move to a default workspace or no parent needs a direct workspace owner.

Steps:

1. Open the second breadcrumb menu and select **Settings for** your workspace.
2. In the **Spends from** card, choose the organization or your default workspace.

Each member of the workspace must be a member of the organization. Otherwise the exchange refuses the move (`outside_members`) and names each person. Remove them from the workspace or invite them to the organization. The exchange also refuses the move when a [guardrail](https://inference.ai.exchange/docs/guardrails.md) of the workspace cannot merge with the guardrail of the organization.

To remove the parent, select **None: this workspace pays for itself**. The exchange refuses this while the workspace holds money or a job is in flight. The move is in the [audit log](https://inference.ai.exchange/docs/audit-log.md) as `MOVE_WORKSPACE`.

## What changes

- A job holds its price cap from the balance of the parent. Settlement and refunds go to the parent. The workspace balance stays empty.
- A deposit to the workspace credits the parent.
- The exchange refuses a job if the parent is suspended. A parent cannot close while a workspace under it is open.
- Owners and admins of the parent read the [audit log](https://inference.ai.exchange/docs/audit-log.md) rows of the workspaces under it.
- Owners and admins of an organization are admins in every workspace under it.
  - They show with a badge in the member list and lose the access when they leave the organization.
  - They have full access to each provider that a workspace registered.
  - An organization owner can make a member an owner, and change or remove an owner, in each workspace. A default workspace as parent gives no such access.

## Budgets

The budget in the default [guardrail](https://inference.ai.exchange/docs/guardrails.md) of the parent counts every job that the parent pays for: its own and those of each workspace under it. Two workspaces cannot pass it together.

- The default guardrail of a workspace counts that workspace only. The guardrail of the parent can also set a budget for each workspace.
- A workspace that leaves keeps what it spent in the period.

## Close an organization that holds money

An operator must close an organization that holds a balance:

1. Open the organization, choose **Close**, and select the workspace that receives the balance. You must be an owner or an admin of both.
2. Send the request. The organization shows **Pending close** and works as before. You can withdraw the request.
3. An operator approves or refuses. An approval moves the whole balance to your workspace and closes the organization. A refusal changes nothing.

The request fails with `close_request_open` if one is open, with `has_open_children` while a workspace under the organization is open, and with `open_hold` while a job is in flight. The [audit log](https://inference.ai.exchange/docs/audit-log.md) records `REQUEST_CLOSE` and the decision.
