launchdarkly Experiments API

Create and manage experiments to measure the impact of feature flag variations on metrics.

OpenAPI Specification

launchdarkly-experiments-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: LaunchDarkly Relay Proxy Access Tokens Experiments API
  description: The LaunchDarkly Relay Proxy is a small Go application that connects to the LaunchDarkly streaming API and proxies that connection to SDK clients within an organization's network. It exposes endpoints for status monitoring, flag evaluation, and SDK streaming that mirror the LaunchDarkly service endpoints. Instead of each server making outbound connections to LaunchDarkly's streaming service, multiple servers connect to the local Relay Proxy which maintains a single upstream connection.
  version: '8.0'
  contact:
    name: LaunchDarkly Support
    url: https://support.launchdarkly.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:8030
  description: Default Relay Proxy instance
tags:
- name: Experiments
  description: Create and manage experiments to measure the impact of feature flag variations on metrics.
paths:
  /projects/{projectKey}/environments/{environmentKey}/experiments:
    get:
      operationId: listExperiments
      summary: List experiments
      description: Returns a list of all experiments in the specified project and environment.
      tags:
      - Experiments
      parameters:
      - $ref: '#/components/parameters/ProjectKey'
      - $ref: '#/components/parameters/EnvironmentKey'
      - name: limit
        in: query
        description: Maximum number of experiments to return.
        schema:
          type: integer
      - name: offset
        in: query
        description: Number of experiments to skip for pagination.
        schema:
          type: integer
      responses:
        '200':
          description: Successful response containing a list of experiments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiments'
        '401':
          description: Unauthorized. Invalid or missing access token.
        '404':
          description: Project or environment not found.
    post:
      operationId: createExperiment
      summary: Create an experiment
      description: Creates a new experiment in the specified project and environment.
      tags:
      - Experiments
      parameters:
      - $ref: '#/components/parameters/ProjectKey'
      - $ref: '#/components/parameters/EnvironmentKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExperimentBody'
      responses:
        '201':
          description: Experiment created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
        '400':
          description: Invalid request body.
        '401':
          description: Unauthorized. Invalid or missing access token.
components:
  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-])*$
  schemas:
    Experiments:
      type: object
      description: A paginated collection of experiments.
      properties:
        items:
          type: array
          description: The list of experiments.
          items:
            $ref: '#/components/schemas/Experiment'
        totalCount:
          type: integer
          description: The total number of experiments.
        _links:
          $ref: '#/components/schemas/Links'
    Experiment:
      type: object
      description: An experiment measuring the impact of flag variations on metrics.
      properties:
        _id:
          type: string
          description: The unique identifier of this experiment.
        key:
          type: string
          description: The experiment key.
        name:
          type: string
          description: The human-readable name of the experiment.
        description:
          type: string
          description: A description of the experiment.
        _creationDate:
          type: integer
          format: int64
          description: Unix epoch timestamp when the experiment was created.
        currentIteration:
          type: object
          description: The current iteration of the experiment.
          properties:
            _id:
              type: string
              description: The iteration identifier.
            status:
              type: string
              description: The current status of this iteration.
            startDate:
              type: integer
              format: int64
              description: Unix epoch timestamp when this iteration started.
            endDate:
              type: integer
              format: int64
              description: Unix epoch timestamp when this iteration ended.
        _links:
          $ref: '#/components/schemas/Links'
    ExperimentBody:
      type: object
      description: The request body for creating a new experiment.
      required:
      - name
      - key
      properties:
        name:
          type: string
          description: The human-readable name of the experiment.
        key:
          type: string
          description: The experiment key.
        description:
          type: string
          description: A description of the experiment.
        maintainerId:
          type: string
          description: The member ID of the experiment maintainer.
    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.
  securitySchemes:
    sdkKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Server-side SDK key for authenticating with the Relay Proxy.
    mobileKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Mobile SDK key for authenticating with the Relay Proxy.
externalDocs:
  description: Relay Proxy Documentation
  url: https://launchdarkly.com/docs/sdk/relay-proxy