
# Setting up an organization

Your company's organization is created the first time someone signs in to the console at your company's email domain, and that person becomes its owner. Claim more domains in **Settings** > **Identity**. It worked when the domain shows **Verified** and colleagues signing in from it are offered **Join**.

## Ask your agent

```text
Start this app in my company's organization: here's the prompt from the console's Start an app page.
```

The agent runs its `agc init --join agcj_…` line as given, and the app is created in that organization, already yours.

## Do it in the console

| To do this | Go here |
|---|---|
| Rename the organization | **Settings** > **General** > **Name** > **Save** |
| Claim another email domain | **Settings** > **Identity** > **1 · Email domains** > **Add a domain** |
| Choose what **Join** does | **Settings** > **General** > **How people join** |
| Make an organization with no domain | Organization switcher > **New organization** |
| Delete an empty organization | **Settings** > **General** > **Delete this organization** |
| Follow the setup checklist (owners) | The home's **Set up this organization** strip; each step opens its page |

Builders see the same Settings pages view only, with a lock beside the heading.

### Claim a domain

1. Under **Add a domain**, type the domain, e.g. `example.test`.
2. If your sign-in address is at that domain, press **Add domain**: it's verified at once.
3. Otherwise also give an address there that receives mail, then press **Add domain**. A six-digit code, good for 15 minutes, goes to it.
4. Type the code beside the domain (it shows **Waiting for the code**) and press **Verify**. **Release** gives a domain up.

## Organizations and roles

An organization is the single container on Agent Cloud: it holds members, apps, deployment targets, connections, context docs and an activity log. Members are **owners**, who run the organization and can approve any of its apps, or **builders**, who build and approve the apps they own.

Everyone gets a Personal organization at first sign-in. It never takes a domain or company sign-in. It is the only organization for people at public email services (gmail.com, outlook.com, hotmail.com, yahoo.com, icloud.com, proton.me and others on a fixed list), whose domains can't be claimed. A company organization holds any number of domains, each claimed by email, and at most one company sign-in provider. What each role may do, the last-owner rule and what removing someone does: [Members, roles, invites, join requests](/docs/owners/members-roles-invites-join-requests.md#what-each-role-can-do).

