Skip to main content

Goal

This guide explains how to manage the lifecycle of a feature flag using the Automation API. Configure the first flag by completing the following steps:
  1. Create a feature flag using the create a new feature flag endpoint.
  2. Add a rollout rule to the development environment using the update a feature flag configuration endpoint.
  3. Update the rollout rule using the update a single rule by ID endpoint.

Requirements

Prerequisites

Before using the Automation API, ensure the following information is available:

Access token

The Automation API requires an access token. Obtain a token by following the instructions in Obtaining an access token.

siteCode

Find the siteCode by navigating to Admin > Projects in the bottom-left corner.
SiteID

1. Create a feature flag

Create a feature flag called test_feature_flag_post, for example, with the variable test_variable. Because this request does not specify environmentConfigurations, the system automatically generates configurations for the development, staging, and production environments. Endpoint:
See the Create a new feature flag endpoint. Example:
Response:

2. Update the feature flag

Update the feature flag to add a TARGETED_DELIVERY rollout rule to the development environment with the following configuration:
Endpoint:
See the Update a feature flag configuration endpoint. Example:
Response:

3. Update the rollout rule

Finally, change the matchValue of rollbackConditions to 25 for the rollout rule ID 20557. Endpoint:
See the Update a feature flag configuration endpoint. Example:
Response: