# Replace org

URL: https://docs.hanzo.ai/docs/openapi/flag/put-flag-optin-org

> Blocks or unblocks the opt-in to public betas for every member of the org the caller acts in.

`PUT /v1/flag/optin/org`

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

|               |                                          |
| ------------- | ---------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/flag/optin/org` |
| **Method**    | `PUT`                                    |
| **Operation** | `put_flag_optin_org`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`   |

Blocks or unblocks the opt-in to public betas for every member of
the org the caller acts in. An owner or admin of that org, or a SuperAdmin, may;
a member may not. It only withholds: blocked, no member gets a public beta by
opting in, and their own choices are kept for when it is lifted; it never turns
a beta on. A shared sign-up org has no admin to speak for its members and is
refused. The change is on the audit trail before it lands.

## Request

1 field, body `application/json` (required).

| Field     | In   | Type    | Required | Description                                                                                 |
| --------- | ---- | ------- | -------- | ------------------------------------------------------------------------------------------- |
| `blocked` | body | boolean | —        | Blocked turns the opt-in off for every member of the org when true, and back on when false. |

## Response

| Status    | Body             | Meaning |
| --------- | ---------------- | ------- |
| `200`     | flag.orgOptinOut | ok      |
| `default` | problem-details  | refused |

`200` body — 1 field.

| Field     | In   | Type    | Always | Description                                                                  |
| --------- | ---- | ------- | ------ | ---------------------------------------------------------------------------- |
| `blocked` | body | boolean | —      | Blocked is true when the org's members do not get public betas by opting in. |

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

## Examples

**CLI**

```bash
hanzo flag optin org
```

**SDK**

**.ts**

```ts
import { Configuration, FlagApi } from 'hanzoai';

const api = new FlagApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putFlagOptinOrg({ blocked: false });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import FlagApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = FlagApi(client).put_flag_optin_org(blocked=False)
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.FlagAPI.PutFlagOptinOrg(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, flag_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = flag_api::put_flag_optin_org(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.FlagApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new FlagApi(client).putFlagOptinOrg();
```

**HTTP**

```bash
curl -X PUT https://api.hanzo.ai/v1/flag/optin/org \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "blocked": false
     }'
```

**MCP**

MCP reaches **flag** through the `flag` tool, which names its 12 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

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

---

[Flag API](https://docs.hanzo.ai/docs/openapi/flag) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
