---
title: "Update a feature flag configuration"
method: PATCH
path: "/feature-flags/{siteCode}/{featureKey}"
tags: ["FeatureFlag"]
---

# Update a feature flag configuration

`PATCH /feature-flags/{siteCode}/{featureKey}`

Update the feature flag (using JSON Merge for patch) for the given site code and feature key.

## Path parameters

- `siteCode` string, required
- `featureKey` string, required

## Request body

- UpdateFeatureFlagRequest — Payload used to update an existing feature flag
  - `attributionWindow` integer — Attribution window in milliseconds
  - `bucketingKey` union
    - BucketingKeyCustomDataDto — Bucketing key used for the feature flag
      - `bucketingKeyType` 'VISITOR_CODE' | 'CUSTOM_DATA'
      - `customDataId` integer
    - BucketingKeyVisitorCodeDto — Bucketing key used for the feature flag
      - `bucketingKeyType` 'VISITOR_CODE' | 'CUSTOM_DATA'
  - `description` string — Description of the feature flag
  - `environmentConfigurations` EnvironmentRequest[] — Environment-specific configurations for the feature flag
    - `defaultVariationKey` string, required — Default variation key to serve in this environment
    - `environmentKey` string, required — Environment key of this configuration
    - `featureEnabled` boolean, required — Indicates if the feature flag is enabled in this environment
    - `integrations` FeatureFlagIntegrations — Integrations associated with the feature flag environment
      - `deliveryRules` FeatureFlagIntegrations[] — List of integrations enabled for delivery rules
      - `experimentRules` FeatureFlagIntegrations[] — List of integrations enabled for experimentation rules
    - `rolloutRules` union[]
      - union
        - ExperimentationRuleRequest — Represents a rule configuration for creation or update
          - `id` integer, nullable — ID of the rule
          - `name` string, nullable — Name of the rule
          - `orderIndex` integer, nullable — Order index of the rule execution
          - `reallocation` boolean, nullable — Perform traffic reallocation
          - `release` ReleasePeriodRequest, nullable — Release date information about this rule
            - `releaseFrom` string, date-time — Rule being applied from this date
            - `releaseTo` string, date-time — Rule being applied to this date
            - `timeZone` string, required — Timezone regarding the release of this rule
          - `rollbackConditions` RollbackConditionRequest[], nullable — Conditions under which the rule will be rolled back
            - `comparisonOperator` 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN' | 'LESS_THAN', required — The rollback condition comparison operator
            - `criteria` 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE' | 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE', required — The rollback condition criteria
            - `goalId` integer, required — The rollback condition goal ID
            - `id` integer, nullable — The rollback condition ID
            - `matchValue` number, double, required — The rollback condition match value (0.0001 to 100)
            - `recipients` string[], nullable — List of emails of recipients who will be notified when conditions are triggered
            - `target` 'RULE' | 'ENVIRONMENT' | 'RULE' | 'ENVIRONMENT', required — The rollback condition target
            - `visitors` integer, required — The rollback condition visitors
          - `segmentId` integer, nullable — ID of the segment targeted by this rule
          - `state` 'ACTIVE' | 'PAUSED' | 'ACTIVE' | 'PAUSED', nullable — Wished state of the rule
          - `type` 'TARGETED_DELIVERY' | 'PROGRESSIVE_DELIVERY' | 'EXPERIMENTATION' | 'PROGRESSIVE_DELIVERY' | 'TARGETED_DELIVERY' | 'EXPERIMENTATION', required — Type of the rule
          - `controlVariationKey` string, nullable — Key of the control variation for this rule
          - `exposition` integer, nullable, required — Percentage of the traffic exposed to this rule
          - `multiArmedBandit` boolean — Enable dynamic allocation for this rule (Multi-Armed Bandit)
          - `trafficAllocationMethod` 'CONTEXTUAL_BANDIT' | 'MANUAL' | 'MULTI_ARMED_BANDIT' | 'CONTEXTUAL_BANDIT, MANUAL, MULTI_ARMED_BANDIT' — Defines how traffic is distributed in the SDK
          - `trafficAllocations` FeatureTrafficAllocation[] — Traffic allocation settings for the rule
            - `exposition` number, double
            - `variationId` integer
            - `variationKey` string
        - ProgressiveRuleRequest — Represents a rule configuration for creation or update
          - `id` integer, nullable — ID of the rule
          - `name` string, nullable — Name of the rule
          - `orderIndex` integer, nullable — Order index of the rule execution
          - `reallocation` boolean, nullable — Perform traffic reallocation
          - `release` ReleasePeriodRequest, nullable — Release date information about this rule
            - `releaseFrom` string, date-time — Rule being applied from this date
            - `releaseTo` string, date-time — Rule being applied to this date
            - `timeZone` string, required — Timezone regarding the release of this rule
          - `rollbackConditions` RollbackConditionRequest[], nullable — Conditions under which the rule will be rolled back
            - `comparisonOperator` 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN' | 'LESS_THAN', required — The rollback condition comparison operator
            - `criteria` 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE' | 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE', required — The rollback condition criteria
            - `goalId` integer, required — The rollback condition goal ID
            - `id` integer, nullable — The rollback condition ID
            - `matchValue` number, double, required — The rollback condition match value (0.0001 to 100)
            - `recipients` string[], nullable — List of emails of recipients who will be notified when conditions are triggered
            - `target` 'RULE' | 'ENVIRONMENT' | 'RULE' | 'ENVIRONMENT', required — The rollback condition target
            - `visitors` integer, required — The rollback condition visitors
          - `segmentId` integer, nullable — ID of the segment targeted by this rule
          - `state` 'ACTIVE' | 'PAUSED' | 'ACTIVE' | 'PAUSED', nullable — Wished state of the rule
          - `type` 'TARGETED_DELIVERY' | 'PROGRESSIVE_DELIVERY' | 'EXPERIMENTATION' | 'PROGRESSIVE_DELIVERY' | 'TARGETED_DELIVERY' | 'EXPERIMENTATION', required — Type of the rule
          - `rolloutConfiguration` union, required
            - CustomRampUpRollout — Custom Ramp-Up rollout configuration
              - …
            - ProgressiveExposure — Progressive exposure rollout configuration
              - …
          - `variationKey` string, required — Variation key used as control in experiments
        - TargetedRuleRequest — Represents a rule configuration for creation or update
          - `id` integer, nullable — ID of the rule
          - `name` string, nullable — Name of the rule
          - `orderIndex` integer, nullable — Order index of the rule execution
          - `reallocation` boolean, nullable — Perform traffic reallocation
          - `release` ReleasePeriodRequest, nullable — Release date information about this rule
            - `releaseFrom` string, date-time — Rule being applied from this date
            - `releaseTo` string, date-time — Rule being applied to this date
            - `timeZone` string, required — Timezone regarding the release of this rule
          - `rollbackConditions` RollbackConditionRequest[], nullable — Conditions under which the rule will be rolled back
            - `comparisonOperator` 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN' | 'LESS_THAN', required — The rollback condition comparison operator
            - `criteria` 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE' | 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE', required — The rollback condition criteria
            - `goalId` integer, required — The rollback condition goal ID
            - `id` integer, nullable — The rollback condition ID
            - `matchValue` number, double, required — The rollback condition match value (0.0001 to 100)
            - `recipients` string[], nullable — List of emails of recipients who will be notified when conditions are triggered
            - `target` 'RULE' | 'ENVIRONMENT' | 'RULE' | 'ENVIRONMENT', required — The rollback condition target
            - `visitors` integer, required — The rollback condition visitors
          - `segmentId` integer, nullable — ID of the segment targeted by this rule
          - `state` 'ACTIVE' | 'PAUSED' | 'ACTIVE' | 'PAUSED', nullable — Wished state of the rule
          - `type` 'TARGETED_DELIVERY' | 'PROGRESSIVE_DELIVERY' | 'EXPERIMENTATION' | 'PROGRESSIVE_DELIVERY' | 'TARGETED_DELIVERY' | 'EXPERIMENTATION', required — Type of the rule
          - `exposition` integer, nullable, required — Percentage of the traffic exposed to this rule. Required if creating, can be omitted on update for no change.
          - `variationKey` string, required — Variation key used as control in experiments
  - `featureKey` string, required — Key used to identify the feature flag
  - `isArchived` boolean — Flag indicating if the feature flag is archived
  - `name` string — Name of the feature flag
  - `primaryGoalId` integer — Primary goal associated with the feature flag
  - `secondaryGoalIds` integer[] — Secondary goals associated with the feature flag
  - `tags` string[] — List of tags associated with the feature flag
  - `variables` VariableRequest[] — Variables associated with the feature flag
    - `allowedValues` string[], nullable — Allowed enum values
    - `key` string, required — Key to identify the variable
    - `type` 'BOOLEAN' | 'NUMBER' | 'STRING' | 'JSON' | 'JS' | 'CSS' | 'ENUM', required — Type of the variable
    - `value` string, required — Value of the variable
  - `variations` VariationRequest[] — Variations associated with the feature flag
    - `key` string, required — Key of the variation
    - `name` string, required — Name of the variation
    - `variables` VariationVariableRequest[] — Set of variables implemented by the variation
      - `key` string, required — Key to identify the variable
      - `value` string, required — Value of the variable

