Turn a feature toggle on or off
set-feature-stateEnable, disable, or reset a feature's default state, or override it for a specific user or role, then return the updated state and cache status.
Instructions
Change a feature's default state, or override it for one user/role, for features from any source. The first change to a web.config / metadata feature gives it a DB row, which then takes precedence over that source (the Creatio feature page behaves the same). Returns the feature as in get-feature plus cacheCleared. "feature_state_not_applied:" means Creatio did not save it. cacheCleared: false means it IS saved but the instance could not refresh its cache (seen on .NET 8), so it may take effect later — tell the user. See get-guide: feature-toggle-guide.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Feature code, exact match (e.g. "FreedomUIComposableApp"). | |
| state | Yes | "enabled" / "disabled"; "inherit" removes the override of `adminUnitId` so the default applies again (needs adminUnitId). | |
| adminUnitId | No | User or role to override for — a SysAdminUnit id (the current user: `userInfo.id` from get-current-user-info; others: read SysAdminUnit by Name). Omit to change the default for everyone without an override. |