Optimizely Experiments API

Create and manage A/B test experiments on top of feature flags.

Documentation

Specifications

Other Resources

OpenAPI Specification

optimizely-experiments-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Optimizely Campaign REST Assets Experiments API
  description: The Optimizely Campaign REST API provides programmatic access to Optimizely's email and omnichannel campaign management capabilities. Developers can use the API to manage campaigns, recipients, mailing lists, smart campaigns, transactional mails, and messaging workflows. The API is hosted at api.campaign.episerver.net and supports automation of marketing campaign operations, enabling integration with external systems and custom marketing workflows. The base URL includes the client ID for multi-tenant access.
  version: '1.0'
  contact:
    name: Optimizely Support
    url: https://support.optimizely.com
  termsOfService: https://www.optimizely.com/legal/terms/
servers:
- url: https://api.campaign.episerver.net/rest
  description: Optimizely Campaign Production Server
security:
- basicAuth: []
tags:
- name: Experiments
  description: Create and manage A/B test experiments on top of feature flags.
paths:
  /experiments:
    get:
      operationId: listExperiments
      summary: List experiments
      description: Returns a list of experiments for the specified project.
      tags:
      - Experiments
      parameters:
      - $ref: '#/components/parameters/projectIdQuery'
      - $ref: '#/components/parameters/perPage'
      - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Successfully retrieved the list of experiments
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Experiment'
        '401':
          description: Authentication credentials are missing or invalid
    post:
      operationId: createExperiment
      summary: Create an experiment
      description: Creates a new experiment within the specified project.
      tags:
      - Experiments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExperimentInput'
      responses:
        '201':
          description: Experiment successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
        '400':
          description: Invalid request body
        '401':
          description: Authentication credentials are missing or invalid
  /experiments/{experiment_id}:
    get:
      operationId: getExperiment
      summary: Get an experiment
      description: Retrieves the full details of a specific experiment.
      tags:
      - Experiments
      parameters:
      - $ref: '#/components/parameters/experimentId'
      responses:
        '200':
          description: Successfully retrieved the experiment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Experiment not found
    patch:
      operationId: updateExperiment
      summary: Update an experiment
      description: Updates the specified experiment with the provided fields.
      tags:
      - Experiments
      parameters:
      - $ref: '#/components/parameters/experimentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExperimentInput'
      responses:
        '200':
          description: Experiment successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
        '400':
          description: Invalid request body
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Experiment not found
    delete:
      operationId: deleteExperiment
      summary: Delete an experiment
      description: Archives or permanently deletes the specified experiment.
      tags:
      - Experiments
      parameters:
      - $ref: '#/components/parameters/experimentId'
      responses:
        '204':
          description: Experiment successfully deleted
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Experiment not found
  /experiments/{experiment_id}/results:
    get:
      operationId: getExperimentResults
      summary: Get experiment results
      description: Retrieves the statistical results for a specific experiment, including conversion rates, confidence intervals, and statistical significance computed by Stats Engine.
      tags:
      - Experiments
      parameters:
      - $ref: '#/components/parameters/experimentId'
      responses:
        '200':
          description: Successfully retrieved experiment results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExperimentResults'
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Experiment not found
components:
  parameters:
    perPage:
      name: per_page
      in: query
      required: false
      description: Number of results per page
      schema:
        type: integer
        default: 25
        minimum: 1
        maximum: 100
    projectIdQuery:
      name: project_id
      in: query
      required: true
      description: The unique identifier for the project to filter by
      schema:
        type: integer
        format: int64
    page:
      name: page
      in: query
      required: false
      description: Page number for pagination
      schema:
        type: integer
        default: 1
        minimum: 1
    experimentId:
      name: experiment_id
      in: path
      required: true
      description: The unique identifier for the experiment
      schema:
        type: integer
        format: int64
  schemas:
    ExperimentResults:
      type: object
      description: Statistical results for an experiment
      properties:
        experiment_id:
          type: integer
          format: int64
          description: The experiment these results belong to
        start_time:
          type: string
          format: date-time
          description: Start time of the results period
        end_time:
          type: string
          format: date-time
          description: End time of the results period
        reach:
          type: object
          description: Reach statistics for the experiment
          properties:
            variations:
              type: object
              additionalProperties:
                type: object
                properties:
                  count:
                    type: integer
                    description: Number of visitors in this variation
                  variation_id:
                    type: string
                    description: The variation identifier
        metrics:
          type: array
          description: Results for each metric
          items:
            type: object
            properties:
              event_id:
                type: integer
                format: int64
                description: The event ID for this metric
              results:
                type: object
                additionalProperties:
                  type: object
                  properties:
                    is_baseline:
                      type: boolean
                      description: Whether this is the baseline variation
                    value:
                      type: number
                      description: The metric value
                    lift:
                      type: object
                      description: Lift compared to baseline
                      properties:
                        value:
                          type: number
                          description: Lift percentage
                        is_significant:
                          type: boolean
                          description: Whether the lift is statistically significant
                        significance:
                          type: number
                          description: Statistical significance level
    Experiment:
      type: object
      description: A Feature Experimentation experiment
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the experiment
        project_id:
          type: integer
          format: int64
          description: The project this experiment belongs to
        name:
          type: string
          description: Human-readable name of the experiment
        description:
          type: string
          description: Description of the experiment
        status:
          type: string
          description: Current status of the experiment
          enum:
          - active
          - paused
          - not_started
          - archived
        variations:
          type: array
          description: List of variations in the experiment
          items:
            type: object
            properties:
              variation_id:
                type: integer
                format: int64
                description: Unique variation identifier
              key:
                type: string
                description: Variation key
              name:
                type: string
                description: Variation name
              weight:
                type: integer
                description: Traffic weight
        metrics:
          type: array
          description: List of metrics tracked by the experiment
          items:
            type: object
            properties:
              event_id:
                type: integer
                format: int64
                description: Event identifier
              aggregator:
                type: string
                description: Aggregation method
              scope:
                type: string
                description: Metric scope
        created:
          type: string
          format: date-time
          description: Timestamp when the experiment was created
        last_modified:
          type: string
          format: date-time
          description: Timestamp when the experiment was last modified
    ExperimentInput:
      type: object
      description: Input for creating or updating an experiment
      properties:
        project_id:
          type: integer
          format: int64
          description: The project this experiment belongs to
        name:
          type: string
          description: Human-readable name of the experiment
        description:
          type: string
          description: Description of the experiment
        status:
          type: string
          description: Current status
          enum:
          - active
          - paused
          - not_started
          - archived
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication using the Optimizely Campaign API credentials.
externalDocs:
  description: Optimizely Campaign REST API Documentation
  url: https://docs.developers.optimizely.com/optimizely-campaign/docs/rest-api