Skip to main content
POST
/
key-moments
Create a new key moment
curl --request POST \
  --url https://api.kameleoon.com/key-moments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My Key Moment",
  "siteId": 8372,
  "audienceTracking": true,
  "conditionDataList": [
    {
      "id": 123,
      "logicalOperator": "AND",
      "parentId": 123,
      "targetingCondition": {
        "targetingType": "PAGE_URL",
        "weight": 1,
        "count": 123,
        "include": true,
        "matchType": "EQUAL",
        "unitOfTime": "SECOND"
      }
    }
  ],
  "conditionDataTree": {
    "targetingType": "<string>",
    "logicalOperator": "AND"
  },
  "conditionsData": {
    "firstLevel": [
      {
        "conditions": [
          {
            "targetingType": "PAGE_URL",
            "weight": 1,
            "count": 123,
            "include": true,
            "matchType": "EQUAL",
            "unitOfTime": "SECOND"
          }
        ],
        "orOperators": [
          true
        ]
      }
    ],
    "firstLevelOrOperators": [
      true
    ]
  },
  "description": "The key moment is for new A/B tests",
  "isFavorite": true
}
'
{
  "name": "My Key Moment",
  "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"
  },
  "conditionsData": {
    "firstLevel": [
      {
        "conditions": [
          {
            "targetingType": "PAGE_URL",
            "weight": 1,
            "count": 123,
            "include": true,
            "matchType": "EQUAL",
            "unitOfTime": "SECOND",
            "htmlDescription": "<string>",
            "id": 123
          }
        ],
        "orOperators": [
          true
        ]
      }
    ],
    "firstLevelOrOperators": [
      true
    ]
  },
  "createdBy": 123,
  "dateCreated": "2023-11-07T05:31:56Z",
  "dateModified": "2023-11-07T05:31:56Z",
  "description": "The key moment is for new A/B tests",
  "id": 123,
  "isFavorite": 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.

Body

application/json
name
string
required

Name of the key moment

Example:

"My Key Moment"

siteId
integer<int64>
required

Unique Id of the site where the key moment was, or will be created.

Example:

8372

audienceTracking
boolean

Indicates if the key moment is used for tracking audience

conditionDataList
object[]

Conditions upon which visitors will be included in the key moment in list form

conditionDataTree
object

Conditions by which visitors will be segmented in tree form

conditionsData
object

Conditions according to which visitors will be segmented

description
string

Description of the key moment

Example:

"The key moment is for new A/B tests"

isFavorite
boolean

Indicates whether the key moment is a favorite

Response

Created

name
string
required

Name of the key moment

Example:

"My Key Moment"

siteId
integer<int64>
required

Unique Id of the site where the key moment was, or will be created.

Example:

8372

audienceTracking
boolean

Indicates if the key moment is used for tracking audience

audienceTrackingEditable
boolean
read-only

Indicates if audienceTracking can be enabled or disabled. In some cases, audienceTracking cannot be disabled. E.g. When a key moment has predictive conditions, audience will be tracked by default.

conditionDataList
object[]

Conditions upon which visitors will be included in the key moment in list form

conditionDataTree
object

Conditions by which visitors will be segmented in tree form

conditionsData
object

Conditions according to which visitors will be segmented

createdBy
integer<int64>
read-only

Account Id of the key moment creator

dateCreated
string<date-time>
read-only

Date the key moment was created

dateModified
string<date-time>
read-only

Date the key moment was modified

description
string

Description of the key moment

Example:

"The key moment is for new A/B tests"

id
integer<int64>
read-only

Unique Id of the key moment

isFavorite
boolean

Indicates whether the key moment is a favorite