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
  • Get started
    • Overview
    • Onboarding
    • Get started
    • Launch Insights
    • LaunchDarkly architecture
    • LaunchDarkly vocabulary
  • AgentControl
    • AgentControl
    • Manage AgentControl
  • Feature flags
    • Create flags
    • Target with flags
    • Flag templates
    • Manage flags
    • Code references
    • Contexts
    • Segments
      • Creating segments
      • Targeting segments
      • Managing segments
      • Segment types
      • SDK and integration configuration for segments
  • Releases
    • Releasing features with LaunchDarkly
    • Release policies
    • Percentage rollouts
    • Progressive rollouts
    • Guarded rollouts
    • Feature monitoring
    • Release pipelines
    • Engineering insights
    • Release management tools
    • Applications and app versions
    • Change history
    • Restoring previous flag versions
  • Observability
    • Observability
    • Session replay
    • Error monitoring
    • Logs
    • Traces
    • Observability metrics
    • Product analytics events
    • LLM observability
    • Alerts
    • Dashboards
    • Service map
    • Vega for auto-remediation
    • Observability MCP server
    • Search specification
    • Observability settings
    • Observability integrations
  • Experimentation
    • Experimentation
    • Experiment metric types
    • Experiment configuration
    • Managing experiments
    • Analyzing experiments
    • Multi-armed bandits
    • Holdouts
  • Metrics and events
    • Metrics in LaunchDarkly
    • Creating metrics
    • Metric groups
    • Events
    • Autogenerated metrics
  • Warehouse native
    • Warehouse native metrics
    • Setting up external warehouses
    • Creating experiments using warehouse native metrics
  • Infrastructure
    • Connect apps and services to LaunchDarkly
    • LaunchDarkly in China and Pakistan
    • LaunchDarkly in the European Union (EU)
    • LaunchDarkly in federal environments
    • Public IP list
  • Your account
    • Projects
    • Views
    • Environments
    • Tags
    • Teams
    • Members
    • Roles
    • Account security
    • Feature previews
    • Billing and usage
    • Changelog
Sign inTry it free
LogoLogo
On this page
  • Overview
  • Update segment details
  • Link segments to views
  • Update segment targeting
  • Test segment targeting
  • Delete segments
Feature flagsSegments

Managing segments

Was this page helpful?
Previous

Segment types

Next
Built with

Overview

This topic explains how to edit, test, and delete segments.

Update segment details

To update a segment’s name, description, or tags:

  1. Navigate to the segment detail page for the segment you want to update.
  2. Click the gear icon to open the segment’s settings page.
  3. Edit the Name, Description, and Tags for each segment.
  4. Click Save.

Link segments to views

Link segments to views to organize them and control access. Views let you group segments according to the teams in your organization and the features they work on.

To link a segment to a view when you create the segment, use the Add views dropdown in the segment creation dialog. To learn more, read Creating segments.

To link a segment to a view from the segment details page:

  1. From the segment detail page, find “Views” in the right sidebar.
  2. Click the pencil icon.
  3. Check the checkbox next to the views you want to link the segment to.

Your project might require new segments to be associated with at least one view. To learn more, read Require resources to be linked to a view.

Update segment targeting

To update a segment’s targeting:

  1. Navigate to the segment detail page for the segment you want to update.
  2. Update the segment’s targeting based on the kind of segment:
  • For rule-based segments, add, remove, or edit the segment’s targeting rules. To learn more, read Rule-based segments.
  • For list-based segments, add or remove individual targets or upload a new CSV to overwrite or merge with the existing targets. To learn more, read List-based segments.
  • For synced segments, you cannot change segment targeting within LaunchDarkly. Instead, edit the segment in the source application. To learn more, read Segments synced from external tools.

Test segment targeting

You can use the test run feature to test a segment’s targeting rules to find out whether or not a particular context will be included in the segment. Testing segment targeting helps ensure that contexts are included or excluded from segments as you expect.

To test a segment’s targeting:

  1. From the Segments list, open the segment you want to test.

  2. Make any needed changes to the segment rules and save your changes.

  3. Click the fingerprint test run icon. The “Test run a context” section appears.

  4. In the contexts field, search for and select the context you want to preview.

    The "Test run a context" section, populated with an example context kind and key.

    The "Test run a context" section, populated with an example context kind and key.

The “Test run a context” section populates with whether or not the context is included in the segment.

Delete segments

To delete a segment:

  1. Navigate to the segment detail page for the segment you want to update.
  2. Click the gear icon to open the segment’s settings page.
  3. Click Delete this segment.
  4. In the “Delete segment?” dialog, click Delete.

You cannot delete a segment if one or more flags is using it.

You can also use the REST API: Delete segment