For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Create a new segment.
curl --request POST \
--url https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example segment",
"key": "segment-key-123abc",
"description": "Bundle our sample customers together",
"tags": [
"testing"
],
"unbounded": false,
"unboundedContextKind": "device"
}
'{
"name": "Example segment",
"tags": [
"testing"
],
"creationDate": "1654104600000",
"lastModifiedDate": "1654104600000",
"key": "segment-key-123abc",
"_links": {},
"rules": [
{
"_id": "1234a56b7c89d012345e678f",
"clauses": [
{
"_id": "12ab3c45de678910fab12345",
"attribute": "email",
"negate": false,
"op": "endsWith",
"values": [
".edu"
]
}
]
}
],
"version": 1,
"deleted": false,
"generation": 123,
"description": "Bundle our sample customers together",
"included": [
"user-key-123abc"
],
"excluded": [
"user-key-123abc"
],
"includedContexts": [
{
"values": [
"<string>"
],
"contextKind": "<string>"
}
],
"excludedContexts": [
{
"values": [
"<string>"
],
"contextKind": "<string>"
}
],
"_access": {
"denied": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
],
"allowed": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
]
},
"_flags": [
{
"name": "Example flag",
"key": "flag-key-123abc",
"_links": {},
"_site": {
"href": "<string>",
"type": "<string>"
}
}
],
"unbounded": false,
"unboundedContextKind": "<string>",
"_unboundedMetadata": {
"envId": "<string>",
"segmentId": "<string>",
"version": 123,
"includedCount": 123,
"excludedCount": 123,
"lastModified": 123,
"deleted": true
},
"_external": "amplitude",
"_externalLink": "https://analytics.amplitude.com/org/1234/cohort/123abc",
"_importInProgress": false
}Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The project key
The environment key
A human-friendly name for the segment
"Example segment"
A unique key used to reference the segment
"segment-key-123abc"
A description of the segment's purpose
"Bundle our sample customers together"
Tags for the segment
["testing"]Whether to create a standard segment (false) or a big segment (true). 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.
false
For big segments, the targeted context kind.
"device"
Segment response
A human-friendly name for the segment.
"Example segment"
Tags for the segment. Defaults to an empty array.
["testing"]Timestamp of when the segment was created
"1654104600000"
Timestamp of when the segment was last modified
"1654104600000"
A unique key used to reference the segment
"segment-key-123abc"
The location and content type of related resources
Show child attributes
An array of the targeting rules for this segment.
Show child attributes
[
{
"_id": "1234a56b7c89d012345e678f",
"clauses": [
{
"_id": "12ab3c45de678910fab12345",
"attribute": "email",
"negate": false,
"op": "endsWith",
"values": [".edu"]
}
]
}
]Version of the segment
1
Whether the segment has been deleted
false
For big segments, how many times this segment has been created.
A description of the segment's purpose. Defaults to null and is omitted in the response if not provided.
"Bundle our sample customers together"
An array of keys for included targets. Included individual targets are always segment members, regardless of segment rules. For list-based segments over 15,000 entries, also called big segments, this array is either empty or omitted.
["user-key-123abc"]An array of keys for excluded targets. Segment rules bypass individual excluded targets, so they will never be included based on rules. Excluded targets may still be included explicitly. This value is omitted for list-based segments over 15,000 entries, also called big segments.
["user-key-123abc"]Show child attributes
Show child attributes
Show child attributes
A list of flags targeting this segment. Only included when getting a single segment, using the getSegment endpoint.
Show child attributes
Whether this is a standard segment (false) or a big segment (true). Standard segments include rule-based segments and smaller list-based segments. Big segments include larger list-based segments and synced segments. If omitted, the segment is a standard segment.
false
For big segments, the targeted context kind.
Details on the external data store backing this segment. Only applies to big segments.
Show child attributes
The external data store backing this segment. Only applies to synced segments.
"amplitude"
The URL for the external data store backing this segment. Only applies to synced segments.
"https://analytics.amplitude.com/org/1234/cohort/123abc"
Whether an import is currently in progress for the specified segment. Only applies to big segments.
false
curl --request POST \
--url https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example segment",
"key": "segment-key-123abc",
"description": "Bundle our sample customers together",
"tags": [
"testing"
],
"unbounded": false,
"unboundedContextKind": "device"
}
'{
"name": "Example segment",
"tags": [
"testing"
],
"creationDate": "1654104600000",
"lastModifiedDate": "1654104600000",
"key": "segment-key-123abc",
"_links": {},
"rules": [
{
"_id": "1234a56b7c89d012345e678f",
"clauses": [
{
"_id": "12ab3c45de678910fab12345",
"attribute": "email",
"negate": false,
"op": "endsWith",
"values": [
".edu"
]
}
]
}
],
"version": 1,
"deleted": false,
"generation": 123,
"description": "Bundle our sample customers together",
"included": [
"user-key-123abc"
],
"excluded": [
"user-key-123abc"
],
"includedContexts": [
{
"values": [
"<string>"
],
"contextKind": "<string>"
}
],
"excludedContexts": [
{
"values": [
"<string>"
],
"contextKind": "<string>"
}
],
"_access": {
"denied": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
],
"allowed": [
{
"action": "<string>",
"reason": {
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"notResources": [
"<string>"
],
"actions": [
"*"
],
"notActions": [
"<string>"
],
"role_name": "<string>"
}
}
]
},
"_flags": [
{
"name": "Example flag",
"key": "flag-key-123abc",
"_links": {},
"_site": {
"href": "<string>",
"type": "<string>"
}
}
],
"unbounded": false,
"unboundedContextKind": "<string>",
"_unboundedMetadata": {
"envId": "<string>",
"segmentId": "<string>",
"version": 123,
"includedCount": 123,
"excludedCount": 123,
"lastModified": 123,
"deleted": true
},
"_external": "amplitude",
"_externalLink": "https://analytics.amplitude.com/org/1234/cohort/123abc",
"_importInProgress": false
}