Create New Campaign

  • POST v2/campaigns creates a new campaign in your Reply account.

The Settings section of the request body can be omitted. In this case the system loads the default settings.
 The EmailAccount parameter can be omitted. In this case the system chooses then the default email account (if there is one).

 Example

Request:

POST v2/campaigns
{
 "name": "Api campaign",
 "emailAccount": "[email protected]",
 "settings": {
     "EmailsCountPerDay": 125,
     "daysToFinishProspect": 7,
     "daysFromLastProspectContact": 15,
     "emailSendingDelaySeconds": 55,
     "emailPriorityType": "Equally divided between",
     "disableOpensTracking": true,
     "repliesHandlingType": "Continue sending emails",
     "enableLinksTracking": false
 },
 "steps": [
   {
   "number": "1",
   "InMinutesCount" : "25",
   "templates": [
     {
     "body": "Hello World!",
     "subject": "I'm here!",
     "CcList": "[email protected], [email protected]"
     },
     {
     "emailTemplateId": 164,
     "CcList": "[email protected], [email protected]"
     }
    ]
   }
  ]
}

Response:

201 Created
{
  "id": 316,
  "name": "Api campaign",
  "emailAccount": "[email protected]",
  "status": "New",
  "settings": {
    "EmailsCountPerDay": 125,
    "daysToFinishProspect": 7,
    "daysFromLastProspectContact": 15,
    "emailSendingDelaySeconds": 55,
    "emailPriorityType": "Equally divided between",
    "disableOpensTracking": true,
    "repliesHandlingType": "Continue sending emails",
    "enableLinksTracking": false
  },
  "steps": [
    {
      "id": 491,
      "number": 1,
      "inMinutesCount": 25,
      "templates": [
        {
          "id": 577,
          "emailTemplateName": "",
          "emailTemplateId": null,
          "body": "Hello World!",
          "subject": "I'm here!",
          "ccList": "[email protected], [email protected]"
        },
        {
          "id": 578,
          "emailTemplateName": "first-template",
          "emailTemplateId": 164,
          "body": "Let's go!",
          "subject": "Are you there?",
          "ccList": "[email protected], [email protected]"
        }
      ]
    }
  ]
}

Update Campaign

  • PATCH v2/campaigns/{id} updates an existing campaign by its ID.

 Example

Request:

PATCH v2/campaigns/316
{
 "name": "Api campaign with changes",
 "emailAccount": "[email protected]",
 "settings": {
     "EmailsCountPerDay": 250,
     "daysToFinishProspect": 14,
     "daysFromLastProspectContact": 30,
     "emailSendingDelaySeconds": 110,
     "emailPriorityType": "First step emails",
     "disableOpensTracking": false,
     "repliesHandlingType": "Mark person as finished",
     "enableLinksTracking": true
 }
}

Response:

200 OK
{
  "id": 316,
  "name": "Api campaign with changes",
  "emailAccount": "[email protected]",
  "status": "New",
  "settings": {
    "EmailsCountPerDay": 250,
    "daysToFinishProspect": 14,
    "daysFromLastProspectContact": 30,
    "emailSendingDelaySeconds": 110,
    "emailPriorityType": "First step emails",
    "disableOpensTracking": false,
    "repliesHandlingType": "Mark person as finished",
    "enableLinksTracking": true
  },
  "steps": [
    {
      "id": 491,
      "number": 1,
      "inMinutesCount": 25,
      "templates": [
        {
          "id": 577,
          "emailTemplateName": "",
          "emailTemplateId": null,
          "body": "Hello World!",
          "subject": "I'm here!",
          "ccList": "[email protected], [email protected]"
        },
        {
          "id": 578,
          "emailTemplateName": "api-template-1",
          "emailTemplateId": 164,
          "body": "api-body-1",
          "subject": "api-subject-1",
          "ccList": "[email protected], [email protected]"
        }
      ]
    }
  ]
}

Data type, campaign

  • id.  integer, no maximum length, read-only
  • name. string, maximum length 255 symbols, read and update, required for Create Campaign only
  • emailAccount. string, maximum length 255 symbols, read and update, not required (if default one exists) 
  • status. string, maximum length 25 symbols, read-only
  • settings. object, no maximum length, read and update, not required
  • steps. objects list, no maximum length, read and update, required for Create Campaign only.

Campaign statuses (the status field):

  • "New" = 0,
  • "Suspended" = 1,
  • "Active" = 2,
  • "Finished" = 3,
  • "Paused" = 5,

Data type, campaign settings

  • EmailsCountPerDay. integer, no maximum length, read and update, required
  • daysToFinishProspect. integer, no maximum length, read and update, required 
  • daysFromLastProspectContact. integer, no maximum length, read and update, required 
  • emailSendingDelaySeconds. integer, no maximum length, read and update, required 
  • emailPriorityType. string/enum, maximum length 25 symbols, read and update, required 
  • disableOpensTracking. boolean, no maximum length, read and update, required 
  • repliesHandlingType. string/enum, maximum length 25 symbols, read and update, required 
  • enableLinksTracking. boolean, no maximum length, read and update, required. 

Data type, campaign steps

  • id. integer, no maximum length, required for post/patch, 0 value for create method
  • number. integer, no maximum length, required (the numbers must be a sequence starting from 1, e.g. 1, 2, 3)
  • inMinutesCount. integer, no maximum length, required, must be greater than or equal to '0' for the first step, must be greater than '1' for the second and subsequent steps
  • templates. list of Campaign Step Template objects, required

Did this answer your question?