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.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
      • POSTCreate big segment export
      • POSTCreate big segment import
      • POSTCreate segment
      • DELDelete segment
      • GETGet big segment export
      • GETGet big segment import
      • GETGet big segment membership for context
      • GETGet big segment membership for user
      • GETGet expiring targets for segment
      • GETGet expiring user targets for segment
      • GETGet segment
      • POSTList segment memberships for context instance
      • GETList segments
      • PATCHPatch segment
      • POSTUpdate context targets on a big segment
      • PATCHUpdate expiring targets for segment
      • PATCHUpdate expiring user targets for segment
      • POSTUpdate user context targets on a big segment
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewSegments

List segment memberships for context instance

POST
/api/v2/projects/:projectKey/environments/:environmentKey/segments/evaluate
POST
/api/v2/projects/:projectKey/environments/:environmentKey/segments/evaluate
$curl -X POST https://app.launchdarkly.com/api/v2/projects/projectKey/environments/environmentKey/segments/evaluate \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "address": {
> "city": "Springfield",
> "street": "123 Main Street"
> },
> "jobFunction": "doctor",
> "key": "context-key-123abc",
> "kind": "user",
> "name": "Sandy"
>}'
1{
2 "items": [
3 {
4 "name": "Segment Name",
5 "key": "segment-key-123abc",
6 "description": "Segment description",
7 "unbounded": false,
8 "external": "https://amplitude.com/myCohort",
9 "isMember": true,
10 "isIndividuallyTargeted": true,
11 "isRuleTargeted": false,
12 "_links": {}
13 }
14 ],
15 "_links": {}
16}
For a given context instance with attributes, get membership details for all segments. In the request body, pass in the context instance.
Was this page helpful?
Previous

List segments

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key
environmentKeystringRequiredformat: "string"
The environment key

Request

This endpoint expects a map from strings to any.

Response

Context instance segment membership collection response
itemslist of objects
_linksmap from strings to objects
The location and content type of related resources

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error