Optimizely · Schema

Rule

A rule that determines which variation to deliver

A/B TestingContent ManagementCustomer DataE-CommerceExperimentationFeature FlagsMarketing

Properties

Name Type Description
id string Unique identifier for the rule
key string Unique key for the rule
type string Type of rule
audience_conditions string JSON-encoded audience conditions for this rule
percentage_included integer Percentage of traffic included in this rule
variations array Variations and their traffic allocation
View JSON Schema on GitHub

JSON Schema

optimizely-rule-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Rule",
  "title": "Rule",
  "type": "object",
  "description": "A rule that determines which variation to deliver",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the rule"
    },
    "key": {
      "type": "string",
      "description": "Unique key for the rule"
    },
    "type": {
      "type": "string",
      "description": "Type of rule",
      "enum": [
        "a/b_test",
        "targeted_delivery",
        "personalization"
      ]
    },
    "audience_conditions": {
      "type": "string",
      "description": "JSON-encoded audience conditions for this rule"
    },
    "percentage_included": {
      "type": "integer",
      "description": "Percentage of traffic included in this rule",
      "minimum": 0,
      "maximum": 10000
    },
    "variations": {
      "type": "array",
      "description": "Variations and their traffic allocation",
      "items": {
        "type": "object",
        "properties": {
          "variation_key": {
            "type": "string",
            "description": "Key of the variation"
          },
          "weight": {
            "type": "integer",
            "description": "Traffic weight for this variation",
            "minimum": 0,
            "maximum": 10000
          }
        }
      }
    }
  }
}