Skip to main content
PATCH
/
segments
/
{segmentId}
Partially update segment
curl --request PATCH \
  --url https://api.kameleoon.com/segments/{segmentId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "audienceTracking": true,
  "description": "<string>",
  "isDeleted": true,
  "isFavorite": true,
  "name": "<string>",
  "tags": [
    "<string>"
  ]
}
'
{
  "conditionsData": {
    "firstLevel": [
      {
        "conditions": [
          {
            "targetingType": "PAGE_URL",
            "weight": 1,
            "count": 123,
            "include": true,
            "matchType": "EQUAL",
            "unitOfTime": "SECOND",
            "htmlDescription": "<string>",
            "id": 123
          }
        ],
        "orOperators": [
          true
        ]
      }
    ],
    "firstLevelOrOperators": [
      true
    ]
  },
  "name": "My segment",
  "segmentType": "STANDARD",
  "siteId": 8372,
  "audienceTracking": true,
  "audienceTrackingEditable": true,
  "conditionDataList": [
    {
      "id": 123,
      "isConditionBlock": true,
      "logicalOperator": "AND",
      "parentId": 123,
      "targetingCondition": {
        "targetingType": "PAGE_URL",
        "weight": 1,
        "count": 123,
        "include": true,
        "matchType": "EQUAL",
        "unitOfTime": "SECOND",
        "htmlDescription": "<string>",
        "id": 123
      }
    }
  ],
  "conditionDataTree": {
    "targetingType": "<string>",
    "conditionData": [
      "<unknown>"
    ],
    "isConditionBlock": true,
    "logicalOperator": "AND"
  },
  "createdBy": 123,
  "dateCreated": "2023-11-07T05:31:56Z",
  "dateModified": "2023-11-07T05:31:56Z",
  "description": "The segment is for new ab tests",
  "experimentAmount": 123,
  "experiments": [
    123
  ],
  "featureFlagAmount": 123,
  "hasSegmentCondition": true,
  "id": 123,
  "isFavorite": true,
  "personalizationAmount": 123,
  "personalizations": [
    123
  ],
  "tags": [
    "<string>"
  ],
  "usedBySegmentCondition": true,
  "userVisible": true
}

Documentation Index

Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

segmentId
integer<int64>
required

Body

application/json
audienceTracking
boolean

Indicates of the segment has enabled audience tracking

description
string

Description of the segment

isDeleted
boolean

Indicates if this segment has been deleted

isFavorite
boolean

Indicates if this segment is marked as a favorite

name
string

Name of the segment

tags
string[]

Returns a list of tags associated with this segment

Returns a list of tags associated with this segment

Response

OK

conditionsData
object
required

Conditions according to which visitors will be segmented

name
string
required

Name of the segment

Example:

"My segment"

segmentType
enum<string>
required

Segment type refers to the classification of segments based on their usage.

Available options:
STANDARD,
KEY_MOMENT,
FEATURE_FLAG,
ALL
siteId
integer<int64>
required

Site Id of the project where the segment is created

Example:

8372

audienceTracking
boolean

Indicates if segment is tracking audeince

audienceTrackingEditable
boolean
read-only

This flag shows if audienceTracking can be enabled/disabled. In some cases, audienceTracking cannot be disabled. E.g. a segment has predictive conditions, such segments are tracked by default.

conditionDataList
object[]

Conditions by which visitors will be segmented in list form

conditionDataTree
object

Conditions by which visitors will be segmented in tree form

createdBy
integer<int64>
read-only

Account Id of the creator of the segment

dateCreated
string<date-time>
read-only

Date when the segment was created

dateModified
string<date-time>
read-only

Date when the segment was modified

description
string

Description of the segment

Example:

"The segment is for new ab tests"

experimentAmount
integer<int64>
read-only

Number of experiments using this segment. This is an optional field that is included in the request body

experiments
integer<int64>[]
read-only

List of experiment ids using this segment. This is an optional field that is included in the request body

List of experiment ids using this segment. This is an optional field that is included in the request body

featureFlagAmount
integer<int64>
read-only

Number of feature flags being used in this goal. This is an optional field that must be specified in request params.

hasSegmentCondition
boolean
read-only

Indicates if the segment has conditions

id
integer<int64>
read-only

Unique Id of the segment

isFavorite
boolean

Indicates whether the segment has been marked as a favorite.

personalizationAmount
integer<int64>
read-only

Number of personalizations using this segment. This is an optional field that is included in the request body

personalizations
integer<int64>[]
read-only

List of personalization ids using this segment. This is an optional field that is included in the request body

List of personalization ids using this segment. This is an optional field that is included in the request body

tags
string[]
usedBySegmentCondition
boolean
read-only
userVisible
boolean

Indicates whether the segment has been marked as hidden from the user