Create Campaign

You can create a campaign using this API. Using this API, you can set the camapign name, subject line, sender address; choose the intended mailing list.

Scope required

  • ZohoMarketingAutomation.campaign.CREATE

Other alternative scopes

  • ZohoMarketingAutomation.campaign.CREATE-UPDATE (CREATE + UPDATE)
  • ZohoMarketingAutomation.campaign.WRITE (CREATE + UPDATE + DELETE)
  • ZohoMarketingAutomation.campaign.ALL (CREATE + UPDATE + DELETE + READ)

Header:

Authorization:Zoho-oauthtoken

Content-Type: application/x-www-form-urlencoded

Request type:

  • POST

Request URL

https://marketingautomation.zoho.com/api/v1/createCampaign

API Limit

  • Duration: 5 mins
  • Number of Calls: 500
  • Lock Period: 30 mins

You can send 500 API calls per 5 minutes. If you hit this limit, you can't use this API for the next 30 minutes due to security reasons, but you can still use other APIs if their lock period hasn’t been reached.

List of parameters:

Parameter

 

Data Type

 

Description

 

resfmt

 

String

 

 json

 

campaignname*

 

String

 

A name to your campaign

 

from_email*

 

String

 

Email address of the sender

 

from_nameStringName of the sender

subject*

 

String

 

Subject line for your campaign

 

content_url

 

String

 

A valid HTML URL for your campaign content

 

list_details*JSON (UTF-8 encoded)

The encoded mailing list value should be associated for sending campaigns to contacts of the lists.  (You can get list key from get mailing lists API)

Format to define list details:
{"listkey value1":[],"listkey value2":[]}

segmentsString

Pass segment ID to which you want to send campaigns. (You can get segment ID from get segments API)

Format to define segment:
[segmentid1,segmentid2]

topicId*StringCreate a campaign with contacts that belong to this topic as recipients.

* Mandatory parameters

Note :

  • topicId is mandatory for organizations or accounts that have enabled the updated topic management version.
  • Either list_details or segments will be considered. If only segments are the source of recipients, pass only segments. If both are passed, lists will take precedence by default.

Possible error cases

Error code             Description                                                                                               

500

 

An internal error occurred while processing your request.

 

1001

 

"resfmt" pattern does not match.

1004

 

Invalid URL for content import.

3001

 

Campaign content cannot exceed 300000 characters.
6606No lists selected for this campaign.

If your error code is not listed above, click here.

Sample request

Copiedhttps://marketingautomation.zoho.com/api/v1/createCampaign?resfmt=json&campaignname=newsletter&from_email=patricia@zoho.com&subject=festive offers& list_details=%7B34594177d382061b27dd314490758f5d%3A%5B4000000023018 %5D%2C34594177d382061b939770a6d682df24%3A%5B%5D%7D%0A

Sample response

Copied{
  "message": "Campaign created successfully",
  "campaignKey": "10234695",
  "code": "200",
  "uri": "/api/v1/createCampaign"
}