Segments (beta)

Synced segments and larger list-based segments are an Enterprise feature

This section documents endpoints for rule-based, list-based, and synced segments.

A "big segment" is a segment that is either a synced segment, or a list-based segment with more than 15,000 entries that includes only one targeted context kind. LaunchDarkly uses different implementations for different types of segments so that all of your segments have good performance.

In the segments API, a big segment is indicated by the unbounded field being set to true.

These segments are available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

This feature is in beta

To use this feature, pass in a header including the LD-API-Version key with value set to beta. Use this header with each call. To learn more, read Beta resources.

Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.

The segments API allows you to create and retrieve exports and imports for big segments, which are synced segments or list-based segments with 15,000 or more entries. To learn more, read Segments.

Several of the endpoints in the segments API require an import or export ID. The import ID is returned in the Location header as part of the Create big segment import request. The export ID is returned in the Location header as part of the Create big segment export request. In each case, the ID is the final element of the path returned in the Location header.

You can find other APIs for working with big segments under Segments and Integrations (beta).

Create big segment export

Starts a new export process for a big segment. This is an export for a synced segment or a list-based segment that can include more than 15,000 entries.

Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

segmentKey
required
string <string>

The segment key

Responses
200

Action succeeded

400

Invalid request

401

Invalid access token

404

Invalid resource identifier

429

Rate limited

post/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports
Request samples
Response samples
application/json
{
  • "code": "invalid_request",
  • "message": "Invalid request body"
}

Get big segment export

Returns information about a big segment export process. This is an export for a synced segment or a list-based segment that can include more than 15,000 entries.

Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

segmentKey
required
string <string>

The segment key

exportID
required
string <string>

The export ID

Responses
200

Segment export response

400

Invalid request

404

Invalid resource identifier

429

Rate limited

get/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports/{exportID}
Request samples
Response samples
application/json
{
  • "id": "1234a567-bcd8-9123-4567-abcd1234567f",
  • "segmentKey": "example-big-segment",
  • "creationTime": 0,
  • "status": "complete",
  • "sizeBytes": 18,
  • "size": "18 B",
  • "initiator": {
    },
  • "_links": {
    }
}

Create big segment import

Start a new import process for a big segment. This is an import for a list-based segment that can include more than 15,000 entries.

Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

segmentKey
required
string <string>

The segment key

Request Body schema: multipart/form-data
required
file
string <binary>

CSV file containing keys

mode
string <string>

Import mode. Use either merge or replace

Responses
204

Import request submitted successfully

400

Invalid request

401

Invalid access token

404

Invalid resource identifier

409

Conflicting process

429

Rate limited

post/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports
Request samples
Response samples
application/json
{
  • "code": "invalid_request",
  • "message": "Invalid request body"
}

Get big segment import

Returns information about a big segment import process. This is the import of a list-based segment that can include more than 15,000 entries.

Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

segmentKey
required
string <string>

The segment key

importID
required
string <string>

The import ID

Responses
200

Segment import response

400

Invalid request

404

Invalid resource identifier

429

Rate limited

get/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports/{importID}
Request samples
Response samples
application/json
{
  • "id": "1234a567-bcd8-9123-4567-abcd1234567f",
  • "segmentKey": "example-big-segment",
  • "creationTime": 0,
  • "mode": "replace",
  • "status": "complete",
  • "files": [
    ],
  • "_links": {
    }
}