Optimizely GraphQL API

Execute GraphQL queries against the Optimizely content graph to retrieve and search content.

Documentation

Specifications

Other Resources

OpenAPI Specification

optimizely-graphql-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Optimizely Campaign REST Assets GraphQL 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: GraphQL
  description: Execute GraphQL queries against the Optimizely content graph to retrieve and search content.
paths:
  /content/v2:
    post:
      operationId: executeGraphQLQuery
      summary: Execute a GraphQL query
      description: Sends a GraphQL query to the Optimizely Graph service for content retrieval and search. The query is executed against the content model indexed in Optimizely Graph, enabling flexible data retrieval across all connected content sources.
      tags:
      - GraphQL
      parameters:
      - name: auth
        in: query
        required: false
        description: Single key authentication token
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphQLRequest'
      responses:
        '200':
          description: Successfully executed the GraphQL query
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraphQLResponse'
        '400':
          description: Invalid GraphQL query syntax
        '401':
          description: Authentication credentials are missing or invalid
    get:
      operationId: executeGraphQLQueryGet
      summary: Execute a GraphQL query via GET
      description: Sends a GraphQL query via GET request using query parameters. Useful for simple queries and caching scenarios.
      tags:
      - GraphQL
      parameters:
      - name: auth
        in: query
        required: false
        description: Single key authentication token
        schema:
          type: string
      - name: query
        in: query
        required: true
        description: The GraphQL query string
        schema:
          type: string
      - name: variables
        in: query
        required: false
        description: JSON-encoded query variables
        schema:
          type: string
      - name: operationName
        in: query
        required: false
        description: Name of the operation to execute
        schema:
          type: string
      responses:
        '200':
          description: Successfully executed the GraphQL query
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraphQLResponse'
        '400':
          description: Invalid GraphQL query syntax
        '401':
          description: Authentication credentials are missing or invalid
components:
  schemas:
    GraphQLResponse:
      type: object
      description: A GraphQL query response
      properties:
        data:
          type: object
          description: The query result data
          additionalProperties: true
        errors:
          type: array
          description: List of errors if the query failed or partially failed
          items:
            type: object
            properties:
              message:
                type: string
                description: Error message
              locations:
                type: array
                description: Locations in the query where the error occurred
                items:
                  type: object
                  properties:
                    line:
                      type: integer
                      description: Line number
                    column:
                      type: integer
                      description: Column number
              path:
                type: array
                description: Path to the field that caused the error
                items:
                  type: string
        extensions:
          type: object
          description: Additional metadata about the query execution
          additionalProperties: true
    GraphQLRequest:
      type: object
      description: A GraphQL query request
      required:
      - query
      properties:
        query:
          type: string
          description: The GraphQL query string
        variables:
          type: object
          description: Variables for the GraphQL query
          additionalProperties: true
        operationName:
          type: string
          description: Name of the operation to execute if the query contains multiple operations
  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