Segments (beta)

Big Segments is an Enterprise feature

Big Segments is 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. To learn more, read Big 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.

List segment memberships for context instance

For a given context instance with attributes, get membership details for all segments

Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

Request Body schema: application/json
property name*
additional property
any
Responses
200

Context instance segment membership collection response

400

Invalid request

401

Invalid access token

404

Invalid resource identifier

post/api/v2/projects/{projectKey}/environments/{environmentKey}/segments/evaluate
Request samples
application/json
{
  • "key": "context-key-123abc",
  • "kind": "user",
  • "moreComplex": {
    },
  • "name": "Some User",
  • "something": true
}
Response samples
application/json
{
  • "items": [
    ],
  • "_links": {
    }
}

Create Big Segment export

Starts a new export process for a Big Segment

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 info about a Big Segment export process.

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.

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
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 info about a Big Segment import process.

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": {
    }
}