OpenapiIam
Makes a new organization — the account your users, applications, roles,…
Makes a new organization — the account your users, applications, roles, projects and workspaces are all named inside.
POST /v1/iam/organizations
| Address | https://api.hanzo.ai/v1/iam/organizations |
| Method | POST |
| Operation | createOrganization |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Makes a new organization — the account your users, applications, roles, projects and workspaces are all named inside. It is the first write in a new tenant, and a name already in use is refused rather than taken over.
Request
74 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
accountItems | body | iam.AccountItem[] | — | |
accountItems[].modifyRule | body | string | — | |
accountItems[].name | body | string | — | |
accountItems[].regex | body | string | — | |
accountItems[].tab | body | string | — | |
accountItems[].viewRule | body | string | — | |
accountItems[].visible | body | boolean | — | |
accountMenu | body | string | — | |
avatar | body | string | — | |
balanceCredit | body | number | — | |
balanceCurrency | body | string | — | |
countryCodes | body | string[] | — | |
createdAt | body | string (date-time) | — | |
createdTime | body | string | — | |
dcrPolicy | body | string | — | |
defaultApplication | body | string | — | |
defaultAvatar | body | string | — | |
defaultPassword | body | string | — | |
deleted | body | boolean | — | |
disableSignin | body | boolean | — | |
displayName | body | string | — | |
emoji | body | string | — | |
enableSoftDeletion | body | boolean | — | |
enableTour | body | boolean | — | |
failedSigninFrozenTime | body | integer | — | |
failedSigninLimit | body | integer | — | |
favicon | body | string | — | |
founder | body | string | — | |
hasPrivilegeConsent | body | boolean | — | |
id | body | string | — | |
initScore | body | integer | — | |
ipRestriction | body | string | — | |
ipWhitelist | body | string | — | |
isPersonal | body | boolean | — | |
isProfilePublic | body | boolean | — | |
kerberosKdcHost | body | string | — | |
kerberosKeytab | body | string | — | |
kerberosRealm | body | string | — | |
kerberosServiceName | body | string | — | |
languages | body | string[] | — | |
ldapAttributes | body | string[] | — | |
logo | body | string | — | |
logoDark | body | string | — | |
masterPassword | body | string | — | |
masterVerificationCode | body | string | — | |
mfaItems | body | iam.MfaItem[] | — | |
mfaItems[].name | body | string | — | |
mfaItems[].rule | body | string | — | |
mfaRememberInHours | body | integer | — | |
name | body | string | — | |
navItems | body | string[] | — | |
orgBalance | body | number | — | |
owner | body | string | — | |
passwordExpireDays | body | integer | — | |
passwordObfuscatorKey | body | string | — | |
passwordObfuscatorType | body | string | — | |
passwordOptions | body | string[] | — | |
passwordSalt | body | string | — | |
passwordType | body | string | — | |
tags | body | string[] | — | |
themeData | body | iam.ThemeData | — | |
themeData.borderRadius | body | integer | — | |
themeData.colorPrimary | body | string | — | |
themeData.isCompact | body | boolean | — | |
themeData.isEnabled | body | boolean | — | |
themeData.themeType | body | string | — | |
updatedAt | body | string (date-time) | — | |
useEmailAsUsername | body | boolean | — | |
usePermanentAvatar | body | boolean | — | |
userBalance | body | number | — | |
userNavItems | body | string[] | — | |
userTypes | body | string[] | — | |
websiteUrl | body | string | — | |
widgetItems | body | string[] | — |
Response
| Status | Body | Meaning |
|---|---|---|
200 | iam.Organization | ok |
200 body — 74 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
accountItems | body | iam.AccountItem[] | — | |
accountItems[].modifyRule | body | string | — | |
accountItems[].name | body | string | — | |
accountItems[].regex | body | string | — | |
accountItems[].tab | body | string | — | |
accountItems[].viewRule | body | string | — | |
accountItems[].visible | body | boolean | — | |
accountMenu | body | string | — | |
avatar | body | string | — | How the organization appears across Hanzo — the square mark beside its name — as an image or as one emoji, never both. |
balanceCredit | body | number | — | |
balanceCurrency | body | string | — | |
countryCodes | body | string[] | — | |
createdAt | body | string (date-time) | — | |
createdTime | body | string | — | |
dcrPolicy | body | string | — | |
defaultApplication | body | string | — | |
defaultAvatar | body | string | — | |
defaultPassword | body | string | — | |
deleted | body | boolean | — | |
disableSignin | body | boolean | — | |
displayName | body | string | — | |
emoji | body | string | — | |
enableSoftDeletion | body | boolean | — | |
enableTour | body | boolean | — | |
failedSigninFrozenTime | body | integer | — | |
failedSigninLimit | body | integer | — | Per-organization signin throttle. Zero means "inherit the application default"; a non-zero value overrides it. |
favicon | body | string | — | |
founder | body | string | — | Founder is the stable storage id of the identity that provisioned this org (self-service onboarding). |
hasPrivilegeConsent | body | boolean | — | |
id | body | string | — | |
initScore | body | integer | — | |
ipRestriction | body | string | — | |
ipWhitelist | body | string | — | |
isPersonal | body | boolean | — | |
isProfilePublic | body | boolean | — | |
kerberosKdcHost | body | string | — | |
kerberosKeytab | body | string | — | |
kerberosRealm | body | string | — | |
kerberosServiceName | body | string | — | |
languages | body | string[] | — | |
ldapAttributes | body | string[] | — | |
logo | body | string | — | |
logoDark | body | string | — | |
masterPassword | body | string | — | |
masterVerificationCode | body | string | — | |
mfaItems | body | iam.MfaItem[] | — | |
mfaItems[].name | body | string | — | |
mfaItems[].rule | body | string | — | |
mfaRememberInHours | body | integer | — | |
name | body | string | — | |
navItems | body | string[] | — | |
orgBalance | body | number | — | Balance fields are read-only mirrors; authoritative balances live in Commerce (billing.hanzo.ai). |
owner | body | string | — | |
passwordExpireDays | body | integer | — | |
passwordObfuscatorKey | body | string | — | |
passwordObfuscatorType | body | string | — | |
passwordOptions | body | string[] | — | |
passwordSalt | body | string | — | |
passwordType | body | string | — | |
tags | body | string[] | — | |
themeData | body | iam.ThemeData | — | |
themeData.borderRadius | body | integer | — | |
themeData.colorPrimary | body | string | — | |
themeData.isCompact | body | boolean | — | |
themeData.isEnabled | body | boolean | — | |
themeData.themeType | body | string | — | |
updatedAt | body | string (date-time) | — | |
useEmailAsUsername | body | boolean | — | |
usePermanentAvatar | body | boolean | — | |
userBalance | body | number | — | |
userNavItems | body | string[] | — | |
userTypes | body | string[] | — | |
websiteUrl | body | string | — | |
widgetItems | body | string[] | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo iam organizations createimport { Configuration, IamApi } from 'hanzoai';
const api = new IamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.createOrganization({ accountItems: [{"modifyRule":"<modifyRule>","name":"<name>","regex":"<regex>","tab":"<tab>"}], accountMenu: "<accountMenu>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import IamApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = IamApi(client).create_organization(account_items=[{"modifyRule":"<modifyRule>","name":"<name>","regex":"<regex>","tab":"<tab>"}], account_menu="<accountMenu>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.IamAPI.CreateOrganization(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, iam_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = iam_api::create_organization(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.IamApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new IamApi(client).createOrganization();curl -X POST https://api.hanzo.ai/v1/iam/organizations \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountItems": [
{
"modifyRule": "<modifyRule>",
"name": "<name>",
"regex": "<regex>",
"tab": "<tab>"
}
],
"accountMenu": "<accountMenu>"
}'Tool iam, op createOrganization — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "iam",
"arguments": {
"op": "createOrganization",
"input": {
"accountItems": [
{
"modifyRule": "<modifyRule>",
"name": "<name>",
"regex": "<regex>",
"tab": "<tab>"
}
],
"accountMenu": "<accountMenu>"
}
}
}
}'How is this guide?