Create a new email marketing campaign with sender, template, recipient lists, and scheduling options via the AutoSend API.
curl --request POST \
--url 'https://api.autosend.com/v1/campaigns' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Spring Sale Newsletter",
"subject": "Don'\''t miss our Spring Sale!",
"previewText": "Up to 50% off this weekend only",
"from": {
"email": "[email protected]",
"name": "Example Team"
},
"replyTo": "[email protected]",
"templateId": "60d5ec49f1b2c72d9c8b1234",
"toLists": ["60d5ec49f1b2c72d9c8b0001"],
"sendMode": "immediate",
"publish": true,
"sendNow": true,
"trackingClick": true,
"trackingOpen": true
}'
{
"success": true,
"data": {
"id": "69d348dd0351e0c32be90342",
"name": "Spring Sale Newsletter",
"subject": "Don't miss our Spring Sale!",
"previewText": "Up to 50% off this weekend only",
"status": "scheduled",
"sendMode": "immediate",
"from": {
"email": "[email protected]",
"name": "Example Team"
},
"replyTo": "[email protected]",
"templateId": "A-280fa451a7ca5cc17513",
"toLists": [
{
"id": "696e1158fbfc515799175f02",
"name": "seg list",
"type": "list",
"contactCount": 3
}
],
"excludeLists": [],
"sendNow": true,
"sendToGlobalList": false,
"metrics": {
"sent": 0,
"delivered": 0,
"opened": 0,
"suppressed": 0,
"clicked": 0,
"bounced": 0,
"unsubscribed": 0,
"spamReported": 0,
"processedCount": 0,
"totalContacts": 0,
"failedCount": 0
},
"trackingClick": true,
"trackingOpen": true,
"source": "api",
"createdAt": "2026-04-06T05:47:09.523Z",
"updatedAt": "2026-04-06T05:52:38.949Z"
},
"message": "Campaign updated successfully"
}
curl --request POST \
--url 'https://api.autosend.com/v1/campaigns' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Spring Sale Newsletter",
"subject": "Don'\''t miss our Spring Sale!",
"previewText": "Up to 50% off this weekend only",
"from": {
"email": "[email protected]",
"name": "Example Team"
},
"replyTo": "[email protected]",
"templateId": "60d5ec49f1b2c72d9c8b1234",
"toLists": ["60d5ec49f1b2c72d9c8b0001"],
"sendMode": "immediate",
"publish": true,
"sendNow": true,
"trackingClick": true,
"trackingOpen": true
}'
{
"success": true,
"data": {
"id": "69d348dd0351e0c32be90342",
"name": "Spring Sale Newsletter",
"subject": "Don't miss our Spring Sale!",
"previewText": "Up to 50% off this weekend only",
"status": "scheduled",
"sendMode": "immediate",
"from": {
"email": "[email protected]",
"name": "Example Team"
},
"replyTo": "[email protected]",
"templateId": "A-280fa451a7ca5cc17513",
"toLists": [
{
"id": "696e1158fbfc515799175f02",
"name": "seg list",
"type": "list",
"contactCount": 3
}
],
"excludeLists": [],
"sendNow": true,
"sendToGlobalList": false,
"metrics": {
"sent": 0,
"delivered": 0,
"opened": 0,
"suppressed": 0,
"clicked": 0,
"bounced": 0,
"unsubscribed": 0,
"spamReported": 0,
"processedCount": 0,
"totalContacts": 0,
"failedCount": 0
},
"trackingClick": true,
"trackingOpen": true,
"source": "api",
"createdAt": "2026-04-06T05:47:09.523Z",
"updatedAt": "2026-04-06T05:52:38.949Z"
},
"message": "Campaign updated successfully"
}
<token>, where <token> is your auth token.from.templateId or htmlTemplate is required.htmlTemplate or templateId is required. If both are provided, htmlTemplate takes precedence and the template referenced by templateId will be updated with the provided HTML content.true, the campaign will be scheduled to send after 120 seconds (2 minutes) from creation.true, the campaign is sent to all contacts in the global list.true, publishes and finalizes the campaign.immediate, scheduled, gradual.fixed, 1.25x, 1.5x, 1.75x, 2x. Required when sendMode is gradual.1.America/New_York) for scheduled or gradual sending.Show data
sendNow is true, this will be scheduled.immediate, scheduled, or gradual.api).Bearer authentication header of the form Bearer
Display name of the campaign.
1 - 200Email subject line.
1 - 998Preview text shown in email clients.
200Show child attributes
Id of a saved sender identity.
Reply-to email address.
ID of the email template to use.
List/segment IDs to send the campaign to.
List/segment IDs to exclude from sending.
ID of the unsubscribe group.
If true, send the campaign immediately.
ISO 8601 date-time to schedule the campaign.
If true, send to the entire global contact list.
If true, publish/finalize the campaign.
Enable or disable click tracking.
Enable or disable open tracking.
How the campaign is delivered.
immediate, scheduled, gradual Gradual send growth strategy (used when sendMode is 'gradual').
fixed, 1.25x, 1.5x, 1.75x, 2x Number of emails to send per day in gradual mode.
x >= 1Timezone string for scheduled sending.
Mark as default campaign (create only).
Campaign builder type (create only).
curl --request POST \
--url 'https://api.autosend.com/v1/campaigns' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Spring Sale Newsletter",
"subject": "Don'\''t miss our Spring Sale!",
"previewText": "Up to 50% off this weekend only",
"from": {
"email": "[email protected]",
"name": "Example Team"
},
"replyTo": "[email protected]",
"templateId": "60d5ec49f1b2c72d9c8b1234",
"toLists": ["60d5ec49f1b2c72d9c8b0001"],
"sendMode": "immediate",
"publish": true,
"sendNow": true,
"trackingClick": true,
"trackingOpen": true
}'
{
"success": true,
"data": {
"id": "69d348dd0351e0c32be90342",
"name": "Spring Sale Newsletter",
"subject": "Don't miss our Spring Sale!",
"previewText": "Up to 50% off this weekend only",
"status": "scheduled",
"sendMode": "immediate",
"from": {
"email": "[email protected]",
"name": "Example Team"
},
"replyTo": "[email protected]",
"templateId": "A-280fa451a7ca5cc17513",
"toLists": [
{
"id": "696e1158fbfc515799175f02",
"name": "seg list",
"type": "list",
"contactCount": 3
}
],
"excludeLists": [],
"sendNow": true,
"sendToGlobalList": false,
"metrics": {
"sent": 0,
"delivered": 0,
"opened": 0,
"suppressed": 0,
"clicked": 0,
"bounced": 0,
"unsubscribed": 0,
"spamReported": 0,
"processedCount": 0,
"totalContacts": 0,
"failedCount": 0
},
"trackingClick": true,
"trackingOpen": true,
"source": "api",
"createdAt": "2026-04-06T05:47:09.523Z",
"updatedAt": "2026-04-06T05:52:38.949Z"
},
"message": "Campaign updated successfully"
}