provider Segments POST /api/v2/segments/{projectKey}/{environmentKey}
@utdk/launchdarkly /api/v2/segments/{projectKey}/{environmentKey}
Create segment
Create a new segment.
projectKey path required
The project key
string
environmentKey path required
The environment key
string

Try it

Authentication
Configure credentials for LaunchDarkly REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

postsegment
POST/api/v2/segments/{projectKey}/{environmentKey}
Create a new segment.

Parameters

required

The project key

required

The environment key

Input

required

A human-friendly name for the segment

required

A unique key used to reference the segment

A description of the segment's purpose

Tags for the segment

Whether to create a standard segment (<code>false</code>) or a big segment (<code>true</code>). Standard segments include rule-based and smaller list-based segments. Big segments include larger list-based segments and synced segments. Only use a big segment if you need to add more than 15,000 individual targets.

For big segments, the targeted context kind.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import launchdarkly from '@utdk/launchdarkly';

await launchdarkly.postsegment()