> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.getunleash.io/api/post-features/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getunleash.io/_mcp/server. # Post Features POST https://edge.unleash-instance.example.com/api/client/features Reference: https://docs.getunleash.io/api/post-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** ```python import requests url = "https://edge.unleash-instance.example.com/api/client/features" headers = {"Authorization": ""} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://edge.unleash-instance.example.com/api/client/features'; const options = {method: 'POST', headers: {Authorization: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://edge.unleash-instance.example.com/api/client/features" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://edge.unleash-instance.example.com/api/client/features") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://edge.unleash-instance.example.com/api/client/features") .header("Authorization", "") .asString(); ``` ```php request('POST', 'https://edge.unleash-instance.example.com/api/client/features', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://edge.unleash-instance.example.com/api/client/features"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```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 = "POST" 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() ```