Skip to main content
POST
/
targeting-rules
Create a new targeting rule
curl --request POST \
  --url https://api.kameleoon.com/targeting-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "siteId": 123,
  "segmentConfiguration": "ALL_VISITORS",
  "segmentId": 123,
  "targetingConfigurationParam": "<string>",
  "triggerConfiguration": "ALL_VISITORS",
  "triggerId": 123
}
'
{
  "siteId": 123,
  "id": 123,
  "segmentConfiguration": "ALL_VISITORS",
  "segmentId": 123,
  "targetingConfigurationParam": "<string>",
  "triggerConfiguration": "ALL_VISITORS",
  "triggerId": 123
}

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.

Query Parameters

experimentId
integer<int64>
required

Id of the experiment

Body

application/json

Targeting Rule defines the conditions for displaying content to specific user groups based on segments and triggers

siteId
integer<int64>
required

Id of the project this targeting rule belongs to

segmentConfiguration
enum<string>

Configuration defining how the segment should be applied

Available options:
ALL_VISITORS,
AUTOPROMO_AUTODEFINED,
GRAPHICAL_PAGES,
HEAT_SLICE,
PAGE,
SAVED_TEMPLATE,
SITE,
URL
segmentId
integer<int64>

Id of the associated segment (user group) for targeting. If segment is deprecated, no trigger will be available for this rule.

targetingConfigurationParam
string

Additional parameters for trigger configuration. For SAVED_TEMPLATE/HEAT_SLICE - contains segment Id. For PAGE - contains full URL. For URL - contains URL fragment.

triggerConfiguration
enum<string>

Configuration defining how the trigger should be applied. ALL_VISITORS configuration is not allowed for this trigger type

Available options:
ALL_VISITORS,
AUTOPROMO_AUTODEFINED,
GRAPHICAL_PAGES,
HEAT_SLICE,
PAGE,
SAVED_TEMPLATE,
SITE,
URL
triggerId
integer<int64>

Id of the associated trigger (activation condition)

Response

Created

Targeting Rule defines the conditions for displaying content to specific user groups based on segments and triggers

siteId
integer<int64>
required

Id of the project this targeting rule belongs to

id
integer<int64>
read-only

Unique Id of the targeting rule

segmentConfiguration
enum<string>

Configuration defining how the segment should be applied

Available options:
ALL_VISITORS,
AUTOPROMO_AUTODEFINED,
GRAPHICAL_PAGES,
HEAT_SLICE,
PAGE,
SAVED_TEMPLATE,
SITE,
URL
segmentId
integer<int64>

Id of the associated segment (user group) for targeting. If segment is deprecated, no trigger will be available for this rule.

targetingConfigurationParam
string

Additional parameters for trigger configuration. For SAVED_TEMPLATE/HEAT_SLICE - contains segment Id. For PAGE - contains full URL. For URL - contains URL fragment.

triggerConfiguration
enum<string>

Configuration defining how the trigger should be applied. ALL_VISITORS configuration is not allowed for this trigger type

Available options:
ALL_VISITORS,
AUTOPROMO_AUTODEFINED,
GRAPHICAL_PAGES,
HEAT_SLICE,
PAGE,
SAVED_TEMPLATE,
SITE,
URL
triggerId
integer<int64>

Id of the associated trigger (activation condition)