Create organizations

Makes a new organization — the account your users, applications, roles, projects and workspaces are all named inside.

POST /v1/iam/organizations

Addresshttps://api.hanzo.ai/v1/iam/organizations
MethodPOST
OperationcreateOrganization
AuthAuthorization: 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

75 fields, body application/json (required).

FieldInTypeRequiredDescription
accountItemsbodyiam.AccountItem[]—
accountItems[].modifyRulebodystring—
accountItems[].namebodystring—
accountItems[].regexbodystring—
accountItems[].tabbodystring—
accountItems[].viewRulebodystring—
accountItems[].visiblebodyboolean—
accountMenubodystring—
avatarbodystring—
balanceCreditbodynumber (double)—
balanceCurrencybodystring—
countryCodesbodystring[]—
createdAtbodystring (date-time)—
createdTimebodystring—
dcrPolicybodystring—
defaultApplicationbodystring—
defaultAvatarbodystring—
defaultPasswordbodystring—
deletedbodyboolean—
disableSigninbodyboolean—
displayNamebodystring—
emojibodystring—
enableSoftDeletionbodyboolean—
enableTourbodyboolean—
failedSigninFrozenTimebodyinteger (int64)—
failedSigninLimitbodyinteger (int64)—
faviconbodystring—
founderbodystring—
hasPrivilegeConsentbodyboolean—
idbodystring—
initScorebodyinteger (int64)—
ipRestrictionbodystring—
ipWhitelistbodystring—
isPersonalbodyboolean—
isProfilePublicbodyboolean—
kerberosKdcHostbodystring—
kerberosKeytabbodystring—
kerberosRealmbodystring—
kerberosServiceNamebodystring—
languagesbodystring[]—
ldapAttributesbodystring[]—
logobodystring—
logoDarkbodystring—
masterPasswordbodystring—
masterVerificationCodebodystring—
mfaItemsbodyiam.MfaItem[]—
mfaItems[].namebodystring—
mfaItems[].rulebodystring—
mfaRememberInHoursbodyinteger (int64)—
namebodystring—
navItemsbodystring[]—
orgBalancebodynumber (double)—
ownerbodystring—
passwordExpireDaysbodyinteger (int64)—
passwordObfuscatorKeybodystring—
passwordObfuscatorTypebodystring—
passwordOptionsbodystring[]—
passwordSaltbodystring—
passwordTypebodystring—
platformbodyboolean—
tagsbodystring[]—
themeDatabodyiam.ThemeData—
themeData.borderRadiusbodyinteger (int64)—
themeData.colorPrimarybodystring—
themeData.isCompactbodyboolean—
themeData.isEnabledbodyboolean—
themeData.themeTypebodystring—
updatedAtbodystring (date-time)—
useEmailAsUsernamebodyboolean—
usePermanentAvatarbodyboolean—
userBalancebodynumber (double)—
userNavItemsbodystring[]—
userTypesbodystring[]—
websiteUrlbodystring—
widgetItemsbodystring[]—

Response

StatusBodyMeaning
200iam.Organizationok
202Approvalheld for approval
defaultproblem-detailsrefused

200 body — 75 fields.

FieldInTypeAlwaysDescription
accountItemsbodyiam.AccountItem[]—
accountItems[].modifyRulebodystring—
accountItems[].namebodystring—
accountItems[].regexbodystring—
accountItems[].tabbodystring—
accountItems[].viewRulebodystring—
accountItems[].visiblebodyboolean—
accountMenubodystring—
avatarbodystring—How the organization appears across Hanzo — the square mark beside its name — as an image or as one emoji, never both.
balanceCreditbodynumber (double)—
balanceCurrencybodystring—
countryCodesbodystring[]—
createdAtbodystring (date-time)—
createdTimebodystring—
dcrPolicybodystring—
defaultApplicationbodystring—
defaultAvatarbodystring—
defaultPasswordbodystring—
deletedbodyboolean—
disableSigninbodyboolean—
displayNamebodystring—
emojibodystring—
enableSoftDeletionbodyboolean—
enableTourbodyboolean—
failedSigninFrozenTimebodyinteger (int64)—
failedSigninLimitbodyinteger (int64)—Per-organization signin throttle.
faviconbodystring—
founderbodystring—Founder is the stable storage id of the identity that provisioned this org (self-service onboarding).
hasPrivilegeConsentbodyboolean—
idbodystring—
initScorebodyinteger (int64)—
ipRestrictionbodystring—
ipWhitelistbodystring—
isPersonalbodyboolean—
isProfilePublicbodyboolean—
kerberosKdcHostbodystring—
kerberosKeytabbodystring—
kerberosRealmbodystring—
kerberosServiceNamebodystring—
languagesbodystring[]—
ldapAttributesbodystring[]—
logobodystring—
logoDarkbodystring—
masterPasswordbodystring—
masterVerificationCodebodystring—
mfaItemsbodyiam.MfaItem[]—
mfaItems[].namebodystring—
mfaItems[].rulebodystring—
mfaRememberInHoursbodyinteger (int64)—
namebodystring—
navItemsbodystring[]—
orgBalancebodynumber (double)—Balance fields are read-only mirrors; authoritative balances live in Commerce (billing.hanzo.ai).
ownerbodystring—
passwordExpireDaysbodyinteger (int64)—
passwordObfuscatorKeybodystring—
passwordObfuscatorTypebodystring—
passwordOptionsbodystring[]—
passwordSaltbodystring—
passwordTypebodystring—
platformbodyboolean—Platform marks an organization the platform itself declares (init_data.json): the brand orgs and the others the seed creates, never one a customer made.
tagsbodystring[]—
themeDatabodyiam.ThemeData—
themeData.borderRadiusbodyinteger (int64)—
themeData.colorPrimarybodystring—
themeData.isCompactbodyboolean—
themeData.isEnabledbodyboolean—
themeData.themeTypebodystring—
updatedAtbodystring (date-time)—
useEmailAsUsernamebodyboolean—
usePermanentAvatarbodyboolean—
userBalancebodynumber (double)—
userNavItemsbodystring[]—
userTypesbodystring[]—
websiteUrlbodystring—
widgetItemsbodystring[]—

Failure carries the platform error shape — see Errors.

Examples

hanzo iam organizations create
import { 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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.IamAPI.CreateOrganization(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(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>"
           }
         }
       }
     }'

IAM API · All Hanzo APIs · Interactive reference

Was this page useful?