Concerning endpoint `<https://api.growthbook.io/ap...
# ask-questions
b
Concerning endpoint
<https://api.growthbook.io/api/v1/features>
, the API documentation specifies that an environment of a feature can have four types of rules, i.e.
force
,
rollout
,
experiment-ref
and
experiment
. However, after playing around with GrowthBook UI setting up different experiments, I cannot reproduce any case in which the latest type of rule
experiment
would be returned. Furthermore, in endpoint
POST /features
to create a single feature, the API documentation specifies only the three first types of rules as possible rule types, i.e.
force
,
rollout
and
experiment-ref
. Question: Does it all mean the rule type
experiment
has been deprecated and we can assume it is not going to be returned by the API ?
r
Yes, the rule type “experiment” has been deprecated in the API in favor of a new rule type called “experiment-ref”. This change was introduced in version 2.5 of GrowthBook. The new “experiment-ref” rule type uses a foreign key to an Experiment object (experimentId) instead of defining everything inline as was done previously. This change was made to streamline the process of managing experiments and their associated rules. The new structure allows for better separation of concerns, where the Experiment object contains all the targeting and rollout information, and the feature rules simply reference these experiments.
b
@brief-honey-45610 Thank you so much. So if I access GrowthBook API through a brand-new project, I should not expect any more to see the 'experiment' type or rule, correct?
r
Correct