## Response `200`

OK

- FeatureFlagConfiguration — Configuration for the feature flag
  - `archived` boolean
  - `attributionWindow` integer — Attribution window
  - `bucketingKey` union
    - BucketingKeyCustomDataDto — Bucketing key used for the feature flag
      - `bucketingKeyType` 'VISITOR_CODE' | 'CUSTOM_DATA'
      - `customDataId` integer
    - BucketingKeyVisitorCodeDto — Bucketing key used for the feature flag
      - `bucketingKeyType` 'VISITOR_CODE' | 'CUSTOM_DATA'
  - `createdById` integer — Created by id
  - `dateContentModified` string, date-time — Date and time when the feature flag configuration content was last modified
  - `dateCreated` string, date-time — Date and time when the feature flag configuration was created
  - `dateModified` string, date-time — Date and time when the feature flag configuration was last modified
  - `description` string — Description of the feature
  - `environmentConfigurations` EnvironmentResponse[] — Environment-specific configurations for the feature flag
    - `dateModified` string, date-time — The date when this environment configuration was last modified
    - `defaultVariationKey` string — Default variation key to serve in this environment
    - `environmentKey` string — Environment key of this configuration
    - `featureEnabled` boolean — Indicates if the feature flag is enabled in this environment
    - `integrations` FeatureFlagIntegrations — Integrations associated with the feature flag environment
      - `deliveryRules` FeatureFlagIntegrations[] — List of integrations enabled for delivery rules
      - `experimentRules` FeatureFlagIntegrations[] — List of integrations enabled for experimentation rules
    - `rolloutRules` union[] — Rollout rules for this environment
      - union
        - ExperimentationRuleResponse — Rollout rules for this environment
          - `experimentId` integer — ID of the experiment linked to this rule
          - `id` integer — Unique identifier of the rule
          - `name` string — Name of the rule
          - `release` FeatureFlagRelease — Release date information about this rule
            - `releaseFrom` string, date-time — Rule being applied from this date
            - `releaseTo` string, date-time — Rule being applied to this date
            - `timeZone` string — Timezone regarding the release of this rule
          - `rollbackConditions` FeatureRollbackCondition[] — Conditions for defining rollback
            - `comparisonOperator` 'GREATER_THAN' | 'LESS_THAN' — The rollback condition comparison operator
            - `criteria` 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE' — The rollback condition criteria
            - `goalId` integer — The rollback condition goal ID
            - `id` integer — The rollback condition ID
            - `matchValue` number, double — The rollback condition match value
            - `recipients` string[] — List of emails of recipients who will be notified when conditions are triggered
            - `target` 'RULE' | 'ENVIRONMENT' — The rollback condition target
            - `visitors` integer — The rollback condition visitors
          - `segmentId` integer — ID of the segment linked to this rule
          - `status` 'ACTIVE' | 'PAUSED' | 'PLANNED' — Status of the rule
          - `trafficAllocations` FeatureTrafficAllocation[] — Traffic allocation settings for the rule
            - `exposition` number, double
            - `variationId` integer
            - `variationKey` string
          - `type` 'TARGETED_DELIVERY' | 'PROGRESSIVE_DELIVERY' | 'EXPERIMENTATION', required — Type of the rule
          - `controlVariationKey` string
          - `exposition` integer — Percentage of the traffic exposed to this rule
          - `multiArmedBandit` boolean — (Deprecated, use trafficAllocationMethod instead) Enable dynamic allocation for this rule (Multi-Armed Bandit)
          - `trafficAllocationMethod` 'CONTEXTUAL_BANDIT' | 'MANUAL' | 'MULTI_ARMED_BANDIT' — Defines how traffic is distributed in the SDK
        - FeatureRolloutTargetedRule — Rollout rules for this environment
          - `experimentId` integer — ID of the experiment linked to this rule
          - `id` integer — Unique identifier of the rule
          - `name` string — Name of the rule
          - `release` FeatureFlagRelease — Release date information about this rule
            - `releaseFrom` string, date-time — Rule being applied from this date
            - `releaseTo` string, date-time — Rule being applied to this date
            - `timeZone` string — Timezone regarding the release of this rule
          - `rollbackConditions` FeatureRollbackCondition[] — Conditions for defining rollback
            - `comparisonOperator` 'GREATER_THAN' | 'LESS_THAN' — The rollback condition comparison operator
            - `criteria` 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE' — The rollback condition criteria
            - `goalId` integer — The rollback condition goal ID
            - `id` integer — The rollback condition ID
            - `matchValue` number, double — The rollback condition match value
            - `recipients` string[] — List of emails of recipients who will be notified when conditions are triggered
            - `target` 'RULE' | 'ENVIRONMENT' — The rollback condition target
            - `visitors` integer — The rollback condition visitors
          - `segmentId` integer — ID of the segment linked to this rule
          - `status` 'ACTIVE' | 'PAUSED' | 'PLANNED' — Status of the rule
          - `trafficAllocations` FeatureTrafficAllocation[] — Traffic allocation settings for the rule
            - `exposition` number, double
            - `variationId` integer
            - `variationKey` string
          - `type` 'TARGETED_DELIVERY' | 'PROGRESSIVE_DELIVERY' | 'EXPERIMENTATION', required — Type of the rule
          - `exposition` integer — Percentage of the traffic exposed to this rule
          - `variationKey` string — Key of the variation to serve to visitors matching this rule
        - ProgressiveRuleResponse — Rollout rules for this environment
          - `experimentId` integer — ID of the experiment linked to this rule
          - `id` integer — Unique identifier of the rule
          - `name` string — Name of the rule
          - `release` FeatureFlagRelease — Release date information about this rule
            - `releaseFrom` string, date-time — Rule being applied from this date
            - `releaseTo` string, date-time — Rule being applied to this date
            - `timeZone` string — Timezone regarding the release of this rule
          - `rollbackConditions` FeatureRollbackCondition[] — Conditions for defining rollback
            - `comparisonOperator` 'GREATER_THAN' | 'LESS_THAN' — The rollback condition comparison operator
            - `criteria` 'UPLIFT' | 'DOWNLIFT' | 'CONVERSION_RATE' — The rollback condition criteria
            - `goalId` integer — The rollback condition goal ID
            - `id` integer — The rollback condition ID
            - `matchValue` number, double — The rollback condition match value
            - `recipients` string[] — List of emails of recipients who will be notified when conditions are triggered
            - `target` 'RULE' | 'ENVIRONMENT' — The rollback condition target
            - `visitors` integer — The rollback condition visitors
          - `segmentId` integer — ID of the segment linked to this rule
          - `status` 'ACTIVE' | 'PAUSED' | 'PLANNED' — Status of the rule
          - `trafficAllocations` FeatureTrafficAllocation[] — Traffic allocation settings for the rule
            - `exposition` number, double
            - `variationId` integer
            - `variationKey` string
          - `type` 'TARGETED_DELIVERY' | 'PROGRESSIVE_DELIVERY' | 'EXPERIMENTATION', required — Type of the rule
          - `currentExposition` integer
          - `rolloutConfiguration` union
            - CustomRampUpRollout — Custom Ramp-Up rollout configuration
              - …
            - ProgressiveExposure — Progressive exposure rollout configuration
              - …
          - `variationKey` string — Key of the variation to serve to visitors matching this rule
  - `featureKey` string, required — Key used to identify the feature flag
  - `health` 'PERMANENT' | 'HEALTHY' | 'STALE' | 'SMELLY' — Health of the feature flag (for temporary ones)
  - `id` integer, required — System-generated unique string of integers to identify a feature flag
  - `isArchived` boolean
  - `name` string, required — Name of the feature flag
  - `primaryGoalId` integer — Primary goal of the feature flag
  - `secondaryGoalIds` integer[] — Secondary goals associated with the feature flag
  - `siteCode` string, required — Unique Id for the project in the Kameleoon app. This is an optional field to be included as query parameters
  - `tags` string[] — List of tags associated with the feature flag. This is an optional field to be included as query parameters
  - `teamId` integer — Team id
  - `variables` VariableResponse[] — Variables associated with the feature flag
    - `allowedValues` string[], nullable — Allowed enum values
    - `key` string, required — Key to identify the variable
    - `type` 'BOOLEAN' | 'NUMBER' | 'STRING' | 'JSON' | 'JS' | 'CSS' | 'ENUM', required — Type of the variable
    - `value` string, required — Value of the variable
  - `variations` VariationResponse[] — Variations associated with the feature flag
    - `key` string, required — Key of the variation
    - `name` string, required — Name of the variation
    - `variables` VariationVariableResponse[] — Set of variables implemented by the variation
      - `key` string, required — Key to identify the variable
      - `type` 'BOOLEAN' | 'NUMBER' | 'STRING' | 'JSON' | 'JS' | 'CSS' | 'ENUM', required — Type of the variable
      - `value` string, required — Value of the variable

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Feature flag for provided site code and feature key not found
- `423` — Resource Locked
- `500` — Internal Server Error

---

[API](https://skmtc.net/kameleoon/apis/openapi-definition-for-automation-api.md) · [All operations](https://skmtc.net/kameleoon/apis/openapi-definition-for-automation-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kameleoon/openapi-definition-for-automation-api/revisions/09f2abcea0b5/schema)
