# Create orgs

URL: https://docs.hanzo.ai/docs/openapi/account/post-account-orgs

> Creates the caller's organization.

`POST /v1/account/orgs`

> [Account →](https://docs.hanzo.ai/docs/openapi/account) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/account/orgs` |
| **Method**    | `POST`                                 |
| **Operation** | `post_account_orgs`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Creates the caller's organization. Two flows, keyed on whether the caller
already has a home org (mirrors app/onboard/route.ts):

- FIRST-RUN (no home org): create + MOVE the user in as admin, so their next
  JWT carries the new owner and the cloud scopes everything to it. This is the
  path a fresh OAuth sign-up takes, from the sign-up application's org.
- ADDITIONAL (owner set): create the org but do NOT move the user — a move
  changes their IAM owner (stripping a SuperAdmin's status + orphaning their
  current org). They reach the new org via the OrgSwitcher, which re-scopes
  X-Org-Id without touching IAM membership. A personal-org request from someone
  who already has an org is meaningless → 409.

## Request

2 fields, body `application/json` (required).

| Field      | In   | Type    | Required | Description                                                                                                                  |
| ---------- | ---- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `name`     | body | string  | —        | Name is the organization's display name.                                                                                     |
| `personal` | body | boolean | —        | Personal asks for the caller's own space: the name is derived from their username and the slug auto-suffixes to stay unique. |

## Response

| Status    | Body                | Meaning |
| --------- | ------------------- | ------- |
| `200`     | account.onboardResp | ok      |
| `default` | problem-details     | refused |

`200` body — 5 fields.

| Field          | In   | Type    | Always | Description                                                                                                                                               |
| -------------- | ---- | ------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accessKey`    | body | string  | —      | AccessKey is the identifier of the org-scoped credential provisioning minted with the organization.                                                       |
| `accessSecret` | body | string  | —      | AccessSecret is that credential's confidential half, returned ONCE — on the response that mints it and never again.                                       |
| `additional`   | body | boolean | —      | Additional is true when the caller already had an organization and this one was created WITHOUT moving them into it — they reach it via the org switcher. |
| `displayName`  | body | string  | —      | DisplayName is the organization's human name.                                                                                                             |
| `org`          | body | string  | —      | Org is the created organization's slug, which is what X-Org-Id carries.                                                                                   |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo account orgs
```

**SDK**

**.ts**

```ts
import { Configuration, AccountApi } from 'hanzoai';

const api = new AccountApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postAccountOrgs({ name: "<name>", personal: false });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AccountApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AccountApi(client).post_account_orgs(name="<name>", personal=False)
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AccountAPI.PostAccountOrgs(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, account_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = account_api::post_account_orgs(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AccountApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AccountApi(client).postAccountOrgs();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/account/orgs \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "name": "<name>",
       "personal": false
     }'
```

**MCP**

MCP reaches **account** through the `account` tool, which names its 6 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_account_appearance"
         }
       }
     }'
```

---

[Account API](https://docs.hanzo.ai/docs/openapi/account) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