- **Apps stay in one organization for good.** A join code puts the app in its organization, owned by the person who made the code; a connected Builder can create more apps there without a new code. An unclaimed agent's app joins one of a person's organizations when they claim it or approve its first release, connecting the agent or not ([Agent identities](/docs/owners/managing-agents.md#agent-identities-and-purposes)).
- **Company sign-in** moves the organization from manual mode (owners run membership) to provisioned mode, where the provider adds and removes members and groups decide roles ([Company sign-in and SCIM](/docs/owners/company-sign-in-and-scim.md)).
- **URLs** are `/console/o/<slug>/…`. The slug, like `acme-1a2b3c`, is made once from the first name and never changes on rename; `agc init` writes it as `[app] org`.

## How it works

### The first sign-in at a new domain

The first person to sign in with a verified address at a company domain that no organization holds or is claiming gets a new organization named after the domain's first label (`Example` from `example.test`). Their address verifies the domain, and they become its first owner, in manual mode.

### Colleagues who sign in later

A person whose first sign-in is at a held domain, and who is only in their Personal organization, sees a one-time page, "<Name> is on Agent Cloud. Join <Name>?", listing each organization at the domain with its members, apps and owners, largest first.

| Choice | What it does |
|---|---|
| **Join** | Adds them as a builder at once (the default, `direct`). If **How people join** is **Ask an owner** (`ask`), it reads **Ask to join** and files a request. |
| **Create my own** | A separate organization they own, default "<first name>'s org", never with a name used at the domain. It doesn't claim the domain, so colleagues never see it. |
| **Not now** | Keeps them in Personal. |

Later, the switcher offers the domain's other organizations under **Also at <domain>**, never a provisioned one.
Domains aren't exclusive: several organizations may hold one, and all appear in join lists. Check the owners on the join page before trusting that one is the company's.

### New organization and deleting

**New organization** makes one with no domain, for a company you build for from outside. Anyone signed in to the console can make one, and the creator owns it. It has no domain until an owner claims one.

Only an empty organization can be deleted: no apps (counting deleted ones within their 30-day restore window), targets or connections; the card says what's in the way. Type the name and press **Delete organization**; members, invites, domains, docs, activity and codes go with it. Nobody's only organization can be deleted.

## How do I move an app to another organization?

Use **Move to an organization** in the app's settings, or the owner's Builder agent runs:

```bash
agc apps move camp-bookings --to acme
```

The app's owner must own its organization and belong to the destination. Its name, address, data and releases stay; connections stay behind (`data.stayed`). Then set `[app] org` to the new slug and use an agent connected there. Refusals change nothing: `move.not_owner` or `move.not_member` (exit 12), `move.same_org` (exit 2), `move.rollback_active` (exit 14), and `move.db_login_open` (exit 14) while a production database login made in the console is open for the app.

## How do I give an app to another person?

Use **Give to another person** in the app's settings, or the owner's Builder agent runs:

```bash
agc apps give camp-bookings --to sam@example.com
```

The person accepts it in their own console, into any organization of theirs, Personal included, within 7 days; `data.offer.url` is the page they open. Nothing changes until they accept. Refusals: `give.not_owner`, `give.pending` (exit 12), `give.self` (exit 2).

## Moving the console host

The console has its own address, `https://console.agent.cloud`, and its paths drop the `/console` prefix. There's nothing to set: opening `https://agent.cloud/console` lands you on `console.agent.cloud`. Members sign in once more on the new host, and old bookmarks keep working.

| What | What happens |
|---|---|
| Old links | A `GET` or `HEAD` to `/console…`, `/a/<id>`, `/r/<id>`, `/claim/<app>` or `/invite/…` gets a 301 to the same path minus `/console`, query kept: `agent.cloud/console/apps/x` goes to `console.agent.cloud/apps/x`. |
| Sessions | `__Host-` cookies, bound to one host, so each person signs in once on the new host; length and access don't change. |
| Company sign-in | `/auth/google`, `/auth/github` and `/auth/sso/…` redirect before they begin, so the provider tile's **Sign-on URL** (`https://agent.cloud/auth/sso/<org>`) needs no edit. One already under way at the switch finishes there. |

The API (`https://agent.cloud/v1`), `agc` and its installer, your apps' addresses, app sign-in (`/auth/apps/callback`) and target runners don't move.

## Errors

Console messages, on a "That didn't go through" page:

| Message (HTTP) | Fix |
|---|---|
| "<domain> is a public email service; an organization can't claim it." (400) | Use your company domain. |
| "Your address isn't at <domain>. Name an address at <domain> that can receive a code." (400) | Fill in the second box. |
| "That isn't the code. …" (400) | Retry; a fifth wrong one voids it. |
| "5 wrong codes for <domain>: that code is void. …" (429), "That code has expired. …" (410) | Claim the domain again. |
| "5 claims of <domain> in a day is the limit. …" (429) | Wait 24 hours. |
| "A Personal organization never takes a domain. …" (409) | Switch organizations. |
| "<domain> already has an organization called <name>. …" (409) | Join it, or pick another name. |

`approval.bad_org` (exit 1): the chosen organization isn't one the approver is in. Every other code, its exit and fix: [Error code catalog](/docs/reference/error-code-catalog.md).

## Limits

| Limit | Value |
|---|---|
| Domain code | 6 digits, 15 minutes, void after 5 wrong tries |
| Claims of one domain per organization | 5 a day |
| Organization name | 60 characters |

## Related

- [Members, roles, invites, join requests](/docs/owners/members-roles-invites-join-requests.md)
- [Company sign-in (SSO) and SCIM](/docs/owners/company-sign-in-and-scim.md)
- [Managing agents](/docs/owners/managing-agents.md)
- [Quickstart: start from the console](/docs/getting-started/quickstart-new-app.md#start-from-the-console)
- [Approvals](/docs/concepts/approvals.md)

<!-- feedback:start -->
---
Wrong, outdated or unclear? Run `agc feedback docs "owners/setting-up-an-organization: <what is wrong>" --body <file>` with the sentence quoted in the file. No code or app data is sent.
<!-- feedback:end -->
