Hanzo
OpenapiExperiment

Promotes one variant to the whole rollout and records who decided.

Promotes one variant to the whole rollout and records who decided.

POST /v1/experiment/{id}/decide

Addresshttps://api.hanzo.ai/v1/experiment/{id}/decide
MethodPOST
Operationpost_experiment_by_id_decide
AuthAuthorization: Bearer $HANZO_API_KEY

Promotes one variant to the whole rollout and records who decided.

It rewrites the assignment flag so the named winner serves 100% of the rollout and every other arm 0%, preserving the flag's targeting groups and payloads, then stamps the experiment decided with the winner, the deciding credential and the time. This is a production behaviour change that takes effect immediately for every subject the flag evaluates.

It requires an ORG ADMIN of the caller's own org — a stricter gate than the rest of this surface, matching the flags write plane, because promoting is a flag write. The admin check runs AFTER the experiment is found, so a caller from another tenant is answered not-found rather than forbidden and learns nothing about what exists.

An experiment whose assignment flag has gone missing is a conflict rather than a silent no-op — there is nothing to promote.

Deciding is NOT terminal. A second call re-promotes a different variant and re-stamps the row; the status stays decided and the previous winner is overwritten with no record that it was ever chosen. Nothing here reverts the flag to its original weights either, so an experiment cannot be un-decided through this route — restoring a split means writing the flag definition back through the flags plane.

Request

2 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyes
winnerbodystringyesWinner is the variant to promote.

Response

StatusBodyMeaning
200Trialok

200 body — 18 fields.

FieldInTypeAlwaysDescription
createdAtbodystringwhen it started assigning
createdBybodystringthe credential that registered it
decidedAtbodystringwhen the promotion took effect
decidedBybodystringthe credential that promoted the winner
exposureEventbodystringthe event that enrols a subject — the analysis denominator
flagKeybodystringthe assignment flag this experiment drives
idbodystringthe experiment's slug, unique within the project
metricEventbodystringthe event that counts as a conversion — the numerator
namebodystringfree text for a reader
projectbodystringthe sub-scope within the org, stamped from the principal
statusbodystringrunning while it assigns and measures, decided once a winner is promoted
subjectKindbodystringthe unit assigned and measured: user, org, session or audience
variantsbodyArm[]the arms, weighted, one of them the control
variants[].controlbodybooleantrue on the baseline arm every other arm is compared to
variants[].keybodystringthe arm's slug, unique within the experiment
variants[].payloadbodyanyopaque JSON the arm carries, which the consumer interprets
variants[].weightbodynumberits share of the rollout; the arms sum to 100
winnerbodystringthe arm promoted to the whole rollout

Failure carries the platform error shape — see Errors.

Examples

hanzo experiments decide <id> --winner <winner>

Experiment API · All Hanzo APIs · Interactive reference

How is this guide?

On this page