Optimizely Environments API

Manage environments within a project for developing, staging, and deploying flag configurations.

Documentation

Specifications

Other Resources

OpenAPI Specification

optimizely-environments-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Optimizely Campaign REST Assets Environments 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: Environments
  description: Manage environments within a project for developing, staging, and deploying flag configurations.
paths:
  /environments:
    get:
      operationId: listEnvironments
      summary: List environments
      description: Returns a list of environments for the specified project. Environments allow developing, staging, and deploying experiment configurations independently.
      tags:
      - Environments
      parameters:
      - $ref: '#/components/parameters/projectIdQuery'
      responses:
        '200':
          description: Successfully retrieved the list of environments
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Environment'
        '401':
          description: Authentication credentials are missing or invalid
    post:
      operationId: createEnvironment
      summary: Create an environment
      description: Creates a new environment within the specified project.
      tags:
      - Environments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentInput'
      responses:
        '201':
          description: Environment successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '400':
          description: Invalid request body
        '401':
          description: Authentication credentials are missing or invalid
  /environments/{environment_id}:
    get:
      operationId: getEnvironment
      summary: Get an environment
      description: Retrieves the details of a specific environment.
      tags:
      - Environments
      parameters:
      - $ref: '#/components/parameters/environmentId'
      responses:
        '200':
          description: Successfully retrieved the environment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Environment not found
    patch:
      operationId: updateEnvironment
      summary: Update an environment
      description: Updates the specified environment with the provided fields.
      tags:
      - Environments
      parameters:
      - $ref: '#/components/parameters/environmentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentInput'
      responses:
        '200':
          description: Environment successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment'
        '400':
          description: Invalid request body
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Environment not found
components:
  parameters:
    environmentId:
      name: environment_id
      in: path
      required: true
      description: The unique identifier for the environment
      schema:
        type: integer
        format: int64
    projectIdQuery:
      name: project_id
      in: query
      required: true
      description: The unique identifier for the project to filter by
      schema:
        type: integer
        format: int64
  schemas:
    EnvironmentInput:
      type: object
      description: Input for creating or updating an environment
      properties:
        key:
          type: string
          description: Unique key for the environment
        name:
          type: string
          description: Human-readable name of the environment
        is_primary:
          type: boolean
          description: Whether this is the primary environment
    Environment:
      type: object
      description: An environment within a project for managing flag configurations
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the environment
        key:
          type: string
          description: Unique key for the environment
        name:
          type: string
          description: Human-readable name of the environment
        project_id:
          type: integer
          format: int64
          description: The project this environment belongs to
        is_primary:
          type: boolean
          description: Whether this is the primary (production) environment
        sdk_key:
          type: string
          description: SDK key used to initialize SDKs in this environment
        datafile_url:
          type: string
          format: uri
          description: URL to the datafile for this environment
        created:
          type: string
          format: date-time
          description: Timestamp when the environment was created
  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