Evaluate runs the caller's flag definitions for one identity and returns the… — POST /v1/flags
Evaluate runs the caller's flag definitions for one identity and returns the flag verdict: which flags are on (or which variant), their payloads, and…
POST /v1/flags
| Address | https://api.hanzo.ai/v1/flags |
| Method | POST |
| Operation | post_flags |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Evaluate runs the caller's flag definitions for one identity and returns the flag verdict: which flags are on (or which variant), their payloads, and whether any definition failed to compute. Evaluation is in-process over the caller's own (org, project) definitions — no network hop, no shared KV — so a tenant can only ever evaluate its own flags.
Request
3 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
distinct_id | body | string | — | DistinctID is the identity the flags are evaluated for. |
groups | body | any | — | Groups are the group-level properties, keyed by group type index. |
person_properties | body | any | — | PersonProperties are the person-level properties conditions match against. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | ok |
200 body — 1 field.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
(body) | body | any | yes |
Failure carries the platform error shape — see Errors.
Examples
hanzo flags createimport { Configuration, FlagsApi } from 'hanzoai';
const api = new FlagsApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postFlags({ distinct_id: "<distinct_id>", groups: "<groups>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import FlagsApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = FlagsApi(client).post_flags(distinct_id="<distinct_id>", groups="<groups>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.FlagsAPI.PostFlags(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, flags_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = flags_api::post_flags(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.FlagsApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new FlagsApi(client).postFlags();curl -X POST https://api.hanzo.ai/v1/flags \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"distinct_id": "<distinct_id>",
"groups": "<groups>"
}'The door reaches flags through the flags tool, which names its 8 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": "get_flag_activity"
}
}
}'How is this guide?