SAP Emarsys Core API

REST API for managing contacts, segments, fields, campaigns, automation programs, external events, and analytics in SAP Emarsys. The v3 API uses OAuth 2.0 + OIDC with JWT bearer tokens issued by https://auth.emarsys.net/oauth2/token; the legacy v2 endpoints use WSSE header authentication and are deprecated.

OpenAPI Specification

emarsys-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: SAP Emarsys Core API
  description: >
    SAP Emarsys Core API (v2) provides programmatic access to the
    omnichannel customer engagement platform: managing contacts,
    contact lists, segments, and email campaigns. Authentication
    historically used WSSE; SAP Emarsys is moving the API surface to
    OAuth 2.0 / OIDC with JWT for v3 — both schemes are documented here.
  version: "1.0.0"
  contact:
    name: SAP Emarsys Developer Portal
    url: https://dev.emarsys.com/
servers:
  - url: https://api.emarsys.net
security:
  - WSSE: []
  - OAuth2: []
paths:
  /api/v2/contact:
    post:
      summary: Create contacts
      operationId: createContact
      tags: [Contacts]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key_id:
                  type: string
                contacts:
                  type: array
                  items:
                    type: object
      responses:
        "200":
          description: Contact(s) created
    put:
      summary: Update contacts
      operationId: updateContact
      tags: [Contacts]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key_id:
                  type: string
                contacts:
                  type: array
                  items:
                    type: object
      responses:
        "200":
          description: Contact(s) updated
  /api/v2/contact/getdata:
    post:
      summary: Get contact data
      operationId: getContactData
      tags: [Contacts]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key_id:
                  type: string
                fields:
                  type: array
                  items:
                    type: integer
                keyValues:
                  type: array
                  items:
                    type: string
      responses:
        "200":
          description: Contact data
  /api/v2/contactlist:
    get:
      summary: List contact lists
      operationId: listContactLists
      tags: [Contact Lists]
      responses:
        "200":
          description: Contact lists
    post:
      summary: Create contact list
      operationId: createContactList
      tags: [Contact Lists]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                key_id:
                  type: string
                external_ids:
                  type: array
                  items:
                    type: string
      responses:
        "200":
          description: Contact list created
  /api/v2/email:
    get:
      summary: List email campaigns
      operationId: listEmails
      tags: [Email]
      responses:
        "200":
          description: Email campaigns
  /api/v2/email/{campaignId}/launch:
    post:
      summary: Launch email campaign
      operationId: launchEmailCampaign
      tags: [Email]
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Campaign launched
  /api/v2/segment:
    get:
      summary: List segments
      operationId: listSegments
      tags: [Segments]
      responses:
        "200":
          description: Segments
  /api/v2/event/{eventId}/trigger:
    post:
      summary: Trigger external event
      operationId: triggerExternalEvent
      tags: [Events]
      parameters:
        - name: eventId
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key_id:
                  type: string
                external_ids:
                  type: array
                  items:
                    type: string
                data:
                  type: object
      responses:
        "200":
          description: Event triggered
components:
  securitySchemes:
    WSSE:
      type: apiKey
      in: header
      name: X-WSSE
      description: Legacy WSSE authentication header (being deprecated).
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.emarsys.net/api/v3/auth/token
          scopes: {}