Skip to main content
Create a Campaign
curl --request POST \
  --url https://api.example.com/api/v4/campaigns \
  --header ':cookie: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'X-Vero-Project-Id: <x-vero-project-id>' \
  --data '
{
  "id": "campaign_123",
  "object": "campaign",
  "title": "Product update announcement: New features go live!",
  "action": {
    "message_ab_test": {
      "id": "message_ab_test_123",
      "type": "pick_a_winner",
      "pick_a_winner": {
        "allocation_percentage": 123,
        "metric": "clicks",
        "calculation_type": "statistically_significant",
        "test_period_in_hours": 123,
        "winner_id": "<string>",
        "is_winner_statistically_significant": true,
        "message_variants": [
          {
            "allocation_percentage": 123,
            "message_id": "<string>",
            "valid": true
          }
        ],
        "winner_variant_index": 123
      },
      "split": {
        "message_variants": [
          {
            "allocation_percentage": 123,
            "message_id": "<string>",
            "valid": true
          }
        ]
      },
      "object": "<string>"
    },
    "type": "message_ab_test",
    "id": "<string>",
    "message": {
      "id": "message_123",
      "object": "message",
      "provider": "provider_123",
      "campaign": "campaign_123",
      "transactional": true,
      "contents": {
        "object": "list",
        "data": [
          {
            "id": "<string>",
            "type": "email",
            "email": {
              "body": "<string>",
              "id": "content_abc",
              "object": "email",
              "subject": "<string>",
              "to": "<string>",
              "from": "<string>",
              "cc": "<string>",
              "bcc": "<string>",
              "locale": "fr-FR",
              "headers": "<string>",
              "preheader_text": "<string>",
              "plain_text": "<string>",
              "processor": {
                "mjml": "<string>",
                "type": "mjml"
              },
              "options": {
                "tracking": true
              },
              "meta": {
                "editor_type": "drag-and-drop"
              }
            },
            "sms": {
              "id": "contents_123",
              "body": "<string>"
            }
          }
        ]
      }
    },
    "journey": {
      "id": "journey_123",
      "object": "journey",
      "created_at": "<string>",
      "updated_at": "<string>",
      "nodes": {
        "object": "list",
        "data": [
          {
            "type": "sms",
            "title": "<string>",
            "message_id": "message_123",
            "sms": {
              "object": "sms",
              "id": "content_123",
              "body": "<string>"
            },
            "id": "node_123",
            "valid": true
          }
        ]
      },
      "edges": {
        "object": "list",
        "data": [
          {
            "source": "node_123",
            "target": "node_456",
            "index": 123
          }
        ]
      }
    },
    "object": "action"
  },
  "trigger": "trigger_123",
  "audience": "audience_123",
  "conversion": {
    "object": "conversion",
    "type": "event",
    "id": "conversion_123",
    "event": {
      "event_name": "<string>"
    }
  },
  "archived": true,
  "status": "draft"
}
'
{
  "error": {
    "type": "error",
    "message": "<string>",
    "code": "<string>"
  }
}

Authorizations

Headers

X-Vero-Project-Id
integer
required

Body

application/json
id
string
required
Example:

"campaign_123"

object
enum<string>
required

The resource in the response. Always campaign.

Available options:
campaign
title
string
required

The internal title of the campaign. Not shown to recipients.

Example:

"Product update announcement: New features go live!"

action
object
trigger

ID of a Trigger.

Example:

"trigger_123"

audience
string

The v1 API ID of a DataImport. Will be updated in future versions.

Example:

"audience_123"

conversion

If expanded, the full Conversion object.

archived
boolean
status
enum<string>
Available options:
draft,
cancelled,
launched,
removed

Response

Created