postExperimentByIdDecideWithHttpInfo method
Promotes one variant to the whole rollout and records who decided.
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.
Note: This method returns the HTTP Response.
Parameters:
-
String id (required):
-
DecideBody decideBody (required):
Implementation
Future<Response> postExperimentByIdDecideWithHttpInfo(String id, DecideBody decideBody,) async {
// ignore: prefer_const_declarations
final path = r'/v1/experiment/{id}/decide'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = decideBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}