# Create avatar

URL: https://docs.hanzo.ai/docs/openapi/iam/setorganizationavatar

> 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`

> [IAM →](https://docs.hanzo.ai/docs/openapi/iam) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                    |
| ------------- | -------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/iam/organizations/avatar` |
| **Method**    | `POST`                                             |
| **Operation** | `setOrganizationAvatar`                            |
| **Auth**      | `Authorization: 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).

| Field    | In   | Type   | Required | Description |
| -------- | ---- | ------ | -------- | ----------- |
| `avatar` | body | string | —        |             |
| `emoji`  | body | string | —        |             |
| `name`   | body | string | —        |             |
| `owner`  | body | string | —        |             |

## Response

| Status    | Body             | Meaning           |
| --------- | ---------------- | ----------------- |
| `200`     | iam.Organization | ok                |
| `202`     | Approval         | held for approval |
| `default` | problem-details  | refused           |

`200` body — 75 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 (double)    | —      |                                                                                                                                                           |
| `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 (int64)    | —      |                                                                                                                                                           |
| `failedSigninLimit`         | body | integer (int64)    | —      | Per-organization signin throttle.                                                                                                                         |
| `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 (int64)    | —      |                                                                                                                                                           |
| `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 (int64)    | —      |                                                                                                                                                           |
| `name`                      | body | string             | —      |                                                                                                                                                           |
| `navItems`                  | body | string\[]          | —      |                                                                                                                                                           |
| `orgBalance`                | body | number (double)    | —      | Balance fields are read-only mirrors; authoritative balances live in Commerce (billing.hanzo.ai).                                                         |
| `owner`                     | body | string             | —      |                                                                                                                                                           |
| `passwordExpireDays`        | body | integer (int64)    | —      |                                                                                                                                                           |
| `passwordObfuscatorKey`     | body | string             | —      |                                                                                                                                                           |
| `passwordObfuscatorType`    | body | string             | —      |                                                                                                                                                           |
| `passwordOptions`           | body | string\[]          | —      |                                                                                                                                                           |
| `passwordSalt`              | body | string             | —      |                                                                                                                                                           |
| `passwordType`              | body | string             | —      |                                                                                                                                                           |
| `platform`                  | body | boolean            | —      | 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. |
| `tags`                      | body | string\[]          | —      |                                                                                                                                                           |
| `themeData`                 | body | iam.ThemeData      | —      |                                                                                                                                                           |
| `themeData.borderRadius`    | body | integer (int64)    | —      |                                                                                                                                                           |
| `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 (double)    | —      |                                                                                                                                                           |
| `userNavItems`              | body | string\[]          | —      |                                                                                                                                                           |
| `userTypes`                 | body | string\[]          | —      |                                                                                                                                                           |
| `websiteUrl`                | body | string             | —      |                                                                                                                                                           |
| `widgetItems`               | body | string\[]          | —      |                                                                                                                                                           |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo iam organizations avatar
```

**SDK**

**.ts**

```ts
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>" });
```

**.py**

```python
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>")
```

**.go**

```go
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
}
```

**.rs**

```rust
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?;
```

**.java**

```java
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();
```

**HTTP**

```bash
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>"
     }'
```

**MCP**

Tool `iam`, op `setOrganizationAvatar` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
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](https://docs.hanzo.ai/docs/openapi/iam) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
