POST api/v1/Campaign

Creates a campaign to send a message to the included list of recipients. Campaigns are generally used to send the same message to multiple people and are picked up on a scheduled basis.

Request Information

URI Parameters

None.

Body Parameters

A CampaignModel containing the details of the campaign to create

CampaignModel
NameDescriptionTypeAdditional information
SenderId

integer

None.

Name

string

None.

DateToRun

date

None.

EmailMessage

string

None.

EmailSubject

string

None.

EmailIsHTML

boolean

None.

SendEmail

boolean

None.

SendSMS

boolean

None.

SMSFromNumber

string

None.

SMSMessage

string

None.

CampaignRecipients

Collection of CampaignRecipientModel

None.

TrackOpens

boolean

None.

TrackClicks

boolean

None.

TrackSubscriptions

boolean

None.

Attachments

Collection of EmailAttachmentModel

None.

Request Formats

application/json, text/json

Sample:
{
  "senderId": 1,
  "name": "sample string 2",
  "dateToRun": "2026-08-21T19:17:13.6797972+00:00",
  "emailMessage": "sample string 3",
  "emailSubject": "sample string 4",
  "emailIsHTML": true,
  "sendEmail": true,
  "sendSMS": true,
  "smsFromNumber": "sample string 8",
  "smsMessage": "sample string 9",
  "campaignRecipients": [
    {
      "entityNameId": 64,
      "entityId": 2,
      "smsNumber": "sample string 3",
      "emailAddress": "sample string 4"
    },
    {
      "entityNameId": 64,
      "entityId": 2,
      "smsNumber": "sample string 3",
      "emailAddress": "sample string 4"
    }
  ],
  "trackOpens": true,
  "trackClicks": true,
  "trackSubscriptions": true,
  "attachments": [
    {
      "filename": "sample string 1",
      "dataBytes": "QEA="
    },
    {
      "filename": "sample string 1",
      "dataBytes": "QEA="
    }
  ]
}

text/html

Sample:
{"senderId":1,"name":"sample string 2","dateToRun":"2026-08-21T19:17:13.6797972+00:00","emailMessage":"sample string 3","emailSubject":"sample string 4","emailIsHTML":true,"sendEmail":true,"sendSMS":true,"smsFromNumber":"sample string 8","smsMessage":"sample string 9","campaignRecipients":[{"entityNameId":64,"entityId":2,"smsNumber":"sample string 3","emailAddress":"sample string 4"},{"entityNameId":64,"entityId":2,"smsNumber":"sample string 3","emailAddress":"sample string 4"}],"trackOpens":true,"trackClicks":true,"trackSubscriptions":true,"attachments":[{"filename":"sample string 1","dataBytes":"QEA="},{"filename":"sample string 1","dataBytes":"QEA="}]}

application/xml, text/xml

Sample:
<CampaignModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Switchboard.Entities.Models">
  <Attachments xmlns:d2p1="http://schemas.datacontract.org/2004/07/Switchboard.Models">
    <d2p1:EmailAttachmentModel>
      <d2p1:DataBytes>QEA=</d2p1:DataBytes>
      <d2p1:Filename>sample string 1</d2p1:Filename>
    </d2p1:EmailAttachmentModel>
    <d2p1:EmailAttachmentModel>
      <d2p1:DataBytes>QEA=</d2p1:DataBytes>
      <d2p1:Filename>sample string 1</d2p1:Filename>
    </d2p1:EmailAttachmentModel>
  </Attachments>
  <CampaignRecipients>
    <CampaignRecipientModel>
      <EmailAddress>sample string 4</EmailAddress>
      <EntityId>2</EntityId>
      <EntityNameId>64</EntityNameId>
      <SMSNumber>sample string 3</SMSNumber>
    </CampaignRecipientModel>
    <CampaignRecipientModel>
      <EmailAddress>sample string 4</EmailAddress>
      <EntityId>2</EntityId>
      <EntityNameId>64</EntityNameId>
      <SMSNumber>sample string 3</SMSNumber>
    </CampaignRecipientModel>
  </CampaignRecipients>
  <DateToRun xmlns:d2p1="http://schemas.datacontract.org/2004/07/System">
    <d2p1:DateTime>2026-08-21T19:17:13.6797972Z</d2p1:DateTime>
    <d2p1:OffsetMinutes>0</d2p1:OffsetMinutes>
  </DateToRun>
  <EmailIsHTML>true</EmailIsHTML>
  <EmailMessage>sample string 3</EmailMessage>
  <EmailSubject>sample string 4</EmailSubject>
  <Name>sample string 2</Name>
  <SMSFromNumber>sample string 8</SMSFromNumber>
  <SMSMessage>sample string 9</SMSMessage>
  <SendEmail>true</SendEmail>
  <SendSMS>true</SendSMS>
  <SenderId>1</SenderId>
  <TrackClicks>true</TrackClicks>
  <TrackOpens>true</TrackOpens>
  <TrackSubscriptions>true</TrackSubscriptions>
</CampaignModel>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'CampaignModel'.

Response Information

Resource Description

The CampaignId of the Campaign created in the system. This can be used later to check on the status of the Campaign.

HttpResponseMessage
NameDescriptionTypeAdditional information
Version

Version

None.

Content

HttpContent

None.

StatusCode

HttpStatusCode

None.

ReasonPhrase

string

None.

Headers

Collection of Object

None.

RequestMessage

HttpRequestMessage

None.

IsSuccessStatusCode

boolean

None.