Hi everyone, I have a usecase where I create exper...
# ask-questions
d
Hi everyone, I have a usecase where I create experiments via growthbook rest api. I am sending the following payload
Copy code
{
  "id": "experiment_slug",
  "owner": "<mailto:system@tectonic.so|system@tectonic.so>",
  "valueType": "json",
  "defaultValue": "{}",
  "tags": [],
  "environments": {
    "dev": {
      "enabled": true,
      "rules": [
        {
          "type": "experiment-ref",
          "experimentId": "exp_19g61wm98lc7ig",
          "variations": [
            {
              "value": "{\"variationKey\":\"v0\"}",
              "variationId": "01JRAWJ2BY3ZTPJNGFXRDCAP47"
            },
            {
              "value": "{\"variationKey\":\"v1\"}",
              "variationId": "01JRAWJ2BY3ZTPJNGFXTH9Q8JP"
            }
          ]
        }
      ]
    },
    "production": {
      "enabled": true,
      "rules": [
        {
          "type": "experiment-ref",
          "experimentId": "exp_19g61wm98lc7ig",
          "variations": [
            {
              "value": "{\"variationKey\":\"v0\"}",
              "variationId": "01JRAWJ2BY3ZTPJNGFXRDCAP47"
            },
            {
              "value": "{\"variationKey\":\"v1\"}",
              "variationId": "01JRAWJ2BY3ZTPJNGFXTH9Q8JP"
            }
          ]
        }
      ]
    },
    "stage": {
      "enabled": true,
      "rules": [
        {
          "type": "experiment-ref",
          "experimentId": "exp_19g61wm98lc7ig",
          "variations": [
            {
              "value": "{\"variationKey\":\"v0\"}",
              "variationId": "01JRAWJ2BY3ZTPJNGFXRDCAP47"
            },
            {
              "value": "{\"variationKey\":\"v1\"}",
              "variationId": "01JRAWJ2BY3ZTPJNGFXTH9Q8JP"
            }
          ]
        }
      ]
    }
  }
}
to create the feature flag by hitting /features endpoint. However when the feature flag is evaluated, I get the value as
null
. When I fetch the feature flag. If I create the same from UI, it works just fine. What am I doing wrong here? Thanks!