Feature Flags
Manage feature flags, targets, target groups, and SDK keys in Harness Feature Flags with the Feature Flags API.
The Feature Flags API manages Harness Feature Flags: the flags, the users and groups they target, and the keys your SDKs use to connect. For Harness Feature Management & Experimentation (FME), use the Runtime Configuration API instead.
Request basics
API key token: Send it in the
x-api-keyheader on every request. Go to Manage API keys to create a key and token.Account, organization, and project IDs: Send
accountIdentifier,orgIdentifier, andprojectIdentifieras query parameters. All three are required on most endpoints. Go to Organizations and projects to find these identifiers.Environment ID: Many endpoints also need
environmentIdentifier, because flag states and targets differ per environment.Base URL: Send requests to
https://app.harness.io/gateway/cf, followed by the endpoint path.
Example request
List the flags in a project, with their state in one environment:
curl "https://app.harness.io/gateway/cf/admin/features?accountIdentifier=ACCOUNT_ID&orgIdentifier=ORG_ID&projectIdentifier=PROJECT_ID&environmentIdentifier=ENVIRONMENT_ID" \
-H "x-api-key: $HARNESS_API_KEY"Replace ACCOUNT_ID, ORG_ID, PROJECT_ID, and ENVIRONMENT_ID with your own values, and set HARNESS_API_KEY to your API key token.
Find an endpoint
Endpoint paths are relative to the base URL.
Feature flags: Flags, their variations, and their on or off state in each environment. List flags with
GET /admin/features, and turn one on or off withPATCH /admin/features/{identifier}. Go to Create a Feature Flag to create a flag.Targets and target groups: The users or services a flag can serve, and groups of them built from attributes. List targets with
GET /admin/targetsand target groups withGET /admin/segments. Go to Manage Target Users & Groups to manage targets.SDK keys: The keys your applications' SDKs use to connect to an environment. List an environment's keys with
GET /admin/apikeyand create one withPOST /admin/apikey. Go to Use FF SDKs to connect an SDK.Tags: Labels for sorting and filtering flags. List tags with
GET /admin/tags. Go to Manage Tags for Feature Flags to manage tags.Relay Proxy: Endpoints used by the Relay Proxy, which serves flags to SDKs from inside your own network. List proxy keys with
GET /admin/proxy/keys. Go to Use the Relay Proxy with FF to set up the Relay Proxy.
Last updated
Was this helpful?