Skip to main content

Update value

PATCH 

/v2/environments/:environmentId/settings/:settingId/value

This endpoint updates the value of a Feature Flag or Setting with a collection of JSON Patch operations in a specified Environment.

Only the defaultValue, targetingRules, and percentageEvaluationAttribute fields 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 of a Feature Flag.

{
"defaultValue": {
"boolValue": false
},
"targetingRules": [
{
"conditions": [
{
"userCondition": {
"comparisonAttribute": "Email",
"comparator": "sensitiveTextEquals",
"comparisonValue": {
"stringValue": "[email protected]"
}
}
}
],
"percentageOptions": [],
"value": {
"boolValue": true
}
}
]
}

If we send an update request body as below:

[
{
"op": "replace",
"path": "/targetingRules/0/value/boolValue",
"value": true
}
]

Only the first Targeting Rule's value is going to be set to false and all the other fields are remaining unchanged.

So we get a response like this:

{
"defaultValue": {
"boolValue": false
},
"targetingRules": [
{
"conditions": [
{
"userCondition": {
"comparisonAttribute": "Email",
"comparator": "sensitiveTextEquals",
"comparisonValue": {
"stringValue": "[email protected]"
}
}
}
],
"percentageOptions": [],
"value": {
"boolValue": false
}
}
]
}

Request

Path Parameters

    environmentId uuidrequired

    The identifier of the Environment.

    settingId int32required

    The id of the Setting.

Query Parameters

    reason string

    The reason note for the Audit Log if the Product's "Config changes require a reason" preference is turned on.

Body

required

  • Array [

  • op OperationTyperequired

    Possible values: [unknown, add, remove, replace, move, copy, test]

    path stringrequired

    Possible values: non-empty

    The source path.

    from stringnullable

    The target path.

    value nullable

    The discrete value.

  • ]

Responses

When the patch was successful.

Schema

    lastVersionId uuid

    defaultValue

    object

    Represents the value of a Feature Flag or Setting.

    boolValue booleannullable

    The served value in case of a boolean Feature Flag.

    stringValue stringnullable

    The served value in case of a text Setting.

    intValue int32nullable

    The served value in case of a whole number Setting.

    doubleValue doublenullable

    The served value in case of a decimal number Setting.

    targetingRules

    object[]

    nullable

    The targeting rules of the Feature Flag or Setting.

  • Array [

  • conditions

    object[]

    nullable

    The list of conditions that are combined with logical AND operators.

    It can be one of the following:

    • User condition

    • Segment condition

    • Prerequisite flag condition

  • Array [

  • userCondition

    object

    Describes a condition that is based on user attributes.

    comparisonAttribute stringrequired

    Possible values: non-empty and <= 1000 characters

    The User Object attribute that the condition is based on. Can be "User ID", "Email", "Country" or any custom attribute.

    comparator UserComparatorrequired

    Possible values: [isOneOf, isNotOneOf, containsAnyOf, doesNotContainAnyOf, semVerIsOneOf, semVerIsNotOneOf, semVerLess, semVerLessOrEquals, semVerGreater, semVerGreaterOrEquals, numberEquals, numberDoesNotEqual, numberLess, numberLessOrEquals, numberGreater, numberGreaterOrEquals, sensitiveIsOneOf, sensitiveIsNotOneOf, dateTimeBefore, dateTimeAfter, sensitiveTextEquals, sensitiveTextDoesNotEqual, sensitiveTextStartsWithAnyOf, sensitiveTextNotStartsWithAnyOf, sensitiveTextEndsWithAnyOf, sensitiveTextNotEndsWithAnyOf, sensitiveArrayContainsAnyOf, sensitiveArrayDoesNotContainAnyOf, textEquals, textDoesNotEqual, textStartsWithAnyOf, textNotStartsWithAnyOf, textEndsWithAnyOf, textNotEndsWithAnyOf, arrayContainsAnyOf, arrayDoesNotContainAnyOf]

    The comparison operator which defines the relation between the comparison attribute and the comparison value.

    comparisonValue

    object

    required

    The value that the user object's attribute is compared to.

    stringValue stringnullable

    The string representation of the comparison value.

    doubleValue doublenullable

    The number representation of the comparison value.

    listValue

    object[]

    nullable

    The list representation of the comparison value.

  • Array [

  • value stringrequired

    Possible values: non-empty

    The actual comparison value.

    hint stringnullable

    Possible values: <= 1500 characters

    An optional hint for the comparison value.

  • ]

  • segmentCondition

    object

    Describes a condition that is based on a segment.

    segmentId uuidrequired

    The segment's identifier.

    comparator SegmentComparatorrequired

    Possible values: [isIn, isNotIn]

    The segment comparison operator used during the evaluation process.

    prerequisiteFlagCondition

    object

    Describes a condition that is based on a prerequisite flag.

    prerequisiteSettingId int32required

    The prerequisite flag's identifier.

    comparator PrerequisiteComparatorrequired

    Possible values: [equals, doesNotEqual]

    Prerequisite flag comparison operator used during the evaluation process.

    prerequisiteComparisonValue

    object

    required

    Represents the value of a Feature Flag or Setting.

    boolValue booleannullable

    The served value in case of a boolean Feature Flag.

    stringValue stringnullable

    The served value in case of a text Setting.

    intValue int32nullable

    The served value in case of a whole number Setting.

    doubleValue doublenullable

    The served value in case of a decimal number Setting.

  • ]

  • percentageOptions

    object[]

    nullable

    The percentage options from where the evaluation process will choose a value based on the flag's percentage evaluation attribute.

  • Array [

  • percentage int32required

    A number between 0 and 100 that represents a randomly allocated fraction of the users.

    value

    object

    required

    Represents the value of a Feature Flag or Setting.

    boolValue booleannullable

    The served value in case of a boolean Feature Flag.

    stringValue stringnullable

    The served value in case of a text Setting.

    intValue int32nullable

    The served value in case of a whole number Setting.

    doubleValue doublenullable

    The served value in case of a decimal number Setting.

  • ]

  • value

    object

    Represents the value of a Feature Flag or Setting.

    boolValue booleannullable

    The served value in case of a boolean Feature Flag.

    stringValue stringnullable

    The served value in case of a text Setting.

    intValue int32nullable

    The served value in case of a whole number Setting.

    doubleValue doublenullable

    The served value in case of a decimal number Setting.

  • ]

  • setting

    object

    Metadata of a Feature Flag or Setting.

    settingId int32

    Identifier of the Feature Flag or Setting.

    key stringnullable

    Key of the Feature Flag or Setting.

    name stringnullable

    Name of the Feature Flag or Setting.

    hint stringnullable

    Description of the Feature Flag or Setting.

    settingType SettingType

    Possible values: [boolean, string, int, double]

    The type of the Feature Flag or Setting.

    order int32

    The order of the Feature Flag or Setting represented on the ConfigCat Dashboard.

    createdAt date-timenullable

    The creation time of the Feature Flag or Setting.

    creatorEmail stringnullable

    The user's email address who created the Feature Flag or Setting.

    creatorFullName stringnullable

    The user's name who created the Feature Flag or Setting.

    isWatching boolean
    updatedAt date-timenullable

    The last updated date and time when the Feature Flag or Setting.

    percentageEvaluationAttribute stringnullable

    The user attribute used for percentage evaluation. If not set, it defaults to the Identifier user object attribute.

    lastUpdaterUserEmail stringnullable

    The email of the user who last updated the Feature Flag or Setting.

    lastUpdaterUserFullName stringnullable

    The name of the user who last updated the Feature Flag or Setting.

    integrationLinks

    object[]

    nullable

    The integration links attached to the Feature Flag or Setting.

  • Array [

  • key stringnullable
    description stringnullable
    integrationLinkType IntegrationLinkType

    Possible values: [trello, jira, monday]

    url stringnullable
  • ]

  • settingTags

    object[]

    nullable

    The tags attached to the Feature Flag or Setting.

  • Array [

  • settingTagId int64
    tagId int64
    name stringnullable
    color stringnullable
  • ]

  • settingIdsWherePrerequisite int32[]nullable

    List of Feature Flag and Setting IDs where the actual Feature Flag or Setting is prerequisite.

    config

    object

    Details of the Config.

    product

    object

    Details of the Product.

    organization

    object

    Details of the Organization.

    organizationId uuid

    Identifier of the Organization.

    name stringnullable

    Name of the Organization.

    productId uuid

    Identifier of the Product.

    name stringnullable

    Name of the Product.

    description stringnullable

    Description of the Product.

    order int32

    The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers.

    reasonRequired boolean

    Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved.

    configId uuid

    Identifier of the Config.

    name stringnullable

    Name of the Config.

    description stringnullable

    Description of the Config.

    order int32

    The order of the Config represented on the ConfigCat Dashboard.

    migratedConfigId uuidnullable
    evaluationVersion EvaluationVersion

    Possible values: [v1, v2]

    Determines the evaluation version of a Config. Using v2 enables the new features of Config V2 (https://configcat.com/docs/advanced/config-v2).

    environment

    object

    Details of the Environment.

    product

    object

    Details of the Product.

    organization

    object

    Details of the Organization.

    organizationId uuid

    Identifier of the Organization.

    name stringnullable

    Name of the Organization.

    productId uuid

    Identifier of the Product.

    name stringnullable

    Name of the Product.

    description stringnullable

    Description of the Product.

    order int32

    The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers.

    reasonRequired boolean

    Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved.

    environmentId uuid

    Identifier of the Environment.

    name stringnullable

    Name of the Environment.

    color stringnullable

    The configured color of the Environment.

    description stringnullable

    Description of the Environment.

    order int32

    The order of the Environment represented on the ConfigCat Dashboard.

    reasonRequired boolean

    Determines whether a mandatory reason must be given every time when the Feature Flags or Settings in the given Environment are saved.

    readOnly boolean

    featureFlagLimitations

    object

    Subscription limitations regarding Feature flag or Setting values and targeting.

    maxPercentageOptionCount int32

    Maximum number of percentage options a Feature Flag or Setting can have within a targeting rule.

    maxTargetingRuleCount int32

    Maximum number of targeting rules a Feature Flag or Setting can have.

    maxComparisonValueLength int32

    Maximum length of a text comparison value.

    maxComparisonValueListLength int32

    Maximum item count of a list comparison value.

    maxComparisonValueListItemLength int32

    Maximum length of a list comparison value's item.

    maxStringFlagValueLength int32

    Maximum length of a text Setting's value.

    maxConditionPerTargetingRuleCount int32

    Maximum number of AND conditions a Feature Flag or Setting can have within a targeting rule.

Loading...