Create avatar

Changes how an organization appears across Hanzo: the square mark beside its name, as an uploaded image or as a single emoji.

POST /v1/iam/organizations/avatar

Addresshttps://api.hanzo.ai/v1/iam/organizations/avatar
MethodPOST
OperationsetOrganizationAvatar
AuthAuthorization: Bearer $HANZO_API_KEY

Changes how an organization appears across Hanzo: the square mark beside its name, as an uploaded image or as a single emoji. Sending an image clears the emoji and sending an emoji clears the image — an organization has one mark, not a preference order — and sending neither clears both, which is how it goes back to being drawn as its initial.

An image is an https link or the bytes inline as a data URL, up to 96 KiB. Anyone who administers the organization may set this; it is not reserved to the platform.

It writes the two fields onto the stored row and touches nothing else, which update cannot do: update replaces the whole record, and a record read back first arrives masked, so a read-modify-write through it would persist the mask over the organization's own credential settings.

Request

4 fields, body application/json (required).

FieldInTypeRequiredDescription
avatarbodystring—
emojibodystring—
namebodystring—
ownerbodystring—

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 avatar
import { Configuration, IamApi } from 'hanzoai';

const api = new IamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.setOrganizationAvatar({ avatar: "<avatar>", emoji: "<emoji>" });
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).set_organization_avatar(avatar="<avatar>", emoji="<emoji>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.IamAPI.SetOrganizationAvatar(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::set_organization_avatar(&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).setOrganizationAvatar();
curl -X POST https://api.hanzo.ai/v1/iam/organizations/avatar \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "avatar": "<avatar>",
       "emoji": "<emoji>"
     }'

Tool iam, op setOrganizationAvatar — 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": "setOrganizationAvatar",
           "input": {
             "avatar": "<avatar>",
             "emoji": "<emoji>"
           }
         }
       }
     }'

IAM API · All Hanzo APIs · Interactive reference

Was this page useful?