VWO

VWO Campaigns API

A/B, split, and personalization campaigns.

OpenAPI Specification

vwo-campaigns-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: VWO Data Campaigns API
  version: 2.0.0
  summary: Programmatic access to VWO accounts, campaigns, websites, and reporting data.
  description: 'The VWO Data API exposes account data, campaign and goal configuration, reporting,

    and feature flag management across the VWO experimentation platform.


    Documentation: https://developers.vwo.com/

    '
  contact:
    name: VWO Developer Hub
    url: https://developers.vwo.com/
servers:
- url: https://app.vwo.com/api/v2
  description: VWO Data API v2
security:
- tokenAuth: []
tags:
- name: Campaigns
  description: A/B, split, and personalization campaigns.
paths:
  /accounts/{account_id}/campaigns:
    parameters:
    - $ref: '#/components/parameters/AccountID'
    get:
      tags:
      - Campaigns
      summary: List campaigns
      operationId: listCampaigns
      responses:
        '200':
          description: Campaign list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignList'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      tags:
      - Campaigns
      summary: Create a campaign
      operationId: createCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreate'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignEnvelope'
  /accounts/{account_id}/campaigns/{campaign_id}:
    parameters:
    - $ref: '#/components/parameters/AccountID'
    - $ref: '#/components/parameters/CampaignID'
    get:
      tags:
      - Campaigns
      summary: Get campaign details
      operationId: getCampaign
      responses:
        '200':
          description: Campaign details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignEnvelope'
    patch:
      tags:
      - Campaigns
      summary: Update a campaign
      operationId: updateCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignEnvelope'
components:
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
    CampaignEnvelope:
      type: object
      properties:
        _data:
          type: object
          properties:
            id:
              type: integer
            status:
              type: string
              examples:
              - NOT_STARTED
              - RUNNING
              - PAUSED
              - ENDED
            name:
              type: string
            type:
              type: string
            goals:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: integer
                  name:
                    type: string
    CampaignList:
      type: object
      properties:
        _data:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              status:
                type: string
              type:
                type: string
    CampaignCreate:
      type: object
      required:
      - type
      properties:
        type:
          type: string
          examples:
          - ab
          - split
          - personalize
          - mvt
        urls:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                examples:
                - url
                - regex
              value:
                type: string
        primaryUrl:
          type: string
        goals:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
                examples:
                - visitPage
                - customConversion
                - revenue
              urls:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                    value:
                      type: string
        globalCode:
          type: object
          additionalProperties: true
  responses:
    Unauthorized:
      description: Missing or invalid token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    CampaignID:
      name: campaign_id
      in: path
      required: true
      schema:
        type: integer
    AccountID:
      name: account_id
      in: path
      required: true
      description: Use the literal `current` keyword to refer to the Main Workspace, or the integer Workspace ID.
      schema:
        type: string
        default: current
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: token
      description: 'VWO API token sent in the `token` request header. Generate from

        VWO account settings.

        '