Documentation
NAV Navbar
terminal
  • REST API (Server-Side API)
  • REST API (Server-Side API)

    This API will allow you to use every entity of Kameleoon application inside your own application. Find the full list of the supported functionalities on this page.

    Rest Auth

    Get Token

    Create a temporary token using username and password from request body. The Token will expire in 1 hour.

    HTTP Request

    POST https://api.kameleoon.com/k-api/authorization

    Example usage:

    curl -k -X POST \
      -H "Content-Type: application/json" \
      -d '{username: a@a.com, password: 123456qwerty}' \
      "https://api.kameleoon.com/k-api/authorization" \
    

    Query Parameters

    ParameterDescription
    usernameYour user name.
    passwordYour user password.
    api-key optionalAPI-Key provided in the user account, may be used instead of the password

    Success-Response:

    HTTP/1.1 200 OK
    {
         "success": true,
         "errors": [],
         "result": {
             "token": "ABCDEF123456789",
             "expiration_in": 3600
         }
    }
    

    Site

    Create Site

    Create a site with default values.

    HTTP Request

    POST https://api.kameleoon.com/k-api/sites

    Example usage:

    curl -k -X POST \
      -H "X-Auth-Key: ABCDEF123456789" \
      -H "X-Auth-Email: a@a.com" \
      -H "Content-Type: application/json" \
      -d '{
         "description":"site description",
         "url":"https://www.example.com"
         }' \
      "https://api.kameleoon.com/k-api/sites" \
    

    Query Parameters

    ParameterTypeDescription
    urlStringThe site url. Must start from http:// or https://.
    description optionalStringThe site description.

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "includeJQuery": false,
                "description": "site description",
                "id": 2,
                "url": "https://www.example.com"
            },
            "success": true,
            "errors": []
    }
    

    Get Site

    Get the informations of a site. Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:id

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "includeJQuery": false,
                "description": "site description",
                "id": 2,
                "url": "https://www.example.com"
            },
            "success": true,
            "errors": []
    }
    

    Get list of sites

    Get the list of customer sites.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "sites": [
                    {
                        "includeJQuery": false,
                        "description": "site description",
                        "id": 1,
                        "url": "http://www.example.com"
                    }
                ]
            },
            "success": true,
            "errors": []
    }
    

    Update Site

    Update the information of a site. Site ID is required in the URL.

    HTTP Request

    PUT https://api.kameleoon.com/k-api/sites/:id

    Example usage:

    curl -k -X PUT \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    -d '{
        "name":"new site name",
        "url":"https://www.new-example.com",
        "includeJQuery":false
    }' \
    "https://api.kameleoon.com/k-api/sites/1" \
    

    Query Parameters

    ParameterTypeDescription
    name optionalStringThe site name.
    url optionalStringThe site url. Must start from http:// or https://.
    includeJQuery optionalBooleanSet true if you want to include jQuery on your site.

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "includeJQuery": false,
                "description": "site description",
                "id": 1,
                    "url": "https://www.new-example.com"
            },
            "success": true,
            "errors": []
    }
    

    Delete Site

    Delete a site. Site ID is required in the URL.

    HTTP Request

    DELETE https://api.kameleoon.com/k-api/sites/:id

    Example usage:

    curl -k -X DELETE \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {},
            "success": true,
            "errors": []
    }
    

    Disable Site

    Disable kameleoon.js on a site. Site ID is required in the URL.

    HTTP Request

    PUT https://api.kameleoon.com/k-api/sites/:id/disable

    Example usage:

    curl -k -X PUT \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/disable" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {},
            "success": true,
            "errors": []
    }
    

    Enable Site

    Enable kameleoon.js on a site. Site ID is required in the URL.

    HTTP Request

    PUT https://api.kameleoon.com/k-api/sites/:id/enable

    Example usage:

    curl -k -X PUT \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/enable" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {},
            "success": true,
            "errors": []
    }
    

    Experiment

    Create Experiment

    Create a experiment on a site with default values. Site ID is required in the URL.

    HTTP Request

    POST https://api.kameleoon.com/k-api/sites/:siteId/experiments

    Example usage:

    curl -k -X POST \
      -H "X-Auth-Key: ABCDEF123456789" \
      -H "X-Auth-Email: a@a.com" \
      -H "Content-Type: application/json" \
      -d '{
             "name":"experiment name"
         }' \
      "https://api.kameleoon.com/k-api/sites/1/experiments" \
    

    Query Parameters

    ParameterTypeDescription
    name optionalStringName of the Experiment.
    type optionalStringSERVER_SIDE

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "goalId": null,
                "name": "experiment name",
                "siteId": 14794,
                "variationsId": "[]",
                "id": 27856,
                "status": "draft"
            },
            "success": true,
            "errors": []
    }
    

    Get Experiment

    Get the information of an experiment. Site ID and Experiment ID are required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/experiments/:id

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "targetingSegmentId": 1,
                "reportingTools": {
                    "repotingToolsValues": [
                        "[Newsletter]"
                    ],
                    "repotingToolsNames": [
                        "kameleoonTracking"
                    ]
                },
                "deviations": {
                    "1": 0.3,
                    "reference": 0.7
                },
                "scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
                "scheduleCronStart": "At 8:00 AM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
                "mainGoal": "22560",
                "variations": [
                    1,
                    2
                ],
                "name": "Test 45 (copy of Test 35)",
                "siteId": 1,
                "id": 1,
                "status": "DRAFT",
                "goals": [
                    1
                ]
            },
            "success": true,
            "errors": []
    }
    

    Get list of Experiments

    Get the list of experiments for a site. Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/experiments

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1/experiments" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "experiments": [
                {
                        "targetingSegmentId": 1,
                        "reportingTools": {
                            "repotingToolsValues": [
                                "[Newsletter]"
                            ],
                            "repotingToolsNames": [
                                "kameleoonTracking"
                            ]
                        },
                        "deviations": {
                            "1": 0.3,
                            "reference": 0.7
                        },
                        "scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
                        "scheduleCronStart": "At 8:00 AM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
                        "mainGoal": "22560",
                        "variations": [
                            1,
                            2
                        ],
                        "name": "Test 45 (copy of Test 35)",
                        "siteId": 1,
                        "id": 1,
                        "status": "DRAFT",
                        "goals": [
                            1
                        ]
                    }
                ]
            },
            "success": true,
            "errors": []
        }
    

    Update Experiment

    Update the information of an experiment. Site ID and Experiment ID are required in the URL.

    HTTP Request

    PUT https://api.kameleoon.com/k-api/sites/:siteId/experiments/:id

    Example usage:

    curl -k -X PUT \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: text/plain"  \
    -d '{
            "status":"PAUSE"
    }' \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2" \
    

    Query Parameters

    ParameterTypeDescription
    nameStringnew Experiment name.
    statusStringnew Experiment status. Allowed values: ACTIVE, PAUSE, ENDED
    segmentId optionalStringId of Targeting Segment to bind with Experiment.
    deviation optionalJSONObjectDeviation as json.
    referenceFloatPart of audience go by main reference. Order of magnitude : 0..1
    :variationIdFloatPart of audience go by variation with id=variationId. Order of magnitude : 0..1
    kameleoonTracking optionalBooleanIf gaols should be assigned, one needs to set this to true
    goals optionalJsonArrayList of Goals. Like ["117079","117078"]
    kameleoonMainGoalId optionalNumbermasterGoalId which should be the primary goal for a test
    javaScriptCode optionalStringNew javascript code for test, will be applied testwide
    cssCode optionalStringNew css style for test, will be applied testwide

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "targetingSegmentId": 45667,
                "reportingTools": {
                    "repotingToolsValues": [
                        [
                            "Engagement"
                        ]
                    ],
                    "repotingToolsNames": [
                        "kameleoonTracking"
                    ]
                },
                "deviations": {
                    "115466": 0.32,
                    "reference": 0.68
                },
                "scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
                "scheduleCronStart": "",
                "mainGoal": "22752",
                "variations": [],
                "name": "Test 1",
                "siteId": 14797,
                "id": 27860,
                "status": "PAUSE",
                "goals": [
                    22752
                ]
            },
            "success": true,
            "errors": []
    }
    

    Experiment Results

    Get the results of an experiment. Experiment ID and Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/experiments/result?interval=:interval

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/experiments/result?interval=HOUR" \
    

    Query Parameters

    ParameterTypeDescription
    interval optionalStringInterval for getting results. Default value: DAY Allowed values: HOUR, DAY, WEEK, MONTH, YEAR

    Success 200

    ParameterTypeDescription
    goalsJsonArrayList of Goals.
    goalIdJSONObjectContains list of variations.
    idNumberVariation id. "reference" - case for absence of any variations. "winner" - the best variation.
    nameStringThe variation name.
    trustRateNumberThe trust rate.
    improvementNumberRelative improvement over absence of any variations, computed as the ratio of conversionRate values minus 1.
    conversionRateNumberConversion rate, computed as conversions/visitors for this variation.
    visitsNumberNumber of site visitors for this variation.
    allConversionsNumberAll conversions during the test.
    convertedVisitsNumberVisits who have converted the goal.

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "goals": [
                    "20292": {
                        "111643": "{name=MENU HORIZONTAL (A), id=111643, Improvement=+9.22%, StatisticalSignificance=100.00%, allConversions=6,369, visits=16,551, convertedVisits=2,600, ConversionRate=15.71%}",
                        "112435": "{name=MENU HORIZONTAL Fusion Musique (B), id=112435, Improvement=+6.58%, StatisticalSignificance=99.80%, allConversions=5,944, visits=16,517, convertedVisits=2,532, ConversionRate=15.33%}",
                        "112436": "{name=MENU HORIZONTAL Fusion Son (C), id=112436, Improvement=+5.62%, StatisticalSignificance=99.31%, allConversions=6,129, visits=16,549, convertedVisits=2,514, ConversionRate=15.19%}",
                        "112437": "{name=MENU HORIZONTAL Fusion Musique et Son (D), id=112437, Improvement=+8.23%, StatisticalSignificance=99.98%, allConversions=6,108, visits=16,510, convertedVisits=2,570, ConversionRate=15.57%}",
                        "112920": "{name=Référence Bis Sans Lien Niveau 1, id=112920, Improvement=-100.00%, StatisticalSignificance=--, allConversions=0, visits=0, convertedVisits=0, ConversionRate=0.00%}",
                        "reference": "{name=reference, id=reference, Improvement=+0.00%, StatisticalSignificance=--, allConversions=13,659, visits=40,930, convertedVisits=5,887, ConversionRate=14.38%}",
                        "winner": "{name=MENU HORIZONTAL (A), id=111643, Improvement=+9.22%, StatisticalSignificance=100.00%, allConversions=6,369, visits=16,551, convertedVisits=2,600, ConversionRate=15.71%}"
                    }
                ]
            }
            "success": true,
            "errors": []
    }
    

    Experiment Simulationlink

    Get a simulationlink of an experiment. Experiment ID and Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/experiments/:id/simulation

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2/simulation" \
    

    Success 200

    ParameterTypeDescription
    simulationURLStringThe URL of the simulation

    Success-Response:

    HTTP/1.1 200 OK
    {
      "result":
        {
          "simulationURL":"http://domain.tld?kameleoon-experiment-id=76238&kameleoon-simulation=server-call-548xflhkwi"
        },
      "success":true,
      "errors":[]
    }
    

    Export Experiment Results

    Export experiment results to a csv file. Site ID and Experiment ID are required in the URL.

    HTTP Request

    https://api.kameleoon.com/k-api/sites/:siteId/experiments/:id/export?interval=:interval

    Example usage:

    wget \
    --header="X-Auth-Key:2MSO9VFIUSPI6YU" \
    --header="X-Auth-Email:a@a.com" \
    https://api.kameleoon.com/k-api/sites/1/experiments/2/export?interval=hour \
    --no-check-certificate \
    --content-disposition \
    

    Query Parameters

    ParameterTypeDescription
    interval optionalStringInterval for getting results. Default value: DAY Allowed values: HOUR, DAY, WEEK, MONTH, YEAR

    Delete Experiment

    Delete an experiment. Experiment ID and Site ID is required in the URL.

    HTTP Request

    DELETE https://api.kameleoon.com/k-api/sites/:siteId/experiments/:id

    Example usage:

    curl -k -X DELETE \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {},
            "success": true,
            "errors": []
        }
    

    Variation

    Create Variation

    Create a variation on an experiment. Experiment ID and Site ID is required in the URL.

    HTTP Request

    POST https://api.kameleoon.com/k-api/sites/:siteId/experiments/:experimentId/variations

    Example usage:

    curl -k -X POST \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    -d '{
         "name":"variation name",
         "jsCode":"variation js",
         "cssCode":"variation css"
    }' \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2/variations" \
    

    Query Parameters

    ParameterTypeDescription
    nameStringThe variation name.
    jsCode optionalStringThe variation javascript code.
    cssCode optionalStringThe variation css style.
    waitDOMReady optionalBooleanIs javascript code applied after DOM ready.

    Default value: true

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "customCssCode": "variation css",
                "waitDOMReady": true,
                "name": "variation name",
                "id": 1,
                "attachedExperimentId": 1,
                "javaScriptCode": "variation js"
            },
            "success": true,
            "errors": []
    }
    

    Get Variation

    Get the information of a variation. Variation ID, Experiment ID and Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/experiments/:experimentId/variations/:variationId

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2/variations/3" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "customCssCode": "variation css",
                "waitDOMReady": true,
                "name": "variation name",
                "id": 1,
                "attachedExperimentId": 1,
                "javaScriptCode": "variation js"
            },
            "success": true,
            "errors": []
    }
    

    Get list of Variations

    Get the list of variations for an experiment. Site ID and Experiment ID are required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/experiments/:experimentId/variations

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2/variations" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "variations": [
                    {
                        "customCssCode": "variation css",
                        "waitDOMReady": true,
                        "name": "variation name",
                        "id": 1,
                        "attachedExperimentId": 1,
                        "javaScriptCode": "variation js"
                    }
                ],
            },
            "success": true,
            "errors": []
    }
    

    Update Variation

    Update the information of a variation. Site ID, Experiment ID and Variation ID are required in the URL.

    HTTP Request

    PUT https://api.kameleoon.com/k-api/sites/:siteId/experiments/:experimentId/variations/:variationId

    Example usage:

    curl -k -X PUT \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    -d '{
         "jsCode":"variation js new",
         "cssCode":"variation css new"
    }' \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2/variations/3" \
    

    Query Parameters

    ParameterTypeDescription
    jsCode optionalStringNew javascript code for variation.
    cssCode optionalStringNew css style for variation.
    waitDOMReady optionalBooleanSet true if code applied after DOM ready. Default value: true

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "customCssCode": "variation css new",
                "waitDOMReady": true,
                "name": "variation name",
                "id": 1,
                "attachedExperimentId": 1,
                "javaScriptCode": "variation js new"
            },
            "success": true,
            "errors": []
    }
    

    Delete Variation

    Delete a variation. Site ID, Experiment ID and Variation ID are required in the URL.

    HTTP Request

    DELETE https://api.kameleoon.com/k-api/sites/:siteId/experiments/:experimentId/variations/:variationId

    Example usage:

    curl -k -X DELETE \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/experiments/2/variations/3" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {},
            "success": true,
            "errors": []
    }
    

    Goal

    Create Goal

    Create a goal on a site. Site ID is required in the URL.

    HTTP Request

    POST https://api.kameleoon.com/k-api/sites/:siteId/goals

    Example usage:

    curl -k -X POST \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    -d '{
         "name":"goal name",
         "goalType":"URL"
    }' \
    "https://api.kameleoon.com/k-api/sites/1/goals" \
    

    Query Parameters

    ParameterTypeDescription
    nameStringGoal name.
    goalTypeStringType of Goal. Allowed values: ENGAGEMENT, CLICK, URL, PAGE_VIEWS, TIME_SPENT, CUSTOM

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "piwikEventTracking": true,
                "adobeOmnitureEventTracking": true,
                "kissMetricsEventTracking": true,
                "comScoreEventTracking": true,
                "matchType": "null",
                "attachedGoalName": null,
                "masterGoalId": null,
                "multipleConversions": false,
                "type": "URL",
                "heatMapEventTracking": true,
                "action": null,
                "experimentId": null,
                "selector": null,
                "id": 1,
                "eulerianEventTracking": true,
                "crazyEggEventTracking": true,
                "mentalistWeight": 0,
                "timeSpent": null,
                "attachedGoalId": null,
                "universalAnalyticsEventTracking": true,
                "url": null,
                "googleAnalyticsEventTracking": true,
                "pageViews": null,
                "name": null,
                "attached": false,
                "webtrendsEventTracking": true,
                "reportingScriptEventTracking": true,
                "category": null,
                "atInternetEventTracking": true
            },
            "success": true,
            "errors": []
    }
    

    Get Goal

    Get a goal. Goal ID and Site ID are required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/goals/:id

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/goals/2" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "piwikEventTracking": true,
                "adobeOmnitureEventTracking": true,
                "kissMetricsEventTracking": true,
                "comScoreEventTracking": true,
                "matchType": "null",
                "attachedGoalName": null,
                "masterGoalId": null,
                "multipleConversions": false,
                "type": "URL",
                "heatMapEventTracking": true,
                "action": null,
                "experimentId": null,
                "selector": null,
                "id": 1,
                "eulerianEventTracking": true,
                "crazyEggEventTracking": true,
                "mentalistWeight": 0,
                "timeSpent": null,
                "attachedGoalId": null,
                "universalAnalyticsEventTracking": true,
                "url": null,
                "googleAnalyticsEventTracking": true,
                "pageViews": null,
                "name": null,
                "attached": false,
                "webtrendsEventTracking": true,
                "reportingScriptEventTracking": true,
                "category": null,
                "atInternetEventTracking": true
            },
            "success": true,
            "errors": []
    }
    

    Get list of Site Goals

    Get the list of goals associated with a site. Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/goals

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/goals" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "mainPersonalizationGoal": null,
                "goals": [
                    {
                        "piwikEventTracking": true,
                        "adobeOmnitureEventTracking": true,
                        "kissMetricsEventTracking": true,
                        "comScoreEventTracking": true,
                        "matchType": "null",
                        "attachedGoalName": null,
                        "masterGoalId": null,
                      "multipleConversions": false,
                        "type": "URL",
                        "heatMapEventTracking": true,
                        "action": null,
                        "experimentId": null,
                        "selector": null,
                        "id": 1,
                        "eulerianEventTracking": true,
                        "crazyEggEventTracking": true,
                        "mentalistWeight": 0,
                        "timeSpent": null,
                        "attachedGoalId": null,
                        "universalAnalyticsEventTracking": true,
                        "url": null,
                        "googleAnalyticsEventTracking": true,
                        "pageViews": null,
                        "name": null,
                        "attached": false,
                        "webtrendsEventTracking": true,
                        "reportingScriptEventTracking": true,
                        "category": null,
                        "atInternetEventTracking": true
                    }
                ]
            },
            "success": true,
            "errors": []
        }
    

    Update Goal

    Update the information of a goal. Site ID and Goal ID are required in the URL.

    HTTP Request

    PUT https://api.kameleoon.com/k-api/sites/:siteId/goals/:id

    Example usage:

    curl -k -X PUT \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    -d '{
         "name":"goal name new",
         "goalType":"TIME_SPENT"
    }' \
    "https://api.kameleoon.com/k-api/sites/1/goals/2" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "piwikEventTracking": true,
                "adobeOmnitureEventTracking": true,
                "kissMetricsEventTracking": true,
                "comScoreEventTracking": true,
                "matchType": "null",
                "attachedGoalName": null,
                "masterGoalId": null,
                "multipleConversions": false,
                "type": "TIME_SPENT",
                "heatMapEventTracking": true,
                "action": null,
                "experimentId": null,
                "selector": null,
                "id": 1,
                "eulerianEventTracking": true,
                "crazyEggEventTracking": true,
                "mentalistWeight": 0,
                "timeSpent": null,
                "attachedGoalId": null,
                "universalAnalyticsEventTracking": true,
                "url": null,
                "googleAnalyticsEventTracking": true,
                "pageViews": null,
                "name": "goal name new",
                "attached": false,
                "webtrendsEventTracking": true,
                "reportingScriptEventTracking": true,
                "category": null,
                "atInternetEventTracking": true
            },
            "success": true,
            "errors": []
    }
    

    Delete Goal

    Delete a goal. Goal ID and Site ID are required in the URL.

    HTTP Request

    DELETE https://api.kameleoon.com/k-api/sites/:siteId/goals/:id

    Example usage:

    curl -k -X Delete \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/goals/2" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {},
            "success": true,
            "errors": []
    }
    

    Targeting Segment

    Create TargetingSegment

    Create a targeting segment on a site. Site ID is required in the URL.

    HTTP Request

    https://api.kameleoon.com/k-api/sites/:siteId/segments

    Example usage:

    curl -k \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    -d '{
         "name":"segment name",
         "description":"segment description",
         "conditionsData": {
             "firstLevelOrOperators":[false,false],
             "secondLevel":
                [
                   {
                      "orOperators":[false],
                      "conditions":[
                           {
                             "targetingType":"PAGE_URL",
                             "url":"www",
                             "isInclude":"true",
                             "matchType":"CONTAINS",
                             "weight":1
                           },
                           {
                             "targetingType":"PAGE_VIEWS",
                             "pageCount":"3",
                             "isInclude":"true",
                             "countOp":"GREATER",
                             "weight":1
                           }
                     ]
                  },
                  {
                     "orOperators":[],
                     "conditions":[
                          {
                             "targetingType":"PAGE_TITLE",
                             "title":"test",
                             "isInclude":"true",
                             "matchType":"EXACT",
                             "weight":1
                          }
                     ]
                 }
             ]
      }
    }' \
    "https://api.kameleoon.com/k-api/sites/1/segments" \
    

    Query Parameters

    ParameterTypeDescription
    nameStringTargeting segment name.
    description optionalStringTargeting segment description.
    conditionsData optionalJSONObjectTargeting segment conditions.

    conditionsData

    ParameterTypeDescription
    firstLevelOrOperators optionalJsonArrayArray of booleans ("or"=true, "and"=false) for binding secondLevel outer conditions.
    secondLevel optionalJsonArrayArray of JSONObjects with outer conditions.

    secondLevel

    ParameterTypeDescription
    orOperators optionalJsonArrayBoolean ("or"=true, "and"=false) for binding secondLevel inner conditions.
    conditions optionalJsonArrayJsonArray with secondLevel inner conditions.

    conditions

    ParameterTypeDescription
    targetingTypeStringTargeting condition type. According to this field it's necessary to add some additional fields as shown below! Allowed values: PAGE_URL, PAGE_TITLE, LANDING_PAGE, ORIGIN, ORIGIN_TYPE, SEARCH_KEYWORD, NEW_VISITORS, BROWSER_LANGUAGE, GEOLOCATION, DEVICE_TYPE, PREVIOUS_PAGE, PAGE_VIEWS, FIRST_VISIT, LAST_VISIT, ACTIVE_SESSION, TIME_SINCE_PAGE_LOAD, SAME_DAY_VISITS, VISITS, MOUSE_OUT, CONVERSIONS, INTERNAL_SEARCH_KEYWORDS, TABS_ON_SITE, WEATHER, DAY_OF_WEEK, TIME_RANGE, HOUR_MINUTE_RANGE, JS_CODE, COOKIE, EVENT, BROWSER, OPERATING_SYSTEM, DOM_ELEMENT

    PAGE_URL

    ParameterTypeDescription
    urlStringURL template.
    matchType optionalStringAccordance between requested URL and URL template. Default value: EXACT Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    PAGE_TITLE

    ParameterTypeDescription
    titleStringTitle template.
    matchType optionalStringAccordance between page title and title template. Default value: EXACT Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    LANDING_PAGE

    ParameterTypeDescription
    urlStringLanding URL template.
    matchType optionalStringAccordance between requested URL and landing URL template. Default value: EXACT Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    ORIGIN

    ParameterTypeDescription
    urlStringReferring website URL template.
    matchType optionalStringAccordance between visitors origin URL and referring website URL template. Default value: EXACT Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    ORIGIN_TYPE

    ParameterTypeDescription
    trafficTypeStringTraffic type. Allowed values: SEO, SEM, AFFILIATION, EMAIL, DIRECT
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    SEARCH_KEYWORD

    ParameterTypeDescription
    keywordStringAdWords search keywords.
    matchType optionalStringAccordance between visitors search word and keyword. Default value: EXACT Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    NEW_VISITORS

    ParameterTypeDescription
    visitorsTypeStringNew or returning visitors. Allowed values: NEW, RETURNING
    weight optionalIntegerMore important conditions have greater values. Default value: 1

    BROWSER_LANGUAGE

    ParameterTypeDescription
    languageStringBrowser language code in ISO 639-1.
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    GEOLOCATION

    ParameterTypeDescription
    countryStringIP location country.
    region optionalStringIP location region.
    city optionalStringIP location city.
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    DEVICE_TYPE

    ParameterTypeDescription
    deviceStringDevice type. Allowed values: DESKTOP, TABLET, PHONE
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    PREVIOUS_PAGE

    ParameterTypeDescription
    urlStringPrevious page URL template.
    matchType optionalStringAccordance between previous page URL and URL template. Default value: EXACT Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    PAGE_VIEWS

    ParameterTypeDescription
    pageCountIntegerNumber of page views.
    countOpStringOperand for pageCount. Allowed values: LOWER, GREATER, EQUAL
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    FIRST_VISIT

    ParameterTypeDescription
    dayCountIntegerDays elapsed since first visit.
    countOpStringOperand for dayCount. Allowed values: LOWER, GREATER, EQUAL
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    LAST_VISIT

    ParameterTypeDescription
    dayCountIntegerDays elapsed since last visit.
    countOpStringOperand for dayCount. Allowed values: LOWER, GREATER, EQUAL
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    ACTIVE_SESSION

    ParameterTypeDescription
    secondCountIntegerSeconds elapsed since session became active.
    countOpStringOperand for secondCount. Allowed values: LOWER, GREATER
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    TIME_SINCE_PAGE_LOAD

    ParameterTypeDescription
    secondCountIntegerSeconds elapsed since page load.
    countOpStringOperand for secondCount. Allowed values: LOWER, GREATER
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    SAME_DAY_VISITS

    ParameterTypeDescription
    visitCountIntegerNumber of visits for day.
    countOpStringOperand for visitCount. Allowed values: LOWER, GREATER, EQUAL
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    VISITS

    ParameterTypeDescription
    visitCountIntegerTotal number of visits.
    countOpStringOperand for visitCount. Allowed values: LOWER, GREATER, EQUAL
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    MOUSE_OUT

    ParameterTypeDescription
    weight optionalIntegerMore important conditions have greater values. Default value: 1

    CONVERSIONS

    ParameterTypeDescription
    goalStringGoal that have reached by visitors. Allowed values: ANY, ENGAGEMENT, :GOAL_ID
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    INTERNAL_SEARCH_KEYWORDS

    ParameterTypeDescription
    keywordStringOn site search keyword.
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    TABS_ON_SITE

    ParameterTypeDescription
    tabCountIntegerNumber of tabs opened.
    countOpStringOperand for tabCount. Allowed values: LOWER, GREATER, EQUAL
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    DAY_OF_WEEK

    ParameterTypeDescription
    dayStringWeekday. Allowed values: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    TIME_RANGE

    ParameterTypeDescription
    sinceStringSince date. Date format: dd/mm/yyyyThh:MM.
    toStringTo date. Date format: dd/mm/yyyyThh:MM.
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    HOUR_MINUTE_RANGE

    ParameterTypeDescription
    sinceStringSince time. Time format: hh:MM.
    toStringTo time. Time format: hh:MM.
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    JS_CODE

    ParameterTypeDescription
    jsCodeStringCustom JavaScript condition.
    applied optionalStringRun js code after DOM ready or immediate? Default value: DOM_READY Allowed values: DOM_READY, IMMEDIATE
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    COOKIE

    ParameterTypeDescription
    nameStringBrowser cookie name template.
    value optionalStringWait while DOM is ready.
    matchType optionalStringAccordance between visitors cookie name and cookie name template. Default value: EXACT Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    EVENT

    ParameterTypeDescription
    eventStringCustom event.
    weight optionalIntegerMore important conditions have greater values. Default value: 1

    BROWSER

    ParameterTypeDescription
    browserStringBrowser. Allowed values: CHROME, IE, FIREFOX, SAFARI, OPERA
    versionIntegerBrowser version.
    versionOpStringOperand for version. Allowed values: LOWER, GREATER, EQUAL
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    OPERATING_SYSTEM

    ParameterTypeDescription
    osStringOperating system. Allowed values: WINDOWS, LINUX, MAC_OS, ANDROID, IOS
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition?Default value: true

    DOM_ELEMENT

    ParameterTypeDescription
    elementTypeStringType of element on the page. Allowed values: ANY_MODIFIED, SINGLE
    elementValue optionalStringElement on the page (id, class, ...) if elementType is SINGLE.
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    WEATHER

    ParameterTypeDescription
    weatherStringWeather in client place. Allowed values: CLEAR, CLOUDY, DRIZZLE, RAIN, THUNDERSTORM, HAIL, SNOW, CALM, BREEZE, HIGH_WIND, DISTURBED, HOT, COLD,

    SETTING

    ParameterTypeDescription
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    REFERRERS

    ParameterTypeDescription
    referrerStringThe visitors referrer. Allowed values: ANY_REFERRER, GOOGLE_ADWORDS, GOOGLE_SEARCH, BING_SEARCH, YAHOO_SEARCH, BAIDU_SEARCH
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    INTERESTS

    ParameterTypeDescription
    interestStringThe visitor interests. Allowed values: ANY, :INTEREST_NAME
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    KEY_PAGES

    ParameterTypeDescription
    pagesStringKey pages that have visited visitors. Allowed values: ANY, :KEY_PAGES_NAME
    weight optionalIntegerMore important conditions have greater values. Default value: 1
    isInclude optionalBooleanIs include if match this condition? Default value: true

    Get TargetingSegment

    Get the information of a targeting segment. Segment ID and Side ID are required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/segments/:id

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/segments/2" \
    

    Update TargetingSegment

    The Segment ID and Site ID are required in the URL. Only targeting conditions will be updated. For more description see 'Create TargetingSegment' section.

    HTTP Request

    PUT https://api.kameleoon.com/k-api/sites/:siteId/segments/:id

    Example usage:

    curl -k -X PUT \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    -d '{
         "name":"json name new",
         "description":"json description new",
         "conditionsData": {
             "secondLevel": [
                 {
                     "conditions": [
                         {
                             "targetingType": "SEARCH_KEYWORD",
                             "keyword": "search+word+new",
                             "include": "true",
                             "weight": 1
                         }
                     ]
                 }
             ]
         }
    }' \
    "https://api.kameleoon.com/k-api/sites/1/segments/2" \
    

    Query Parameters

    ParameterTypeDescription
    conditionsDataJSONObjectNew targeting condition data.

    Delete TargetingSegment

    Delete a targeting segment. Segment ID and Site ID are required in the URL.

    HTTP Request

    DELETE https://api.kameleoon.com/k-api/sites/:siteId/segments/:id

    Example usage:

    curl -k -X DELETE \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/segments/2" \
    

    Query Parameters

    ParameterTypeDescription
    conditionsDataJSONObjectNew targeting condition data.

    List of TargetingSegment

    Get the list of targeting segments for a site. Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/segments

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    "https://api.kameleoon.com/k-api/sites/1/segments" \
    

    Personalization

    Create Personalization

    Create a personalization on a site with default values. Site ID is required in the URL.

    HTTP Request

    POST https://api.kameleoon.com/k-api/sites/:siteId/personalizations

    Example usage:

    curl -k -X POST\
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1/personalizations" \
     -d '{ "name":"perso" }' \
    

    Query Parameters

    ParameterTypeDescription
    nameStringName of Personalization.

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "cappingPerVisitorConvertGoal": false,
                "goalId": null,
                "popIn": null,
                "description": null,
                "pluginCountDownHeadband": null,
                "globalCappingVisitorsConfiguration": "null",
                "variation": "{name=Variation 1, id=115495}",
                "expositionFrequencySameVisit": null,
                "targetingSegmentId": 45733,
                "trackerData": null,
                "cappingPerVisitorNumberExpositions": false,
                "archived": false,
                "kameleoonTracking": true,
                "pluginGoogleForm": null,
                "customContent": "{customCSS=null, customJavaScript=null}",
                "dateStarted": null,
                "dateEnded": null,
                "goals": [],
                "expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
                "expositionFrequencySameVisitorDelaySeconds": null,
                "stickyBlock": null,
                "expositionFrequencySameVisitor": null,
                "id": 17995,
                "expositionFrequencySameVisitorMax": 8,
                "globalCappingNumberVisitors": false,
                "cappingPerVisitorGoalId": null,
                "pluginIAdvize": null,
                "personalizationCheckConditionsRule": "ALL_CONDITIONS",
                "targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
                "personalizationStatus": "DRAFT",
                "pluginSocialBar": null,
                "priority": 1,
                "pluginAdBlock": null,
                "personalizationConfiguration": "NONE",
                "variationId": 115495,
                "globalCappingGoalId": null,
                "customExpositionRate": 100,
                "name": "perso",
                "siteId": 14797,
                "imageInPage": null
            },
            "success": true,
            "errors": []
    }
    

    Get Personalization

    Get the information of a personalization. Personalization ID and Site ID are required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/personalizations/:id

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1/personalizations/2" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "site": {
                    "includeJQuery": false,
                    "name": "b@b.com",
                    "id": 1,
                    "googleAnalyticsProfile": null,
                    "googleAnalyticsMainGoal": "E_COMMERCE",
                    "url": "http://www.gallery-belyaevo.ru"
                },
                "personalizations": {
                    "cappingPerVisitorConvertGoal": false,
                    "goalId": null,
                    "popIn": null,
                    "description": null,
                    "pluginCountDownHeadband": null,
                    "globalCappingVisitorsConfiguration": "null",
                    "variation": "{name=Variation 1, id=115495}",
                    "expositionFrequencySameVisit": null,
                    "targetingSegmentId": 45733,
                    "trackerData": null,
                    "cappingPerVisitorNumberExpositions": false,
                    "archived": false,
                    "kameleoonTracking": true,
                    "pluginGoogleForm": null,
                    "customContent": "{customCSS=null, customJavaScript=null}",
                    "dateStarted": null,
                    "dateEnded": null,
                    "goals": [],
                    "expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
                    "expositionFrequencySameVisitorDelaySeconds": null,
                    "stickyBlock": null,
                    "expositionFrequencySameVisitor": null,
                    "id": 17995,
                    "expositionFrequencySameVisitorMax": 8,
                    "globalCappingNumberVisitors": false,
                    "cappingPerVisitorGoalId": null,
                    "pluginIAdvize": null,
                    "personalizationCheckConditionsRule": "ALL_CONDITIONS",
                    "targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
                    "personalizationStatus": "DRAFT",
                    "pluginSocialBar": null,
                    "priority": 1,
                    "pluginAdBlock": null,
                    "personalizationConfiguration": "NONE",
                    "variationId": 115495,
                    "globalCappingGoalId": null,
                    "customExpositionRate": 100,
                    "name": "perso",
                    "siteId": 14797,
                    "imageInPage": null
                }
            },
            "success": true,
            "errors": []
    }
    

    Get list of Personalizations

    Get the list of personalizations of a site. Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/personalizations

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1/personalizations" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "site": {
                    "includeJQuery": false,
                    "name": "b@b.com",
                    "id": 1,
                    "googleAnalyticsProfile": null,
                    "googleAnalyticsMainGoal": "E_COMMERCE",
                    "url": "http://www.gallery-belyaevo.ru"
                },
                "personalizations": [
                    {
                        "cappingPerVisitorConvertGoal": false,
                        "goalId": null,
                        "popIn": null,
                        "description": null,
                        "pluginCountDownHeadband": null,
                        "globalCappingVisitorsConfiguration": "null",
                        "variation": "{name=Variation 1, id=115495}",
                        "expositionFrequencySameVisit": null,
                        "targetingSegmentId": 45733,
                        "trackerData": null,
                        "cappingPerVisitorNumberExpositions": false,
                        "archived": false,
                        "kameleoonTracking": true,
                        "pluginGoogleForm": null,
                        "customContent": "{customCSS=null, customJavaScript=null}",
                        "dateStarted": null,
                        "dateEnded": null,
                        "expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
                        "expositionFrequencySameVisitorDelaySeconds": null,
                        "stickyBlock": null,
                        "expositionFrequencySameVisitor": null,
                        "id": 17995,
                        "expositionFrequencySameVisitorMax": 8,
                        "globalCappingNumberVisitors": false,
                        "cappingPerVisitorGoalId": null,
                        "pluginIAdvize": null,
                        "personalizationCheckConditionsRule": "ALL_CONDITIONS",
                        "targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
                        "personalizationStatus": "DRAFT",
                        "pluginSocialBar": null,
                        "priority": 1,
                        "pluginAdBlock": null,
                        "personalizationConfiguration": "NONE",
                        "variationId": 115495,
                        "globalCappingGoalId": null,
                        "customExpositionRate": 100,
                        "name": "perso",
                        "siteId": 14797,
                        "imageInPage": null
                    }
                ]
            },
            "success": true,
            "errors": []
    }
    

    Update Personalization

    Update the information of a personalization. Personalization ID and Site ID are required in the URL.

    HTTP Request

    PUT https://api.kameleoon.com/k-api/sites/:siteId/personalizations/:id

    Example usage:

    curl -k -X PUT \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    -d '{
            "name":"perso new"
    }' \
    "https://api.kameleoon.com/k-api/sites/1/personalizations/2" \
    

    Query Parameters

    ParameterTypeDescription
    name optionalStringname of Personalization.
    targetingSegmentId optionalStringTargeting segment id for binding with personalization.
    description optionalStringdescription of Personalization.
    personalizationStatus optionalStringstatus of Personalization. Can be: DRAFT, ACTIVE, PAUSE, ENDED
    customExpositionRate optionalNumberpercent of Visitors exposed with personalization
    priority optionalNumberpriority of personalization
    resetExpositionFrequencySameVisit optionalBooleanif true exposition frequency functions will be reseted.
    expositionFrequencySameVisit optionalNumberMaximum times of display personalization during a unique visit
    expositionFrequencySameVisitor optionalNumberMaximum times of display personalization to the same visitor every n milliseconds
    expositionFrequencySameVisitorDelaySeconds optionalNumberNumber of milliseconds for repeating exposition behaviour
    expositionFrequencyDelaySecondsBetween TwoExpositions optionalNumberNumber of millisecond between two expositions of personalization
    maxNumberVisitorsExposed optionalNumber

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {
                "site": {
                    "includeJQuery": false,
                    "name": "b@b.com",
                    "id": 1,
                    "googleAnalyticsProfile": null,
                    "googleAnalyticsMainGoal": "E_COMMERCE",
                    "url": "http://www.gallery-belyaevo.ru"
                },
                "personalizations": {
                    "cappingPerVisitorConvertGoal": false,
                    "goalId": null,
                    "popIn": null,
                    "description": null,
                    "pluginCountDownHeadband": null,
                    "globalCappingVisitorsConfiguration": "null",
                    "variation": "{name=Variation 1, id=115495}",
                    "expositionFrequencySameVisit": null,
                    "targetingSegmentId": 45733,
                    "trackerData": null,
                    "cappingPerVisitorNumberExpositions": false,
                    "archived": false,
                    "kameleoonTracking": true,
                    "pluginGoogleForm": null,
                    "customContent": "{customCSS=null, customJavaScript=null}",
                    "dateStarted": null,
                    "dateEnded": null,
                    "goals": [],
                    "expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
                    "expositionFrequencySameVisitorDelaySeconds": null,
                    "stickyBlock": null,
                    "expositionFrequencySameVisitor": null,
                    "id": 17995,
                    "expositionFrequencySameVisitorMax": 8,
                    "globalCappingNumberVisitors": false,
                    "cappingPerVisitorGoalId": null,
                    "pluginIAdvize": null,
                    "personalizationCheckConditionsRule": "ALL_CONDITIONS",
                    "targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
                    "personalizationStatus": "DRAFT",
                    "pluginSocialBar": null,
                    "priority": 1,
                    "pluginAdBlock": null,
                    "personalizationConfiguration": "NONE",
                    "variationId": 115495,
                    "globalCappingGoalId": null,
                    "customExpositionRate": 100,
                    "name": "perso new",
                    "siteId": 14797,
                    "imageInPage": null
                }
            },
            "success": true,
            "errors": []
    }
    

    Delete Personalization

    Delete Personalization. Personalization ID is required in the url.

    HTTP Request

    DELETE https://api.kameleoon.com/k-api/sites/:siteId/personalizations/:id

    Example usage:

    curl -k -X DELETE \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1/personalizations/2" \
    

    Success-Response:

    HTTP/1.1 200 OK
    {
            "result": {},
            "success": true,
            "errors": []
    }
    

    Personalization Results

    Get the results of a personalization. Personalization ID and Site ID are required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/personalizations/:id/result?interval=:interval

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1/personalizations/2/result?interval=WEEK"
    

    Query Parameters

    ParameterTypeDescription
    interval optionalStringInterval for getting results. Default value: DAY Allowed values: HOUR, DAY, WEEK, MONTH, YEAR

    Success 200

    {
      "result": {
        "exposedConversionRate": 1,
        "improvementRate": 1,
        "exposedAverageCart": 0,
        "referenceDataSet": {
          "visits": [
            0,
            0,
            0,
            2,
            0,
            0,
            0
          ],
          "conversions": [
            0,
            0,
            0,
            1,
            0,
            0,
            0
          ]
        },
        "deviation": 0.3333333333,
        "dates": [
          1546988400000,
          1547074800000,
          1547161200000,
          1547247600000,
          1547334000000,
          1547420400000,
          1547506800000
        ],
        "nonExposedConversionCount": 1,
        "trustRate": 0.5,
        "exposedRevenues": 0,
        "nonExposedConversionRate": 0.5,
        "exposedCount": 1,
        "nonExposedAverageCart": 0,
        "goalName": "Retention rate",
        "nonExposedRevenues": 0,
        "variationDataSet": {
          "visits": [
            1,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "conversions": [
            1,
            0,
            0,
            0,
            0,
            0,
            0
          ]
        },
        "nonExposedCount": 2,
        "exposedConversionCount": 1
      },
      "success": true,
      "errors": []
    }
    

    Personalization Simulationlink

    Get a simulationlink of a personalization. Personalization ID and Site ID is required in the URL.

    HTTP Request

    GET https://api.kameleoon.com/k-api/sites/:siteId/personalizations/:id/simulation

    Example usage:

    curl -k -X GET \
    -H "X-Auth-Key: ABCDEF123456789" \
    -H "X-Auth-Email: a@a.com" \
    -H "Content-Type: application/json" \
    "https://api.kameleoon.com/k-api/sites/1/personalizations/2/simulation" \
    

    Success 200

    ParameterTypeDescription
    simulationURLStringThe URL of the simulation

    Success-Response:

    HTTP/1.1 200 OK
    {
      "result":
        {
          "simulationURL":"http://domain.tld?kameleoon-experiment-id=76238&kameleoon-simulation=server-call-548xflhkwi"
        },
      "success":true,
      "errors":[]
    }