# Create a campaign
# HTTP method: POST
https://api.sender.net/v2/campaigns
Use this API method to create a new campaign from scratch. Specify the group or segment IDs that this campaign will be sent to.
You can use API to provide plain text or a custom HTML campaign content. For drag&drop templates, you must create its content in your Sender application interface.
title string
Name of the campaign (shown in reports, optional)
subject string
required
Choose the subject of the campaign.
from string
required
Sender name to be shown to subscribers.
preheader string
Email preview text.
reply_to string
required
Email that will be shown as the sender. This email must belong to a valid, verified domain in your account.
content_type string
required
The value must be one of "editor", "html", or "text".
google_analytics numeric
Enable or disable Google Analytics tracking for the links in this campaign. Choose from 1 for true and 0 for false.
auto_followup_subject string
Provide the auto follow up subject
auto_followup_delay numeric
Hours before automatic followup. The value must be one of 12, 24, 48, 72, 96, 120, 144, or 168.
auto_followup_active boolean
If 1 - automatic followup campaign will be sent to those subscribers who did not open.
groups array
Provide the groups ids that would be added to the campaign. For more than 1 use comma to separate each group.
segments array
Array of segment IDs that this campaign will be sent to.
content string
Provide the content of your campaign. Only plain text and html options are available for providing campaign content using the API. For drag&drop builder you need to use the interface.
Code snippets
Response example
{
"success": true,
"message": "Campaign created",
"data": {
"id": "e1VMRZ",
"subject": "Example campaign subject",
"reply_to": "[email protected]",
"language": "eng",
"recipient_count": null,
"from": "Sender support",
"schedule_time": null,
"last_action": "api",
"sent_time": null,
"status": "DRAFT",
"created": "2022-06-06 05:59:50",
"modified": "2022-06-06 05:59:50",
"title": "Example campaign",
"domain_id": "bDPoxb",
"preheader": "Preview text of my campaign",
"auto_followup_active": true,
"auto_followup_subject": "Example follow up subject",
"auto_followup_delay": 72,
"editor": "text",
"opens": 0,
"clicks": 0,
"bounces_count": 0,
"send_to_all": null,
"html": {
"id": "azxXQq",
"thumbnail_url": "https://cdn.sender.net/email_images/9918/886278/html_l5fbNNTWji6R.png?timestamp=1654509593",
"has_preview": true,
"html_content": "Adding the first content of my campaign",
"html_body": null
},
"sent_count": 0,
"campaign_groups": [
"eZVD4w",
"dN9n8z"
],
"segments": [
"elY9Ma"
]
}
}