launchdarkly Environments API

Manage environments within projects such as production, staging, and development.

Operations 5

GET /projects/{projectKey}/environments List environments #
POST /projects/{projectKey}/environments Create an environment #
GET /projects/{projectKey}/environments/{environmentKey} Get an environment #
PATCH /projects/{projectKey}/environments/{environmentKey} Update an environment #
DELETE /projects/{projectKey}/environments/{environmentKey} Delete an environment #

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-environments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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-environments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LaunchDarkly REST Environments 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
servers:
- url: https://app.launchdarkly.com/api/v2
  description: LaunchDarkly Production API
security:
- bearerAuth: []
tags:
- name: Environments
  description: Manage environments within projects such as production, staging, and development.
paths:
  /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.
components:
  schemas:
    Environment:
      type: object
      description: An environment within a project, such as production or staging.
      properties:
        _id:
          type: string
          description: The unique identifier of this environment.
        key:
          type: string
          description: The environment key.
        name:
          type: string
          description: The human-readable name of the environment.
        color:
          type: string
          description: The color swatch for the environment in the dashboard.
          pattern: ^[0-9a-fA-F]{6}$
        apiKey:
          type: string
          description: The SDK key for server-side SDKs.
        mobileKey:
          type: string
          description: The mobile key for mobile SDKs.
        defaultTtl:
          type: integer
          description: The default time-to-live in minutes for flag values.
        secureMode:
          type: boolean
          description: Whether secure mode is enabled for this environment.
        tags:
          type: array
          description: Tags applied to this environment.
          items:
            type: string
        _links:
          $ref: '#/components/schemas/Links'
    PatchOperation:
      type: object
      description: A JSON Patch or semantic patch request.
      properties:
        patch:
          type: array
          description: An array of JSON Patch operations.
          items:
            type: object
            required:
            - op
            - path
            properties:
              op:
                type: string
                description: The patch operation type.
                enum:
                - add
                - remove
                - replace
                - move
                - copy
                - test
              path:
                type: string
                description: The JSON Pointer path to the target field.
              value:
                description: The value to apply for add or replace operations.
        comment:
          type: string
          description: An optional comment describing the change.
    Environments:
      type: object
      description: A collection of environments.
      properties:
        items:
          type: array
          description: The list of environments.
          items:
            $ref: '#/components/schemas/Environment'
        totalCount:
          type: integer
          description: The total number of environments.
        _links:
          $ref: '#/components/schemas/Links'
    EnvironmentBody:
      type: object
      description: The request body for creating a new environment.
      required:
      - name
      - key
      - color
      properties:
        name:
          type: string
          description: The human-readable name of the environment.
        key:
          type: string
          description: The environment key.
          pattern: ^[a-z0-9]([a-z0-9-])*$
        color:
          type: string
          description: The color swatch for the environment in the dashboard.
          pattern: ^[0-9a-fA-F]{6}$
        defaultTtl:
          type: integer
          description: The default time-to-live in minutes.
        secureMode:
          type: boolean
          description: Whether to enable secure mode.
        tags:
          type: array
          description: Tags to apply to the environment.
          items:
            type: string
    Links:
      type: object
      description: HATEOAS links for navigating related resources.
      properties:
        self:
          type: object
          description: A link to this resource.
          properties:
            href:
              type: string
              description: The URL of this resource.
            type:
              type: string
              description: The media type.
      additionalProperties:
        type: object
        properties:
          href:
            type: string
            description: The URL of the linked resource.
          type:
            type: string
            description: The media type.
  parameters:
    EnvironmentKey:
      name: environmentKey
      in: path
      required: true
      description: The environment key identifying a specific environment.
      schema:
        type: string
        pattern: ^[a-z0-9]([a-z0-9-])*$
    ProjectKey:
      name: projectKey
      in: path
      required: true
      description: The project key identifying a LaunchDarkly project.
      schema:
        type: string
        pattern: ^[a-z0-9]([a-z0-9-])*$
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: LaunchDarkly API access token. Create personal or service tokens in the LaunchDarkly dashboard under Account Settings.
externalDocs:
  description: LaunchDarkly API Documentation
  url: https://apidocs.launchdarkly.com/