v1

latestOpenAPI 3.1.2Apache-2.02026-08-066040125.5 KB
Campaigns

Create a campaign

Create and send or schedule a campaign. One of 'body' or 'template_id' is required. One of 'list_id' or 'segment_id' is required.

post/campaigns

Request body

sender_namestring required

Sender's name

sender_emailstring required

Sender's email address

subjectstring required

Email subject

bodystring

HTML code of the template, encoded in Base64. Required if template_id is not provided.

segment_idinteger

Segment ID created in your account.

is_testboolean

Send a test email to the sender's address specified in sender_email.

send_datestring

Scheduled date and time (Y-m-d H:i:s). Must not be in the past.

namestring

Campaign name.

use_dynamic_listboolean

Send to contacts added after campaign creation but before sending.

attachmentsobject

Attached files (max 5). Key is filename, value is content.

attachments_binaryobject

Attached files (max 5). Key is filename, value is Base64 content.

type'draft'

Create campaign as a draft.

body_ampstring

AMP version of the email, encoded in base64.

Example request

{
  "sender_name": "my_sender_name",
  "sender_email": "my_sender@test.com",
  "subject": "hello customer",
  "body": "SmFja2llIENoYW4=",
  "segment_id": 12345,
  "send_date": "2016-02-02 23:34:23",
  "name": "my_api_campaign",
  "use_dynamic_list": true,
  "attachments": {
    "text.txt": "my content file"
  },
  "attachments_binary": {
    "text.txt": "bXkgY29udGVudCBmaWxlIGluIGJhc2U2NA=="
  },
  "type": "draft",
  "body_amp": "bXkgYW1wIGJvZHk=",
  "stats": {
    "opens": true,
    "clicks": false,
    "utm_campaign": "MY_UTM"
  }
}

Response

Campaign created

idinteger

Email campaign ID

statusinteger

Task status for sending (13 - copying addresses, 26 - draft)

countinteger

Number of recipients

tariff_email_qtyinteger

Number of emails written off from balance

overdraft_pricestring

Price for one email at an increase

ovedraft_currencystring

Currency

Example response

{
  "id": 245587,
  "status": 13,
  "count": 1,
  "tariff_email_qty": 1,
  "overdraft_price": "0.0044",
  "ovedraft_currency": "USD"
}