Opens a named wallet account for the caller's org.
Opens a named wallet account for the caller's org.
POST /v1/wallet/accounts
| Address | https://api.hanzo.ai/v1/wallet/accounts |
| Method | POST |
| Operation | post_wallet_accounts |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Opens a named wallet account for the caller's org. An account is a GROUPING of wallets, not a key or a balance: wallets are created under one and can be listed by it. The org is stamped by the server from the validated principal, so a request can never open an account in another tenant.
Request
1 field, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
name | body | string | — | Name is the account's label. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | WalletAccount | ok |
200 body — 4 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
createdAt | body | integer | — | CreatedAt is when the account was opened, Unix seconds. |
id | body | string | — | ID is the account id, minted by the server as "acct_" + 24 hex. |
name | body | string | — | Name is the label given at creation, trimmed and required. |
org | body | string | — | Org is the tenant that owns the account, stamped from the validated principal rather than taken from the request. |
Failure carries the platform error shape — see Errors.
Examples
hanzo wallets accounts createimport { Configuration, WalletApi } from 'hanzoai';
const api = new WalletApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postWalletAccounts({ name: "<name>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import WalletApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = WalletApi(client).post_wallet_accounts(name="<name>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.WalletAPI.PostWalletAccounts(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, wallet_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = wallet_api::post_wallet_accounts(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WalletApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new WalletApi(client).postWalletAccounts();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X POST https://api.hanzo.ai/v1/wallet/accounts \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>"
}'The door reaches wallet through the wallets tool, which names its 7 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
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": "list_wallets"
}
}
}'How is this guide?