Flags
Package flags is feature flags: ship it dark, then turn it on for who you pick.
Package flags is feature flags: ship it dark, then turn it on for who you pick.
| Base URL | https://api.hanzo.ai |
| Operations | 9 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
flags
ListFlagActivity returns the caller's flag change log newest-first: every create, update and delete, with the actor and the time.
GET /v1/flags/activity
ListFlagActivity returns the caller's flag change log newest-first: every create, update and delete, with the actor and the time.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | — | Limit caps the rows returned. |
Evaluate runs the caller's flag definitions for one identity and returns the PostHog-shaped verdict: which flags are on (or which variant), their payloads, and whether any definition failed to compute.
POST /v1/flags/decide
Evaluate runs the caller's flag definitions for one identity and returns the PostHog-shaped 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 body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
distinct_id | string | — | DistinctID is the identity the flags are evaluated for. |
groups | — | Groups are the group-level properties, keyed by group type index. | |
person_properties | — | PersonProperties are the person-level properties conditions match against. |
GetFlagDefinition returns one flag definition by key, or 404 when the caller's store has none under that key.
GET /v1/flags/defs/{key}
GetFlagDefinition returns one flag definition by key, or 404 when the caller's store has none under that key.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
key | path | string | yes | Key is the flag key to act on, from the path. |
PutFlagDefinition creates or replaces the flag definition at the path's key and returns the stored row.
PUT /v1/flags/defs/{key}
PutFlagDefinition creates or replaces the flag definition at the path's key and returns the stored row. The BODY IS THE DEFINITION DOCUMENT — the PostHog-shaped JSON object the evaluator consumes — and it is stored verbatim except that its "key" is forced to the key in the URL, so a document can never be filed under a name other than the one it was addressed by. Every write bumps the version and appends to the change log under the caller's identity.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
key | path | string | yes | Key is the flag key to write, from the path. |
DeleteFlagDefinition removes one flag definition by key and records the deletion in the change log.
DELETE /v1/flags/defs/{key}
DeleteFlagDefinition removes one flag definition by key and records the deletion in the change log. A key the caller's store does not hold is a 404.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
key | path | string | yes | Key is the flag key to act on, from the path. |
ListFlagDefinitions returns every flag definition in the caller's (org, project) store, by key, with its version and who last changed it.
GET /v1/flags/defs
ListFlagDefinitions returns every flag definition in the caller's (org, project) store, by key, with its version and who last changed it.
Health reports that the flag engine is serving.
GET /v1/flags/health
Health reports that the flag engine is serving. It is not gated: liveness must be probe-able without a token.
WaitlistMode reports whether ONE host is currently gated by the launch waitlist.
GET /v1/flags/waitlist
WaitlistMode reports whether ONE host is currently gated by the launch waitlist. It resolves the host to the service that governs it and reads that service's waitlist switch, so a guard sitting in front of a hosted surface can decide in one call whether to show the waitlist or the product. It answers for the ONE host asked about and never enumerates the registry, which is why it needs no credential. It FAILS OPEN: an unregistered host, an unmounted registry and a store fault all answer known=false with mode=false, so a request is never gated pre-boot or on a registry fault.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
host | query | string | — | Host is the host to resolve, e.g. "chat.hanzo.ai". |
Evaluate runs the caller's flag definitions for one identity and returns the PostHog-shaped verdict: which flags are on (or which variant), their payloads, and whether any definition failed to compute.
POST /v1/flags
Evaluate runs the caller's flag definitions for one identity and returns the PostHog-shaped 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 body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
distinct_id | string | — | DistinctID is the identity the flags are evaluated for. |
groups | — | Groups are the group-level properties, keyed by group type index. | |
person_properties | — | PersonProperties are the person-level properties conditions match against. |
How is this guide?