> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getunleash.io/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)

## Request

### Query parameters

- `namePrefix` (string, optional, nullable)

## Response

### 200

Return feature toggles for this token

- `features` (list of object, required)
  - `enabled` (boolean, required)
  - `name` (string, required)
  - `createdAt` (string, optional, nullable)
  - `dependencies` (list of object, optional, nullable)
    - `feature` (string, required)
    - `enabled` (boolean, optional, nullable)
    - `variants` (list of string, 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 object, optional, nullable)
    - `name` (string, required)
    - `constraints` (list of object, optional, nullable)
      - `contextName` (string, required)
      - `operator` (enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or object, required)
        - object
          - `UNKNOWN` (string, required)
      - `caseInsensitive` (boolean, optional)
      - `inverted` (boolean, optional)
      - `value` (string, optional, nullable)
      - `values` (list of string, optional, nullable)
    - `parameters` (map from string to string, optional, nullable)
    - `segments` (list of integer, optional, nullable)
    - `sortOrder` (integer, optional, nullable)
    - `variants` (list of object, optional, nullable)
      - `name` (string, required)
      - `weight` (integer, required)
      - `payload` (object, optional, nullable)
        - `type` (string, required)
        - `value` (string, required)
      - `stickiness` (string, optional, nullable)
  - `type` (string, optional, nullable)
  - `variants` (list of object, optional, nullable)
    - `name` (string, required)
    - `weight` (integer, required)
    - `overrides` (list of object, optional, nullable)
      - `contextName` (string, required)
      - `values` (list of string, required)
    - `payload` (object, optional, nullable)
      - `type` (string, required)
      - `value` (string, required)
    - `stickiness` (string, optional, nullable)
    - `weightType` (enum, optional, nullable)
      - Allowed values: `fix`, `variable`
- `version` (integer, required)
- `meta` (object, optional, nullable)
  - `etag` (string, optional, nullable)
  - `queryHash` (string, optional, nullable)
  - `revisionId` (integer, optional, nullable)
- `query` (object, optional, nullable)
  - `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)
- `segments` (list of object, optional, nullable)
  - `constraints` (list of object, required)
    - `contextName` (string, required)
    - `operator` (enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or enum or object, required)
      - object
        - `UNKNOWN` (string, required)
    - `caseInsensitive` (boolean, optional)
    - `inverted` (boolean, optional)
    - `value` (string, optional, nullable)
    - `values` (list of string, optional, nullable)
  - `id` (integer, required)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "features": [
    {
      "enabled": true,
      "name": "new-onboarding-flow",
      "createdAt": "2024-01-15T09:30:00Z",
      "dependencies": [
        {
          "feature": "user-profile-update",
          "enabled": true,
          "variants": [
            "beta",
            "control"
          ]
        }
      ],
      "description": "Enable new user onboarding flow",
      "impressionData": true,
      "lastSeenAt": "2024-01-15T09:30:00Z",
      "project": "user-experience",
      "stale": true,
      "strategies": [
        {
          "name": "gradualRolloutUserId",
          "constraints": [
            {
              "contextName": "environment",
              "operator": "NOT_IN",
              "caseInsensitive": true,
              "inverted": true,
              "value": "production",
              "values": [
                "production",
                "staging"
              ]
            }
          ],
          "parameters": {
            "groupId": "onboarding-testers",
            "percentage": "20"
          },
          "segments": [
            1
          ],
          "sortOrder": 1,
          "variants": [
            {
              "name": "beta",
              "weight": 50,
              "payload": null,
              "stickiness": "userId"
            }
          ]
        }
      ],
      "type": "release",
      "variants": [
        {
          "name": "beta",
          "weight": 50,
          "overrides": [
            {
              "contextName": "userId",
              "values": [
                "12345",
                "67890"
              ]
            }
          ],
          "payload": null,
          "stickiness": "userId",
          "weightType": null
        }
      ]
    }
  ],
  "version": 1,
  "meta": null,
  "query": null,
  "segments": [
    {
      "constraints": [
        {
          "contextName": "region",
          "operator": "NOT_IN",
          "caseInsensitive": true,
          "inverted": true,
          "value": "eu-west-1",
          "values": [
            "eu-west-1",
            "us-east-1"
          ]
        }
      ],
      "id": 1
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://edge.unleash-instance.example.com/api/client/features"

payload = {}
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://edge.unleash-instance.example.com/api/client/features';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://edge.unleash-instance.example.com/api/client/features"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://edge.unleash-instance.example.com/api/client/features")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://edge.unleash-instance.example.com/api/client/features', [
  'body' => '{}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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
request.httpBody = postData as Data

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()
```