For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
13.5kProductPricingSign inStart free trialBook a demo
DocsAPIsSDKsEnterprise EdgeGuidesAcademyRelease notes
DocsAPIsSDKsEnterprise EdgeGuidesAcademyRelease notes
    • API overview
  • Client API
  • Frontend API
  • Admin API
      • POSTValidates if a segment name exists
      • GETGet strategy segments
      • GETGet strategies that reference segment
      • GETGet a segment
      • PUTUpdate segment by id
      • DELDeletes a segment by id
      • GETGet all segments
      • POSTCreate a new segment

Unleash reduces the risk of releasing new features, drives innovation by streamlining the software release process, and increases revenue by optimizing end-user experience. While we serve the needs of the world's largest, most security-conscious organizations, we are also rated the “Easiest Feature Management system to use” by G2.

GitHubGitHubLinkedInLinkedInX (Twitter)X (Twitter)SlackSlackStack OverflowStack OverflowYouTubeYouTube

Server SDKs

  • Node.js
  • Java
  • Go
  • Rust
  • Ruby
  • Python
  • .NET
  • PHP
  • All SDKs

Frontend SDKs

  • JavaScript
  • React
  • Next.js
  • Vue
  • iOS
  • Android
  • Flutter

Feature Flag use cases

  • Secure, scalable feature flags
  • Rollbacks
  • FedRAMP, SOC2, ISO2700 compliance
  • Progressive or gradual rollouts
  • Trunk-based development
  • Software kill switches
  • A/B testing
  • Feature management
  • Canary releases

Product

  • Quickstart
  • Unleash architecture
  • Pricing
  • Product vision
  • Open live demo
  • Open source
  • Enterprise feature management platform
  • Unleash vs LaunchDarkly

Support

  • Help center
  • Status
  • Changelog
Made in a cosy atmosphere in the Nordic countries.Copyright © 2026 Unleash
LogoLogo
13.5kProductPricingSign inStart free trialBook a demo
Admin APISegments

Create a new segment

||View as Markdown|
POST
https://app.unleash-instance.example.com/api/admin/segments
POST
/api/admin/segments
$curl -X POST https://app.unleash-instance.example.com/api/admin/segments \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "beta-users",
> "constraints": [
> {
> "contextName": "appName",
> "operator": "IN"
> }
> ]
>}'
1{
2 "id": 2,
3 "name": "ios-users",
4 "constraints": [
5 {
6 "contextName": "appName",
7 "operator": "IN",
8 "caseInsensitive": false,
9 "inverted": false,
10 "values": [
11 "my-app",
12 "my-other-app"
13 ],
14 "value": "my-app"
15 }
16 ],
17 "createdAt": "2023-04-12T11:13:31.960Z",
18 "description": "IOS users segment",
19 "usedInFeatures": 3,
20 "usedInProjects": 2,
21 "project": "red-vista",
22 "createdBy": "someone@example.com"
23}
Creates a new segment using the payload provided
Was this page helpful?
Previous

List service accounts.

Next
Built with

Authentication

Authorizationstring
API key needed to access this API
OR
AuthorizationBearer
API key needed to access this API, in Bearer token format

Request

upsertSegmentSchema
namestringRequired
The name of the segment
constraintslist of objectsRequired
The list of constraints that make up this segment
descriptionstring or nullOptional
A description of what the segment is for
projectstring or nullOptional
The project the segment belongs to if any.

Response headers

locationstring
The location of the newly created resource.

Response

The resource was successfully created.
idinteger>=0
The ID of this segment
namestring
The name of this segment
constraintslist of objects
The list of constraints that are used in this segment
createdAtstringformat: "date-time"
When the segment was created
descriptionstring or null
The description for this segment
usedInFeaturesinteger or null>=0
The number of feature flags that use this segment. The number also includes the any flags with pending change requests that would add this segment.
usedInProjectsinteger or null>=0
The number of projects that use this segment. The number includes any projects with pending change requests that would add this segment.
projectstring or null

The project the segment belongs to. Only present if the segment is a project-specific segment.

createdBystring or null
The creator's email or username

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
415
Unsupported Media Type Error