Optimizely Campaigns API

Manage content campaigns and editorial calendar entries.

Documentation

Specifications

Other Resources

OpenAPI Specification

optimizely-campaigns-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Optimizely Campaign REST Assets Campaigns 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: Campaigns
  description: Manage content campaigns and editorial calendar entries.
paths:
  /campaigns:
    get:
      operationId: listCampaigns
      summary: List campaigns
      description: Returns a list of content campaigns in the editorial calendar.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Successfully retrieved the list of campaigns
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: List of campaigns
                    items:
                      $ref: '#/components/schemas/CmpCampaign'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '401':
          description: Authentication credentials are missing or invalid
    post:
      operationId: createCampaign
      summary: Create a campaign
      description: Creates a new campaign within the specified project.
      tags:
      - Campaigns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignInput'
      responses:
        '201':
          description: Campaign successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          description: Invalid request body
        '401':
          description: Authentication credentials are missing or invalid
  /campaigns/{campaignId}:
    get:
      operationId: getCampaign
      summary: Get a campaign
      description: Retrieves the details of a specific content campaign.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/campaignId'
      responses:
        '200':
          description: Successfully retrieved the campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CmpCampaign'
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Campaign not found
  /campaigns/{campaign_id}:
    get:
      operationId: getCampaign
      summary: Get a campaign
      description: Retrieves the full details of a specific campaign by its identifier.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/campaignId_2'
      responses:
        '200':
          description: Successfully retrieved the campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Campaign not found
    patch:
      operationId: updateCampaign
      summary: Update a campaign
      description: Updates the specified campaign with the provided fields.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/campaignId_2'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignInput'
      responses:
        '200':
          description: Campaign successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          description: Invalid request body
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Campaign not found
    delete:
      operationId: deleteCampaign
      summary: Delete a campaign
      description: Archives or permanently deletes the specified campaign.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/campaignId_2'
      responses:
        '204':
          description: Campaign successfully deleted
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Campaign not found
  /campaigns/{campaign_id}/results:
    get:
      operationId: getCampaignResults
      summary: Get campaign results
      description: Retrieves the statistical results for a specific campaign.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/campaignId_2'
      responses:
        '200':
          description: Successfully retrieved campaign results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExperimentResults'
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Campaign not found
components:
  schemas:
    CmpCampaign:
      type: object
      description: A content campaign in the editorial calendar
      properties:
        id:
          type: string
          description: Unique identifier for the campaign
        title:
          type: string
          description: Title of the campaign
        description:
          type: string
          description: Description of the campaign
        start_date:
          type: string
          format: date
          description: Campaign start date
        end_date:
          type: string
          format: date
          description: Campaign end date
        status:
          type: string
          description: Current status of the campaign
        labels:
          type: array
          description: Labels associated with the campaign
          items:
            type: string
        created_at:
          type: string
          format: date-time
          description: Timestamp when the campaign was created
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the campaign was last updated
    CampaignInput:
      type: object
      description: Input for creating or updating a campaign
      properties:
        project_id:
          type: integer
          format: int64
          description: The project this campaign belongs to
        name:
          type: string
          description: Human-readable name of the campaign
        status:
          type: string
          description: Current status of the campaign
          enum:
          - active
          - paused
          - not_started
          - archived
    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
    Pagination:
      type: object
      description: Pagination metadata
      properties:
        total:
          type: integer
          description: Total number of items
        limit:
          type: integer
          description: Maximum items per page
        offset:
          type: integer
          description: Current offset
    Campaign:
      type: object
      description: A campaign that groups experiments under a shared objective
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the campaign
        project_id:
          type: integer
          format: int64
          description: The project this campaign belongs to
        name:
          type: string
          description: Human-readable name of the campaign
        status:
          type: string
          description: Current status of the campaign
          enum:
          - active
          - paused
          - not_started
          - archived
        experiment_ids:
          type: array
          description: List of experiment IDs in this campaign
          items:
            type: integer
            format: int64
        page_ids:
          type: array
          description: List of page IDs the campaign targets
          items:
            type: integer
            format: int64
        created:
          type: string
          format: date-time
          description: Timestamp when the campaign was created
        last_modified:
          type: string
          format: date-time
          description: Timestamp when the campaign was last modified
  parameters:
    campaignId:
      name: campaignId
      in: path
      required: true
      description: The unique identifier for the campaign
      schema:
        type: string
    offset:
      name: offset
      in: query
      required: false
      description: Number of items to skip for pagination
      schema:
        type: integer
        default: 0
        minimum: 0
    campaignId_2:
      name: campaign_id
      in: path
      required: true
      description: The unique identifier for the campaign
      schema:
        type: integer
        format: int64
    limit:
      name: limit
      in: query
      required: false
      description: Maximum number of items to return
      schema:
        type: integer
        default: 25
        minimum: 1
        maximum: 100
  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