563848e0ecc0
Transition multiple flags to a new status in one call
Transitions a list of flags to the given target status in a single request, evaluating each flag independently against its own current status and the caller's permissions. Use this instead of calling PUT /flags/{id}/update-status/{status} once per flag; per-flag failures do not abort the batch. Two selection modes are supported: the default "ids" mode, where the JSON body or multipart form supplies flagIds directly, plus optional comment and/or files applied to every successfully transitioned flag; and a JSON-only "filter" mode (set type to "filter"), where filter selects all matching flags server-side and expectedCount is the client's snapshot count used to detect drift — the request is rejected with 409 if the live count no longer matches. Filter-based selection can be disabled by configuration, in which case it returns 503. The status path parameter accepts the same canonical wire values and aliases as PUT /flags/{id}/update-status/{status} (case-insensitive). The caller must hold at least one of the listed per-transition permissions to pass the outer authorization gate; each flag is then re-checked individually against the specific transition it requires. Always returns HTTP 200, even when every flag in the batch fails — inspect the response body's successful/failed arrays and successCount/failureCount for the actual outcome. An empty or omitted flagIds list returns 200 with totalCount, successCount, and failureCount all zero.
Path parameters
The target status for all flags in the batch. Accepts the same canonical wire values and aliases as PUT /flags/{id}/update-status/{status} (case-insensitive).
Headers
Tenant ID
Request body
Example request
{
"type": "ids",
"flagIds": [
"flag-123",
"flag-456",
"flag-789"
]
}Response
Bulk update completed. successful/failed are arrays of {flagId, flagResponse} or {flagId, errorMessage, errorCode} respectively — errorCode is the stringified HTTP status code for that flag's failure (e.g. "409"). Each flagResponse omits the internal tenantProviderId and hash columns. totalCount, successCount, and failureCount summarize the batch.
Example response
{
"successful": [
{
"flagId": "flag-123",
"errorMessage": "Transition not allowed: closed -> closed",
"errorCode": "409"
}
],
"failed": [
{
"flagId": "flag-123",
"errorMessage": "Transition not allowed: closed -> closed",
"errorCode": "409"
}
],
"totalCount": 5,
"successCount": 4,
"failureCount": 1
}