Skip to main content

Create a new segment

POST 

<your-unleash-url>/api/admin/segments

Creates a new segment using the payload provided

Request

Responses

The resource was successfully created.
Response Headers
  • location string
    The location of the newly created resource.

Authorization: Authorization

name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
curl -L '<your-unleash-url>/api/admin/segments' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
-d '{
"name": "beta-users",
"description": "Users willing to help us test and build new features.",
"project": "red-vista",
"constraints": [
{
"contextName": "appName",
"operator": "IN",
"caseInsensitive": false,
"inverted": false,
"values": [
"my-app",
"my-other-app"
],
"value": "my-app"
}
]
}'
Request Collapse all
Base URL
<your-unleash-url>
Auth
Body required
{
  "name": "beta-users",
  "description": "Users willing to help us test and build new features.",
  "project": "red-vista",
  "constraints": [
    {
      "contextName": "appName",
      "operator": "IN",
      "caseInsensitive": false,
      "inverted": false,
      "values": [
        "my-app",
        "my-other-app"
      ],
      "value": "my-app"
    }
  ]
}
ResponseClear

Click the Send API Request button above and see the response here!