OpenapiIam
Removes an organization and everything named inside it.
Removes an organization and everything named inside it. There is no undo, and every session issued under it stops working.
POST /v1/iam/organizations/delete
| Address | https://api.hanzo.ai/v1/iam/organizations/delete |
| Method | POST |
| Operation | deleteOrganization |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Removes an organization and everything named inside it. There is no undo, and every session issued under it stops working.
The built-in admin organization cannot be deleted — losing it would leave the account with no way back in.
Request
2 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
name | body | string | — | |
owner | body | string | — |
Response
| Status | Body | Meaning |
|---|---|---|
200 | iam.DeleteOrganizationOutput | ok |
200 body — 1 field.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
affected | body | boolean | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo iam organizations deleteimport { Configuration, IamApi } from 'hanzoai';
const api = new IamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.deleteOrganization({ name: "<name>", owner: "<owner>" });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).delete_organization(name="<name>", owner="<owner>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.IamAPI.DeleteOrganization(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::delete_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).deleteOrganization();curl -X POST https://api.hanzo.ai/v1/iam/organizations/delete \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"owner": "<owner>"
}'Tool iam, op deleteOrganization — 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": "deleteOrganization",
"input": {
"name": "<name>",
"owner": "<owner>"
}
}
}
}'How is this guide?