LaunchDarkly REST API

The LaunchDarkly REST API provides programmatic access to the full LaunchDarkly feature management platform. Developers can create, update, and manage feature flags, targeting rules, user segments, projects, environments, and team members. The API also supports scheduled flag changes, release pipelines, experimentation, approval workflows, and webhook integrations.

OpenAPI Specification

launchdarkly-rest-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: LaunchDarkly REST API
  description: >-
    The LaunchDarkly REST API provides programmatic access to the full
    LaunchDarkly feature management platform. Developers can create, update,
    and manage feature flags, targeting rules, user segments, projects,
    environments, and team members. The API also supports scheduled flag
    changes, release pipelines, experimentation, approval workflows, and
    webhook integrations. Authentication is handled via personal or service
    access tokens, and the API follows a versioned scheme with the current
    default version being 20240415.
  version: '20240415'
  contact:
    name: LaunchDarkly Support
    url: https://support.launchdarkly.com
  termsOfService: https://launchdarkly.com/policies/terms-of-service
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
externalDocs:
  description: LaunchDarkly API Documentation
  url: https://apidocs.launchdarkly.com/
servers:
  - url: https://app.launchdarkly.com/api/v2
    description: LaunchDarkly Production API
tags:
  - name: Access Tokens
    description: >-
      Create and manage personal and service access tokens used
      to authenticate API requests.
  - name: Account Members
    description: >-
      Manage team members, invitations, and member roles within
      a LaunchDarkly account.
  - name: Approvals
    description: >-
      Manage approval requests and workflows for flag changes
      that require review before deployment.
  - name: Audit Log
    description: >-
      Access the change history of all modifications made to
      resources in the LaunchDarkly account.
  - name: Code References
    description: >-
      View code references that show where feature flags are
      used in your codebase.
  - name: Custom Roles
    description: >-
      Define custom roles with fine-grained permissions using
      resource specifiers and actions.
  - name: Environments
    description: >-
      Manage environments within projects such as production, staging,
      and development.
  - name: Experiments
    description: >-
      Create and manage experiments to measure the impact of feature
      flag variations on metrics.
  - name: Feature Flags
    description: >-
      Create, update, and manage feature flags and their targeting rules
      across projects and environments.
  - name: Flag Triggers
    description: >-
      Create triggers that allow external services to toggle
      feature flags via unique webhook URLs.
  - name: Integration Audit Log Subscriptions
    description: >-
      Manage integrations that subscribe to audit log events
      and forward them to external tools.
  - name: Metrics
    description: >-
      Define and manage metrics used to measure experiment outcomes
      and feature flag impact.
  - name: Projects
    description: >-
      Manage projects that organize feature flags and other resources.
  - name: Relay Proxy Configurations
    description: >-
      Manage automatic configuration entries for LaunchDarkly
      Relay Proxy instances.
  - name: Releases
    description: >-
      Manage release pipelines for coordinating feature flag
      rollouts across environments.
  - name: Segments
    description: >-
      Create and manage user segments for targeting groups of contexts
      with feature flags.
  - name: Teams
    description: >-
      Organize account members into teams for collaborative flag
      management and permissions.
  - name: Webhooks
    description: >-
      Configure webhooks to receive HTTP POST notifications when
      changes occur in LaunchDarkly.
  - name: Workflows
    description: >-
      Create and manage automated workflows for scheduling and
      orchestrating flag changes.
security:
  - bearerAuth: []
