launchdarkly Segments API

Create and manage user segments for targeting groups of contexts with feature flags.

Business capability
Feature Flag Management BC-4210.50

Operations 23

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /api/v2/projects/{projectKey}/environments/{environmentKey}/segments/evaluate List segment memberships for context instance #
GET /api/v2/segments/{projectKey}/{environmentKey} List segments #
POST /api/v2/segments/{projectKey}/{environmentKey} Create segment #
GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} Get segment #
PATCH /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} Patch segment #
DELETE /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} Delete segment #
POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts Update context targets on a big segment #
GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts/{contextKey} Get big segment membership for context #
POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports Create big segment export #
GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports/{exportID} Get big segment export #
POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports Create big segment import #
GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports/{importID} Get big segment import #
POST /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users Update user context targets on a big segment #
GET /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users/{userKey} Get big segment membership for user #
GET /api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey} Get expiring targets for segment #
PATCH /api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey} Update expiring targets for segment #
GET /api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey} Get expiring user targets for segment #
PATCH /api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey} Update expiring user targets for segment #
GET /segments/{projectKey}/{environmentKey} List segments in an environment · List segments #
Ask an LLM
“What user segments exist in this environment?”
“Can I page through segments in a project environment?”
Tell an agent
List segments in {projectKey}/{environmentKey}.
Show {limit} segments in {projectKey}/{environmentKey} from offset {offset}.
POST /segments/{projectKey}/{environmentKey} Create a user segment · Create a segment #
Ask an LLM
“How do I create a segment of beta users?”
“Can I tag a segment when creating it?”
Tell an agent
Create segment {name} with key {key} in {projectKey}/{environmentKey}.
Add a segment {key} named {name} in {projectKey}/{environmentKey} tagged {tags}.
GET /segments/{projectKey}/{environmentKey}/{segmentKey} Get one segment · Get a segment #
Ask an LLM
“How do I see who is included in a specific segment?”
“What are the rules on a particular segment?”
Tell an agent
Get segment {segmentKey} in {projectKey}/{environmentKey}.
Show the details of segment {segmentKey} in {projectKey}/{environmentKey}.
PATCH /segments/{projectKey}/{environmentKey}/{segmentKey} Update a segment · Update a segment #
Ask an LLM
“How do I add users to an existing segment?”
“Can I change a segment's rules with a semantic patch?”
Tell an agent
Update segment {segmentKey} in {projectKey}/{environmentKey} with patch {patch}.
Apply {patch} to segment {segmentKey} in {projectKey}/{environmentKey}, commenting {comment}.
DELETE /segments/{projectKey}/{environmentKey}/{segmentKey} Delete a segment · Delete a segment #
Ask an LLM
“How do I permanently delete a segment?”
“Can a deleted segment be recovered?”
Tell an agent destructive · confirm first
Delete segment {segmentKey} from {projectKey}/{environmentKey}.
Permanently remove segment {segmentKey} in {projectKey}/{environmentKey}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/launchdarkly:launchdarkly-segments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

launchdarkly-segments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Launchdarkly Segments API
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: '1.0'
  description: 'Operations tagged Segments across 2 of this provider''s published API definitions: launchdarkly-openapi.json, launchdarkly-rest-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://app.launchdarkly.com
  description: ' Default'
- url: https://app.launchdarkly.us
  description: ' Federal'
- url: https://app.launchdarkly.com/api/v2
  description: LaunchDarkly Production API
tags:


# --- truncated at 32 KB (99 KB total) ---
# Full source: https://artifacts.apis.io/launchdarkly/openapi/launchdarkly-segments-api-openapi.yml