> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.getunleash.io/api/get-all-client-features/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getunleash.io/_mcp/server. # Get all flags (SDK) GET https://app.unleash-instance.example.com/api/client/features Returns the SDK configuration for all feature flags that are available to the provided API key. Used by SDKs to configure local evaluation Reference: https://docs.getunleash.io/api/get-all-client-features ## Authentication - `Authorization` header (required) — API key needed to access this API - `Authorization` header (bearer token, required) — API key needed to access this API, in Bearer token format ## Response ### 200 clientFeaturesSchema - `version` (double, required) — A version number for the format used in the response. Most Unleash instances now return version 2, which includes segments as a separate array - `features` (list of clientFeatureSchema, required) — A list of feature flags with their configuration - `segments` (list of clientSegmentSchema, optional) — A list of [Segments](https://docs.getunleash.io/concepts/segments) configured for this Unleash instance - `query` (clientFeaturesQuerySchema, optional) — A summary of filters and parameters sent to the endpoint. Used by the server to build the features and segments response ## Types ### clientFeatureSchema Feature flag configuration used by SDKs to evaluate state of a flag - `name` (string, required) — The unique name of a feature flag. Is validated to be URL safe on creation - `enabled` (boolean, required) — Whether the feature flag is enabled for the current API key or not. This is ANDed with the evaluation results of the strategies list, so if this is false, the evaluation result will always be false - `type` (string, optional) — What kind of feature flag is this. Refer to the documentation on [feature flag types](https://docs.getunleash.io/concepts/feature-flags#feature-flag-types) for more information - `description` (string, optional, nullable) — A description of the flag - `stale` (boolean, optional) — If this is true Unleash believes this feature flag has been active longer than Unleash expects a flag of this type to be active - `impressionData` (boolean, optional, nullable) — Set to true if SDKs should trigger [impression events](https://docs.getunleash.io/concepts/impression-data) when this flag is evaluated - `project` (string, optional) — Which project this feature flag belongs to - `strategies` (list of featureStrategySchema, optional) — Evaluation strategies for this flag. Each entry in this list will be evaluated and ORed together - `variants` (list of variantSchema, optional, nullable) — [Variants](https://docs.getunleash.io/concepts/feature-flag-variants#what-are-variants) configured for this flag - `dependencies` (list of dependentFeatureSchema, optional) — Feature dependencies for this flag ### clientSegmentSchema Represents a client API segment of users defined by a set of constraints. - `id` (double, required) — The segment's id. - `constraints` (list of constraintSchema, required) — List of constraints that determine which users are part of the segment - `name` (string, optional) — The name of the segment. ### clientFeaturesQuerySchema Query parameters active for a client features request - `tag` (list of list of string, optional) — Features tagged with one of these tags are included - `namePrefix` (string, optional) — Features are filtered to only include features whose name starts with this prefix - `inlineSegmentConstraints` (boolean, optional) — Set to true if requesting client does not support Unleash-Client-Specification 4.2.2 or newer. Modern SDKs will have this set to false, since they will be able to merge constraints and segments themselves - `project` (list of string, optional, deprecated) — Features that are part of these projects are included in this response. This is now handled by API tokens and was marked as deprecated in v5 - `environment` (string, optional, deprecated) — Strategies for the feature flag configured for this environment are included. This is now handled by API tokens and was marked as deprecated in v5 ### featureStrategySchema A single activation strategy configuration schema for a feature - `name` (string, required) — The name or type of strategy - `id` (string, optional) — A uuid for the feature strategy - `title` (string, optional, nullable) — A descriptive title for the strategy - `disabled` (boolean, optional, nullable) — A toggle to disable the strategy. defaults to false. Disabled strategies are not evaluated or returned to the SDKs - `featureName` (string, optional) — The name or feature the strategy is attached to - `sortOrder` (double, optional) — The order of the strategy in the list - `segments` (list of double, optional) — A list of segment ids attached to the strategy - `constraints` (list of constraintSchema, optional) — A list of the constraints attached to the strategy. See https://docs.getunleash.io/concepts/activation-strategies#constraints - `variants` (list of strategyVariantSchema, optional) — Strategy level variants - `parameters` (map from string to string, optional) — A list of parameters for a strategy ### variantSchema A variant allows for further separation of users into segments. See [our excellent documentation](https://docs.getunleash.io/concepts/feature-flag-variants#what-are-variants) for a more detailed description - `name` (string, required) — The variants name. Is unique for this feature flag - `weight` (double, required) — The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information - `weightType` (enum, optional) — Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000 - Allowed values: `variable`, `fix` - `stickiness` (string, optional) — [Stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) is how Unleash guarantees that the same user gets the same variant every time - `payload` (VariantSchemaPayload, optional) — Extra data configured for this variant - `overrides` (list of overrideSchema, optional) — Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence. ### dependentFeatureSchema Feature dependency on a parent feature in read model - `feature` (string, required) — The name of the feature we depend on. - `enabled` (boolean, optional) — Whether the parent feature should be enabled. When `false` variants are ignored. `true` by default. - `variants` (list of string, optional) — The list of variants the parent feature should resolve to. Leave empty when you only want to check the `enabled` status. ### constraintSchema A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/concepts/activation-strategies#constraints) - `contextName` (string, required) — The name of the context field that this constraint should apply to. - `operator` (enum, required) — The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/concepts/activation-strategies#constraint-operators). - Allowed values: `NOT_IN`, `IN`, `STR_ENDS_WITH`, `STR_STARTS_WITH`, `STR_CONTAINS`, `NUM_EQ`, `NUM_GT`, `NUM_GTE`, `NUM_LT`, `NUM_LTE`, `DATE_AFTER`, `DATE_BEFORE`, `SEMVER_EQ`, `SEMVER_GT`, `SEMVER_LT`, `SEMVER_GTE`, `SEMVER_LTE`, `REGEX` - `caseInsensitive` (boolean, optional, default: false) — Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive). - `inverted` (boolean, optional, default: false) — Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa. - `values` (list of string, optional) — The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values. - `value` (string, optional) — The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values. ### strategyVariantSchema This is an experimental property. It may change or be removed as we work on it. Please don't depend on it yet. A strategy variant allows you to attach any data to strategies instead of only returning `true`/`false`. Strategy variants take precedence over feature variants. - `name` (string, required) — The variant name. Must be unique for this feature flag - `weight` (integer, required) — The weight is the likelihood of any one user getting this variant. It is an integer between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information - `weightType` (enum, required) — Set to `fix` if this variant must have exactly the weight allocated to it. If the type is `variable`, the weight will adjust so that the total weight of all variants adds up to 1000. Refer to the [variant weight documentation](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight). - Allowed values: `variable`, `fix` - `stickiness` (string, required) — The [stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) to use for distribution of this variant. Stickiness is how Unleash guarantees that the same user gets the same variant every time - `payload` (StrategyVariantSchemaPayload, optional) — Extra data configured for this variant ### VariantSchemaPayload Extra data configured for this variant - `type` (enum, required) — The type of the value. Commonly used types are string, number, json and csv. - Allowed values: `json`, `csv`, `string`, `number` - `value` (string, required) — The actual value of payload ### overrideSchema An override for deciding which variant should be assigned to a user based on the context name - `contextName` (string, required) — The name of the context field used to determine overrides - `values` (list of string, required) — Which values that should be overriden ### StrategyVariantSchemaPayload Extra data configured for this variant - `type` (enum, required) — The type of the value. Commonly used types are string, number, json and csv. - Allowed values: `json`, `csv`, `string`, `number` - `value` (string, required) — The actual value of payload ## Examples **Response** ```json { "version": 2, "features": [ { "name": "new.payment.flow.stripe", "enabled": true, "type": "release", "description": "No variants here", "stale": false, "impressionData": false, "project": "new.payment.flow", "strategies": [ { "name": "flexibleRollout", "id": "6b5157cb-343a-41e7-bfa3-7b4ec3044840", "title": "Gradual Rollout 25-Prod", "disabled": false, "featureName": "myAwesomeFeature", "sortOrder": 9999, "segments": [ 1, 2 ], "constraints": [ { "contextName": "appName", "operator": "IN", "caseInsensitive": false, "inverted": false, "values": [ "my-app", "my-other-app" ], "value": "my-app" } ], "variants": [ { "name": "blue_group", "weight": 1, "weightType": "fix", "stickiness": "custom.context.field", "payload": { "type": "json", "value": "{\"color\": \"red\"}" } } ], "parameters": {} } ], "variants": [ { "name": "blue_group", "weight": 1.1, "weightType": "variable", "stickiness": "custom.context.field", "payload": { "type": "json", "value": "{\"color\": \"red\"}" }, "overrides": [ { "contextName": "userId", "values": [ "red", "blue" ] } ] } ], "dependencies": [ { "feature": "parent_feature", "enabled": false, "variants": [ "variantA", "variantB" ] } ] } ], "segments": [ { "id": 1.1, "constraints": [ { "contextName": "appName", "operator": "IN", "caseInsensitive": false, "inverted": false, "values": [ "my-app", "my-other-app" ], "value": "my-app" } ], "name": "segment A" } ], "query": { "tag": [ [ "simple:payment", "simple:stripejourney" ] ], "namePrefix": "payment", "inlineSegmentConstraints": true, "project": [ "new.payment.flow" ], "environment": "string" } } ``` **SDK Code** ```javascript Node.js SDK import { initialize } from 'unleash-client'; const unleash = initialize({ url: 'https://app.unleash-instance.example.com/api/', appName: 'my-app', customHeaders: { Authorization: '' }, }); // The SDK fetches all feature flag configurations from this // endpoint at startup and polls for updates in the background. unleash.on('ready', () => { const enabled = unleash.isEnabled('my-feature'); }); ``` ```python Python SDK from UnleashClient import UnleashClient client = UnleashClient( url="https://app.unleash-instance.example.com/api/", app_name="my-app", custom_headers={'Authorization': ''}) client.initialize_client() # The SDK fetches all feature flag configurations from this # endpoint at startup and polls for updates in the background. enabled = client.is_enabled("my-feature") ``` ```java Java SDK UnleashConfig config = UnleashConfig.builder() .appName("my-app") .instanceId("my-instance") .unleashAPI("https://app.unleash-instance.example.com/api/") .apiKey("") .build(); Unleash unleash = new DefaultUnleash(config); // The SDK fetches all feature flag configurations from this // endpoint at startup and polls for updates in the background. boolean enabled = unleash.isEnabled("my-feature"); ``` ```go Go SDK package main import ( "net/http" unleash "github.com/Unleash/unleash-go-sdk/v6" ) func main() { err := unleash.Initialize( unleash.WithAppName("my-app"), unleash.WithUrl("https://app.unleash-instance.example.com/api/"), unleash.WithCustomHeaders(http.Header{"Authorization": {""}}), ) if err != nil { panic(err) } defer unleash.Close() unleash.WaitForReady() // The SDK fetches all feature flag configurations from this // endpoint at startup and polls for updates in the background. enabled := unleash.IsEnabled("my-feature", unleash.FeatureOptions{}) } ``` ```ruby Ruby SDK require 'unleash' @unleash = Unleash::Client.new( app_name: 'my-app', url: 'https://app.unleash-instance.example.com/api/', custom_http_headers: { 'Authorization': '' } ) # The SDK fetches all feature flag configurations from this # endpoint at startup and polls for updates in the background. enabled = @unleash.is_enabled?('my-feature') ``` ```php PHP SDK use Unleash\Client\UnleashBuilder; $unleash = UnleashBuilder::create() ->withAppName('my-app') ->withAppUrl('https://app.unleash-instance.example.com/api/') ->withInstanceId('my-instance') ->withHeader('Authorization', '') ->build(); // The SDK fetches feature flag configurations from this endpoint // on demand and caches them. It does not poll in the background. $enabled = $unleash->isEnabled('my-feature'); ``` ```csharp .NET SDK using Unleash; var settings = new UnleashSettings() { AppName = "my-app", UnleashApi = new Uri("https://app.unleash-instance.example.com/api/"), CustomHttpHeaders = new Dictionary() { { "Authorization", "" } } }; var unleash = new DefaultUnleash(settings); // The SDK fetches all feature flag configurations from this // endpoint at startup and polls for updates in the background. var enabled = unleash.IsEnabled("my-feature"); ``` ```rust Rust SDK // The SDK reads its configuration from these environment variables: // UNLEASH_API_URL=https://app.unleash-instance.example.com/api/ // UNLEASH_CLIENT_SECRET= let config = EnvironmentConfig::from_env()?; let client = Arc::new( client::ClientBuilder::default() .enable_string_features() .into_client::( &config.api_url, &config.app_name, &config.instance_id, config.secret, )?, ); client.register().await?; // The client does not poll on its own. Run the polling loop in a // background task. The loop fetches feature flag configurations // from this endpoint at the configured interval. let poller = client.clone(); tokio::spawn(async move { poller.poll_for_updates().await }); let enabled = client.is_enabled_str("my-feature", None, false); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://app.unleash-instance.example.com/api/client/features")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```