paths:
  /flags/{projectKey}:
    get:
      operationId: listFeatureFlags
      summary: List feature flags
      description: >-
        Returns a paginated list of all feature flags in the specified
        project. Supports filtering by tag, query string, and environment.
      tags:
        - Feature Flags
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - name: env
          in: query
          description: >-
            Filter configurations by environment key.
          schema:
            type: string
        - name: tag
          in: query
          description: >-
            Filter flags by tag.
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Maximum number of flags to return.
          schema:
            type: integer
        - name: offset
          in: query
          description: >-
            Number of flags to skip for pagination.
          schema:
            type: integer
        - name: filter
          in: query
          description: >-
            A filter expression to apply to the flag list, supporting
            query, tags, and other fields.
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing a list of feature flags.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureFlags'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Project not found.
    post:
      operationId: createFeatureFlag
      summary: Create a feature flag
      description: >-
        Creates a new feature flag in the specified project with the
        provided configuration including key, name, variations, and
        default targeting rules.
      tags:
        - Feature Flags
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeatureFlagBody'
      responses:
        '201':
          description: Feature flag created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureFlag'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '409':
          description: A flag with the given key already exists.
  /flags/{projectKey}/{flagKey}:
    get:
      operationId: getFeatureFlag
      summary: Get a feature flag
      description: >-
        Returns a single feature flag by its key, including all
        environment-specific configurations and targeting rules.
      tags:
        - Feature Flags
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/FlagKey'
        - name: env
          in: query
          description: >-
            Filter configurations by environment key.
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing the feature flag.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureFlag'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Flag or project not found.
    patch:
      operationId: patchFeatureFlag
      summary: Update a feature flag
      description: >-
        Updates a feature flag using a JSON Patch or semantic patch
        representation. Supports modifying targeting rules, variations,
        prerequisites, and other flag settings.
      tags:
        - Feature Flags
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/FlagKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchOperation'
      responses:
        '200':
          description: Feature flag updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureFlag'
        '400':
          description: Invalid patch request.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Flag or project not found.
        '409':
          description: Conflict due to concurrent modification.
    delete:
      operationId: deleteFeatureFlag
      summary: Delete a feature flag
      description: >-
        Permanently deletes a feature flag and all of its associated
        targeting rules and environment configurations.
      tags:
        - Feature Flags
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/FlagKey'
      responses:
        '204':
          description: Feature flag deleted successfully.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Flag or project not found.
  /projects:
    get:
      operationId: listProjects
      summary: List projects
      description: >-
        Returns a list of all projects in the LaunchDarkly account.
      tags:
        - Projects
      parameters:
        - name: limit
          in: query
          description: >-
            Maximum number of projects to return.
          schema:
            type: integer
        - name: offset
          in: query
          description: >-
            Number of projects to skip for pagination.
          schema:
            type: integer
        - name: filter
          in: query
          description: >-
            A filter expression to apply to the project list.
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing a list of projects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Projects'
        '401':
          description: Unauthorized. Invalid or missing access token.
    post:
      operationId: createProject
      summary: Create a project
      description: >-
        Creates a new project with the specified key, name, and
        default environments.
      tags:
        - Projects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectBody'
      responses:
        '201':
          description: Project created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '409':
          description: A project with the given key already exists.
  /projects/{projectKey}:
    get:
      operationId: getProject
      summary: Get a project
      description: >-
        Returns a single project by its key, including its environments
        and configuration.
      tags:
        - Projects
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
      responses:
        '200':
          description: Successful response containing the project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Project not found.
    patch:
      operationId: patchProject
      summary: Update a project
      description: >-
        Updates a project using a JSON Patch representation.
      tags:
        - Projects
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchOperation'
      responses:
        '200':
          description: Project updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        '400':
          description: Invalid patch request.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Project not found.
    delete:
      operationId: deleteProject
      summary: Delete a project
      description: >-
        Permanently deletes a project and all of its associated
        feature flags, environments, and other resources.
      tags:
        - Projects
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
      responses:
        '204':
          description: Project deleted successfully.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Project not found.
  /projects/{projectKey}/environments:
    get:
      operationId: listEnvironments
      summary: List environments
      description: >-
        Returns a list of all environments within the specified project.
      tags:
        - Environments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - name: limit
          in: query
          description: >-
            Maximum number of environments to return.
          schema:
            type: integer
        - name: offset
          in: query
          description: >-
            Number of environments to skip for pagination.
          schema:
            type: integer
      responses:
        '200':
          description: Successful response containing a list of environments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environments'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Project not found.
    post:
      operationId: createEnvironment
      summary: Create an environment
      description: >-
        Creates a new environment in the specified project.
      tags:
        - Environments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentBody'
      responses:
        '201':
          description: Environment created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '409':
          description: An environment with the given key already exists.
  /projects/{projectKey}/environments/{environmentKey}:
    get:
      operationId: getEnvironment
      summary: Get an environment
      description: >-
        Returns a single environment by its key within the specified project.
      tags:
        - Environments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/EnvironmentKey'
      responses:
        '200':
          description: Successful response containing the environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Environment or project not found.
    patch:
      operationId: patchEnvironment
      summary: Update an environment
      description: >-
        Updates an environment using a JSON Patch representation.
      tags:
        - Environments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/EnvironmentKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchOperation'
      responses:
        '200':
          description: Environment updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '400':
          description: Invalid patch request.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Environment or project not found.
    delete:
      operationId: deleteEnvironment
      summary: Delete an environment
      description: >-
        Permanently deletes an environment from the specified project.
      tags:
        - Environments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/EnvironmentKey'
      responses:
        '204':
          description: Environment deleted successfully.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Environment or project not found.
  /segments/{projectKey}/{environmentKey}:
    get:
      operationId: listSegments
      summary: List segments
      description: >-
        Returns a list of all user segments in the specified project
        and environment.
      tags:
        - Segments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/EnvironmentKey'
        - name: limit
          in: query
          description: >-
            Maximum number of segments to return.
          schema:
            type: integer
        - name: offset
          in: query
          description: >-
            Number of segments to skip for pagination.
          schema:
            type: integer
      responses:
        '200':
          description: Successful response containing a list of segments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segments'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Project or environment not found.
    post:
      operationId: createSegment
      summary: Create a segment
      description: >-
        Creates a new user segment in the specified project and environment.
      tags:
        - Segments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/EnvironmentKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SegmentBody'
      responses:
        '201':
          description: Segment created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '409':
          description: A segment with the given key already exists.
  /segments/{projectKey}/{environmentKey}/{segmentKey}:
    get:
      operationId: getSegment
      summary: Get a segment
      description: >-
        Returns a single user segment by its key.
      tags:
        - Segments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/EnvironmentKey'
        - $ref: '#/components/parameters/SegmentKey'
      responses:
        '200':
          description: Successful response containing the segment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Segment not found.
    patch:
      operationId: patchSegment
      summary: Update a segment
      description: >-
        Updates a segment using a JSON Patch or semantic patch representation.
      tags:
        - Segments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/EnvironmentKey'
        - $ref: '#/components/parameters/SegmentKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchOperation'
      responses:
        '200':
          description: Segment updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        '400':
          description: Invalid patch request.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Segment not found.
    delete:
      operationId: deleteSegment
      summary: Delete a segment
      description: >-
        Permanently deletes a user segment.
      tags:
        - Segments
      parameters:
        - $ref: '#/components/parameters/ProjectKey'
        - $ref: '#/components/parameters/EnvironmentKey'
        - $ref: '#/components/parameters/SegmentKey'
      responses:
        '204':
          description: Segment deleted successfully.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Segment not found.
  /webhooks:
    get:
      operationId: listWebhooks
      summary: List webhooks
      description: >-
        Returns a list of all webhooks configured in the LaunchDarkly account.
      tags:
        - Webhooks
      responses:
        '200':
          description: Successful response containing a list of webhooks.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhooks'
        '401':
          description: Unauthorized. Invalid or missing access token.
    post:
      operationId: createWebhook
      summary: Create a webhook
      description: >-
        Creates a new webhook subscription that will receive HTTP POST
        notifications when changes occur in LaunchDarkly.
      tags:
        - Webhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookBody'
      responses:
        '201':
          description: Webhook created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
  /webhooks/{webhookId}:
    get:
      operationId: getWebhook
      summary: Get a webhook
      description: >-
        Returns a single webhook by its identifier.
      tags:
        - Webhooks
      parameters:
        - $ref: '#/components/parameters/WebhookId'
      responses:
        '200':
          description: Successful response containing the webhook.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Webhook not found.
    patch:
      operationId: patchWebhook
      summary: Update a webhook
      description: >-
        Updates a webhook using a JSON Patch representation.
      tags:
        - Webhooks
      parameters:
        - $ref: '#/components/parameters/WebhookId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchOperation'
      responses:
        '200':
          description: Webhook updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Invalid patch request.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Webhook not found.
    delete:
      operationId: deleteWebhook
      summary: Delete a webhook
      description: >-
        Permanently deletes a webhook subscription.
      tags:
        - Webhooks
      parameters:
        - $ref: '#/components/parameters/WebhookId'
      responses:
        '204':
          description: Webhook deleted successfully.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Webhook not found.
  /auditlog:
    get:
      operationId: listAuditLogEntries
      summary: List audit log entries
      description: >-
        Returns a paginated list of audit log entries recording all
        changes made to resources in the LaunchDarkly account.
      tags:
        - Audit Log
      parameters:
        - name: before
          in: query
          description: >-
            A timestamp filter returning entries before this time
            (Unix epoch milliseconds).
          schema:
            type: integer
            format: int64
        - name: after
          in: query
          description: >-
            A timestamp filter returning entries after this time
            (Unix epoch milliseconds).
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          description: >-
            Maximum number of entries to return.
          schema:
            type: integer
        - name: q
          in: query
          description: >-
            A text filter for searching audit log entries.
          schema:
            type: string
        - name: spec
          in: query
          description: >-
            A resource specifier filter for narrowing entries
            to specific resource types.
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing audit log entries.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditLogEntries'
        '401':
          description: Unauthorized. Invalid or missing access token.
  /auditlog/{auditLogId}:
    get:
      operationId: getAuditLogEntry
      summary: Get an audit log entry
      description: >-
        Returns a single audit log entry by its identifier.
      tags:
        - Audit Log
      parameters:
        - name: auditLogId
          in: path
          required: true
          description: >-
            The unique identifier of the audit log entry.
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing the audit log entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditLogEntry'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Audit log entry not found.
  /members:
    get:
      operationId: listMembers
      summary: List account members
      description: >-
        Returns a paginated list of all members in the LaunchDarkly account.
      tags:
        - Account Members
      parameters:
        - name: limit
          in: query
          description: >-
            Maximum number of members to return.
          schema:
            type: integer
        - name: offset
          in: query
          description: >-
            Number of members to skip for pagination.
          schema:
            type: integer
        - name: filter
          in: query
          description: >-
            A filter expression to apply to the member list.
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing a list of members.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Members'
        '401':
          description: Unauthorized. Invalid or missing access token.
    post:
      operationId: inviteMember
      summary: Invite a new member
      description: >-
        Sends an invitation to a new member to join the LaunchDarkly account.
      tags:
        - Account Members
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemberInviteBody'
      responses:
        '201':
          description: Invitation sent successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Members'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '409':
          description: A member with this email already exists.
  /tokens:
    get:
      operationId: listAccessTokens
      summary: List access tokens
      description: >-
        Returns a list of all personal and service access tokens
        in the LaunchDarkly account.
      tags:
        - Access Tokens
      responses:
        '200':
          description: Successful response containing a list of access tokens.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTokens'
        '401':
          description: Unauthorized. Invalid or missing access token.
    post:
      operationId: createAccessToken
      summary: Create an access token
      description: >-
        Creates a new personal or service access token.
      tags:
        - Access Tokens
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessTokenBody'
      responses:
        '201':
          description: Access token created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
  /roles:
    get:
      operationId: listCustomRoles
      summary: List custom roles
      description: >-
        Returns a list of all custom roles defined in the LaunchDarkly account.
      tags:
        - Custom Roles
      responses:
        '200':
          description: Successful response containing a list of custom roles.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomRoles'
        '401':
          description: Unauthorized. Invalid or missing access token.
    post:
      operationId: createCustomRole
      summary: Create a custom role
      description: >-
        Creates a new custom role with the specified permissions policy.
      tags:
        - Custom Roles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomRoleBody'
      responses:
        '201':
          description: Custom role created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomRole'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
        '409':
          description: A custom role with the given key already exists.
  /teams:
    get:
      operationId: listTeams
      summary: List teams
      description: >-
        Returns a list of all teams in the LaunchDarkly account.
      tags:
        - Teams
      parameters:
        - name: limit
          in: query
          description: >-
            Maximum number of teams to return.
          schema:
            type: integer
        - name: offset
          in: query
          description: >-
            Number of teams to skip for pagination.
          schema:
            type: integer
        - name: filter
          in: query
          description: >-
            A filter expression to apply to the team list.
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing a list of teams.
          content:
     

# --- truncated at 32 KB (99 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/launchdarkly/refs/heads/main/openapi/launchdarkly-rest-api-openapi.yml