> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/more-products-apis/feature-flags-classic.md).

# Feature Flags Classic

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 [Feature Flags](https://developer.harness.io/api-reference/more-products-apis/feature-management-and-experimentation.md) or [FME Admin API (Legacy Split)](https://developer.harness.io/api-reference/more-products-apis/fme-admin-api.md) instead.

## Request basics

* **API key token**: Send it in the `x-api-key` header on every request. Go to [Manage API keys](https://developer.harness.io/harness-platform/use-harness-platform/automation/api/add-and-manage-api-keys) to create a key and token.
* **Account, organization, and project IDs**: Send `accountIdentifier`, `orgIdentifier`, and `projectIdentifier` as query parameters. All three are required on most endpoints. Go to [Organizations and projects](https://developer.harness.io/harness-platform/use-harness-platform/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:

```bash
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 with `PATCH /admin/features/{identifier}`. Go to [Create a Feature Flag](https://developer.harness.io/feature-flags/use-feature-flags/use-ff/ff-creating-flag/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/targets` and target groups with `GET /admin/segments`. Go to [Manage Target Users & Groups](https://developer.harness.io/feature-flags/use-feature-flags/use-ff/ff-target-management) to manage targets.
* **SDK keys**: The keys your applications' SDKs use to connect to an environment. List an environment's keys with `GET /admin/apikey` and create one with `POST /admin/apikey`. Go to [Use FF SDKs](https://developer.harness.io/feature-flags/use-feature-flags/use-ff/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](https://developer.harness.io/feature-flags/use-feature-flags/use-ff/ff-creating-flag/tag-management) 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](https://developer.harness.io/feature-flags/use-feature-flags/use-ff/relay-proxy) to set up the Relay Proxy.
