---
title: "Replace value"
method: PUT
path: "/v1/settings/{settingKeyOrId}/value"
tags: ["Feature Flag & Setting values using SDK Key"]
---

# Replace value

`PUT /v1/settings/{settingKeyOrId}/value`

This endpoint replaces the value of a Feature Flag or Setting 
in a specified Environment identified by the <a target="_blank" rel="noopener noreferrer" href="https://app.configcat.com/sdkkey">SDK key</a> passed in the `X-CONFIGCAT-SDKKEY` header.

Only the `value`, `rolloutRules` and `percentageRules` attributes are modifiable by this endpoint.

**Important:** As this endpoint is doing a complete replace, it's important to set every other attribute that you don't 
want to change to its original state. Not listing one means it will reset.

For example: We have the following resource.
```json
{
  "rolloutPercentageItems": [
    {
      "percentage": 30,
      "value": true
    },
    {
      "percentage": 70,
      "value": false
    }
  ],
  "rolloutRules": [],
  "value": false
}
```
If we send a replace request body as below:
```json
{
  "value": true
}
```
Then besides that the default served value is set to `true`, all the Percentage Rules are deleted. 
So we get a response like this:
```json
{
  "rolloutPercentageItems": [],
  "rolloutRules": [],
  "value": true
}
```

## Path parameters

- `settingKeyOrId` string, required

## Query parameters

- `reason` string

## Headers

- `X-CONFIGCAT-SDKKEY` string

## Request body

- UpdateSettingValueModel
  - `rolloutRules` UpdateRolloutRuleModel[] — The targeting rule collection.
    - `comparisonAttribute` string, nullable — The user attribute to compare.
    - `comparator` 'isOneOf' | 'isNotOneOf' | 'contains' | 'doesNotContain' | 'semVerIsOneOf' | 'semVerIsNotOneOf' | 'semVerLess' | 'semVerLessOrEquals' | 'semVerGreater' | 'semVerGreaterOrEquals' | 'numberEquals' | 'numberDoesNotEqual' | 'numberLess' | 'numberLessOrEquals' | 'numberGreater' | 'numberGreaterOrEquals' | 'sensitiveIsOneOf' | 'sensitiveIsNotOneOf' — The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value.
    - `comparisonValue` string, nullable — The value to compare against.
    - `value` union, required
      - boolean
      - string
      - number, double
    - `segmentComparator` 'isIn' | 'isNotIn' — The segment comparison operator used during the evaluation process.
    - `segmentId` string, uuid, nullable — The segment to compare against.
  - `rolloutPercentageItems` UpdateRolloutPercentageItemModel[] — The percentage rule collection.
    - `percentage` integer, required — The percentage value for the rule.
    - `value` union, required
      - boolean
      - string
      - number, double
  - `value` union, required
    - boolean
    - string
    - number, double

## Response `200`

- SettingValueModel
  - `setting` SettingDataModel, required — Metadata of a Feature Flag or Setting.
    - `settingId` integer, required — Identifier of the Feature Flag or Setting.
    - `key` string, required — Key of the Feature Flag or Setting.
    - `name` string, required — Name of the Feature Flag or Setting.
    - `hint` string, nullable, required — Description of the Feature Flag or Setting.
    - `settingType` 'boolean' | 'string' | 'int' | 'double', required — The type of the Feature Flag or Setting.
    - `isJson` boolean, required — Indicates whether this setting should validate string values as JSON values.
    - `order` integer, required — The order of the Feature Flag or Setting represented on the ConfigCat Dashboard.
    - `createdAt` string, date-time, nullable, required — The creation time of the Feature Flag or Setting.
    - `creatorEmail` string, nullable, required — The user's email address who created the Feature Flag or Setting.
    - `creatorFullName` string, nullable, required — The user's name who created the Feature Flag or Setting.
    - `isWatching` boolean, required
  - `updatedAt` string, date-time, nullable, required — The last updated date and time when the Feature Flag or Setting.
  - `lastUpdaterUserEmail` string, nullable, required — The email of the user who last updated the Feature Flag or Setting.
  - `lastUpdaterUserFullName` string, nullable, required — The name of the user who last updated the Feature Flag or Setting.
  - `integrationLinks` IntegrationLinkModel[], required — The integration links attached to the Feature Flag or Setting.
    - `key` string, nullable, required
    - `description` string, nullable, required
    - `integrationLinkType` 'trello' | 'jira' | 'monday', required
    - `url` string, nullable, required
  - `settingTags` SettingTagModel[], required — The tags attached to the Feature Flag or Setting.
    - `settingTagId` integer, required
    - `tagId` integer, required
    - `name` string, required
    - `color` string, nullable, required
  - `rolloutRules` RolloutRuleModel[], required — The targeting rule collection.
    - `comparisonAttribute` string, nullable, required — The user attribute to compare.
    - `comparator` 'isOneOf' | 'isNotOneOf' | 'contains' | 'doesNotContain' | 'semVerIsOneOf' | 'semVerIsNotOneOf' | 'semVerLess' | 'semVerLessOrEquals' | 'semVerGreater' | 'semVerGreaterOrEquals' | 'numberEquals' | 'numberDoesNotEqual' | 'numberLess' | 'numberLessOrEquals' | 'numberGreater' | 'numberGreaterOrEquals' | 'sensitiveIsOneOf' | 'sensitiveIsNotOneOf', required — The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value.
    - `comparisonValue` string, nullable, required — The value to compare against.
    - `value` union, required
      - boolean
      - string
      - number, double
    - `segmentComparator` 'isIn' | 'isNotIn', required — The segment comparison operator used during the evaluation process.
    - `segmentId` string, uuid, nullable, required — The segment to compare against.
  - `rolloutPercentageItems` RolloutPercentageItemModel[], required — The percentage rule collection.
    - `percentage` integer, required — The percentage value for the rule.
    - `value` union, required
      - boolean
      - string
      - number, double
  - `value` union, required
    - boolean
    - string
    - number, double
  - `config` ConfigModel, required — Details of the Config.
    - `product` ProductModel, required — Details of the Product.
      - `organization` OrganizationModel, required — Details of the Organization.
        - `organizationId` string, uuid, required — Identifier of the Organization.
        - `name` string, required — Name of the Organization.
      - `productId` string, uuid, required — Identifier of the Product.
      - `name` string, required — Name of the Product.
      - `description` string, nullable, required — Description of the Product.
      - `order` integer, required — The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers.
      - `reasonRequired` boolean, required — Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved.
      - `approveRequired` boolean, required — Determines whether changes must be approved before they are applied within a Product.
    - `configId` string, uuid, required — Identifier of the Config.
    - `name` string, required — Name of the Config.
    - `description` string, nullable, required — Description of the Config.
    - `order` integer, required — The order of the Config represented on the ConfigCat Dashboard.
    - `migratedConfigId` string, uuid, nullable, required
    - `evaluationVersion` 'v1' | 'v2', required — Determines the evaluation version of a Config. Using `v2` enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2).
  - `environment` EnvironmentModel, required — Details of the Environment.
    - `product` ProductModel, required — Details of the Product.
      - `organization` OrganizationModel, required — Details of the Organization.
        - `organizationId` string, uuid, required — Identifier of the Organization.
        - `name` string, required — Name of the Organization.
      - `productId` string, uuid, required — Identifier of the Product.
      - `name` string, required — Name of the Product.
      - `description` string, nullable, required — Description of the Product.
      - `order` integer, required — The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers.
      - `reasonRequired` boolean, required — Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved.
      - `approveRequired` boolean, required — Determines whether changes must be approved before they are applied within a Product.
    - `environmentId` string, uuid, required — Identifier of the Environment.
    - `name` string, required — Name of the Environment.
    - `color` string, nullable, required — The configured color of the Environment.
    - `description` string, nullable, required — Description of the Environment.
    - `order` integer, required — The order of the Environment represented on the ConfigCat Dashboard.
    - `reasonRequired` boolean, required — Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved.
    - `approveRequired` boolean, required — Determines whether changes must be approved before they are applied in the given Environment.
  - `featureFlagLimitations` FeatureFlagLimitations, required — Subscription limitations regarding Feature flag or Setting values and targeting.
    - `maxPercentageOptionCount` integer, required — Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule.
    - `maxTargetingRuleCount` integer, required — Maximum number of targeting rules a Feature Flag or Setting can have.
    - `maxComparisonValueLength` integer, required — Maximum length of a text comparison value.
    - `maxComparisonValueListLength` integer, required — Maximum item count of a list comparison value.
    - `maxComparisonValueListItemLength` integer, required — Maximum length of a list comparison value's item.
    - `maxStringFlagValueLength` integer, required — Maximum length of a text Setting's value.
    - `maxConditionPerTargetingRuleCount` integer, required — Maximum number of `AND` conditions a Feature Flag or Setting can have within a targeting rule.
  - `readOnly` boolean, required

## Other responses

- `400` — Bad request.
- `404` — Not found.
- `429` — Too many requests. In case of the request rate exceeds the rate limits.

---

[API](https://skmtc.net/configcat/apis/configcat-public-management-api.md) · [All operations](https://skmtc.net/configcat/apis/configcat-public-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/configcat/configcat-public-management-api/versions/6b4d53bc1455/schema)
