> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.getunleash.io/api/get-features/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getunleash.io/_mcp/server. # Get Features GET https://edge.unleash-instance.example.com/api/client/features Reference: https://docs.getunleash.io/api/get-features ## Authentication - `Authorization` header (required) — API Key authentication via header ## Request ### Query parameters - `namePrefix` (string, optional, nullable) ## Response ### 200 Return feature toggles for this token - `features` (list of ClientFeature, required) - `version` (integer, required) - `meta` (Meta, optional, nullable) - `query` (Query, optional, nullable) - `segments` (list of Segment, optional, nullable) ## Errors ### 400 Bad Request Error Invalid parameters used - `any` ### 403 Forbidden Error Was not allowed to access features - `any` ## Types ### ClientFeature - `enabled` (boolean, required) - `name` (string, required) - `createdAt` (string, optional, nullable) - `dependencies` (list of FeatureDependency, optional, nullable) - `description` (string, optional, nullable) - `impressionData` (boolean, optional, nullable) - `lastSeenAt` (string, optional, nullable) - `project` (string, optional, nullable) - `stale` (boolean, optional, nullable) - `strategies` (list of Strategy, optional, nullable) - `type` (string, optional, nullable) - `variants` (list of Variant, optional, nullable) ### Meta - `etag` (string, optional, nullable) - `queryHash` (string, optional, nullable) - `revisionId` (integer, optional, nullable) ### Query - `environment` (string, optional, nullable) - `inlineSegmentConstraints` (boolean, optional, nullable) - `namePrefix` (string, optional, nullable) - `projects` (list of string, optional, nullable) - `tags` (list of list of string, optional, nullable) ### Segment - `constraints` (list of Constraint, required) - `id` (integer, required) ### FeatureDependency - `feature` (string, required) - `enabled` (boolean, optional, nullable) - `variants` (list of string, optional, nullable) ### Strategy - `name` (string, required) - `constraints` (list of Constraint, optional, nullable) - `parameters` (map from string to string, optional, nullable) - `segments` (list of integer, optional, nullable) - `sortOrder` (integer, optional, nullable) - `variants` (list of StrategyVariant, optional, nullable) ### Variant - `name` (string, required) - `weight` (integer, required) - `overrides` (list of Override, optional, nullable) - `payload` (Payload, optional, nullable) - `stickiness` (string, optional, nullable) - `weightType` (enum, optional, nullable) - Allowed values: `fix`, `variable` ### Constraint - `contextName` (string, required) - `operator` (Operator, required) - `caseInsensitive` (boolean, optional) - `inverted` (boolean, optional) - `value` (string, optional, nullable) - `values` (list of string, optional, nullable) ### StrategyVariant - `name` (string, required) - `weight` (integer, required) - `payload` (Payload, optional, nullable) - `stickiness` (string, optional, nullable) ### Override - `contextName` (string, required) - `values` (list of string, required) ### Payload - `type` (string, required) - `value` (string, required) ### Operator ### Operator19 - `UNKNOWN` (string, required) ## Examples **Response** ```json { "features": [ { "enabled": true, "name": "string", "createdAt": "2024-01-15T09:30:00Z", "dependencies": [ { "feature": "string", "enabled": true, "variants": [ "string" ] } ], "description": "string", "impressionData": true, "lastSeenAt": "2024-01-15T09:30:00Z", "project": "string", "stale": true, "strategies": [ { "name": "string", "constraints": [ { "contextName": "string", "operator": "NOT_IN", "caseInsensitive": true, "inverted": true, "value": "string", "values": [ "string" ] } ], "parameters": {}, "segments": [ 1 ], "sortOrder": 1, "variants": [ { "name": "string", "weight": 1, "payload": null, "stickiness": "string" } ] } ], "type": "string", "variants": [ { "name": "string", "weight": 1, "overrides": [ { "contextName": "string", "values": [ "string" ] } ], "payload": null, "stickiness": "string", "weightType": null } ] } ], "version": 1, "meta": null, "query": null, "segments": [ { "constraints": [ { "contextName": "string", "operator": "NOT_IN", "caseInsensitive": true, "inverted": true, "value": "string", "values": [ "string" ] } ], "id": 1 } ] } ``` **SDK Code** ```javascript Node.js SDK import { initialize } from 'unleash-client'; const unleash = initialize({ url: 'https://edge.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://edge.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://edge.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://edge.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://edge.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://edge.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://edge.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://edge.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://edge.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() ```