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

# Update value

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

This endpoint updates the value of a Feature Flag or Setting 
with a collection of [JSON Patch](https://jsonpatch.com) operations 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.

The advantage of using JSON Patch is that you can describe individual update operations on a resource
without touching attributes that you don't want to change. It supports collection reordering, so it also 
can be used for reordering the targeting rules of a Feature Flag or Setting.

For example: We have the following resource.
```json
{
  "rolloutPercentageItems": [
    {
      "percentage": 30,
      "value": true
    },
    {
      "percentage": 70,
      "value": false
    }
  ],
  "rolloutRules": [],
  "value": false
}
```
If we send an update request body as below:
```json
[
  {
    "op": "replace",
    "path": "/value",
    "value": true
  }
]
```
Only the default served value is going to be set to `true` and all the Percentage Rules are remaining unchanged.
So we get a response like this:
```json
{
  "rolloutPercentageItems": [
    {
      "percentage": 30,
      "value": true
    },
    {
      "percentage": 70,
      "value": false
    }
  ],
  "rolloutRules": [],
  "value": true
}
```

## Path parameters

- `settingKeyOrId` string, required

## Query parameters

- `reason` string

## Headers

- `X-CONFIGCAT-SDKKEY` string

## Request body

- JsonPatchOperation[]
  - `op` 'unknown' | 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test', required
  - `path` string, required — The source path.
  - `from` string, nullable — The target path.
  - `value` unknown

## 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

- `204` — When no change applied on the resource.
- `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)
