Skip to main content
POST
/
campaigns
Create and launch a campaign
curl --request POST \
  --url https://ecsend.paysgator.com/campaigns \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "name": "Summer Promo",
  "text": "Get 20% off this summer!",
  "senderId": "ECSEND",
  "recipients": [
    "+25884000001",
    "+25884000002"
  ],
  "rawReceivers": "+25884000001,+25884000002",
  "contactBookName": "My Contacts"
}
'
{
  "success": true,
  "campaignId": "clx456def",
  "status": "COMPLETED",
  "recipientCount": 100
}

Authorizations

X-Api-Key
string
header
required

Body

application/json
name
string
required

Campaign name

Example:

"Summer Promo"

text
string
required

Message content

Example:

"Get 20% off this summer!"

senderId
string
required

Sender ID

Example:

"ECSEND"

recipients
string[]

Array of phone numbers

Example:
["+25884000001", "+25884000002"]
rawReceivers
string

Comma or newline separated phone numbers

Example:

"+25884000001,+25884000002"

contactBookName
string

Name of existing contact book to use

Example:

"My Contacts"

Response

Campaign created and launched

success
boolean
Example:

true

campaignId
string
Example:

"clx456def"

status
string
Example:

"COMPLETED"

recipientCount
integer
Example:

100