Download OpenAPI specification:Download
This will create a DRAFT in your Gmail account and return the actual Gmail DRAFT Id. Then use /campaigns to send the campaign. DO NOT specify a value for campaignDraftId.
campaignDraftId | string This is the DRAFT ID that will be returned. Do not specify it. |
fromEmail | string The from address for the campaign. Must match an authenticated From Address in the Gmail account. |
subject required | string |
message required | string |
messageType | string Set to either "html" or "plain". HTML messages will always result in a plain text message being auto generated by Google and sent along with the HTML MIME part. |
listAddress | string The list address for this campaign. Example: aaa-bbb-ccc@gmass.co |
emailAddresses | string |
cc | string One or more Cc addresses, separated by a comma or any other standard delimiter. Cc addresses will receive a copy of each individual email sent as part of the campaign. |
bcc | string One or more Bcc addresses, separated by a comma or any other standard delimiter. Bcc addresses will receive a blind copy of each individual email sent as part of the campaign. |
Array of objects (campaignDraftAttachment) The list of attachments for this message |
{- "campaignDraftId": "string",
- "fromEmail": "string",
- "subject": "string",
- "message": "string",
- "messageType": "string",
- "listAddress": "string",
- "emailAddresses": "string",
- "cc": "string",
- "bcc": "string",
- "attachments": [
- {
- "fileName": "string",
- "base64Content": "string",
- "contentType": "string"
}
]
}
{- "campaignDraftId": "string",
- "fromEmail": "string",
- "subject": "string",
- "message": "string",
- "messageType": "string",
- "listAddress": "string",
- "emailAddresses": "string",
- "cc": "string",
- "bcc": "string",
- "attachments": [
- {
- "fileName": "string",
- "base64Content": "string",
- "contentType": "string"
}
]
}
limit | integer <int32> |
offset | integer <int32> |
[- {
- "campaignId": 0,
- "subject": "string",
- "friendlyName": "string",
- "stage": 0,
- "creationTime": "2019-08-24T14:15:22Z",
- "fromLine": "string",
- "statistics": {
- "recipients": 0,
- "opens": 0,
- "clicks": 0,
- "replies": 0,
- "unsubscribes": 0,
- "bounces": 0,
- "blocks": 0
}, - "status": "string",
- "lists": [
- {
- "listAddress": "string",
- "listSource": {
- "listSourceSheet": {
- "spreadsheetId": "string",
- "worksheetId": "string",
- "spreadsheetName": "string",
- "worksheetName": "string",
- "KeepDuplicates": true,
- "FilterCriteria": "string",
- "AndOr": "string",
- "UpdateSheet": true
}
}
}
], - "autoFollowups": [
- {
- "stage": 0,
- "campaignId": 0,
- "batches": [
- {
- "batchId": 0,
- "status": "string",
- "creationTime": "2019-08-24T14:15:22Z",
- "estimatedCount": 0
}
]
}
]
}
]
Set when the campaign should send, along with other options like tracking in the campaignSettings object. You must already have a campaignDraftId value from the /api/campaigndrafts method.
campaignDraftId required | string |
openTracking | boolean Choose whether to track opens. True or False. |
clickTracking | boolean Choose whether to track clicks. True or False. |
sendTime | string Do not specify to send a campaign right now. Otherwise, specify time with an optional time zone offset. Example: "04/27/21 14:30 -04:00" indicates April 27, 2021 at 2:30 PM EST time. |
skipWeekends | boolean Determines whether the scheduler should avoid sending this campaign on the weekend. True or False. |
skipHolidays | boolean Determines whether the scheduler should avoid sending this campaign on designated holidays. True or False. |
friendlyName | string A friendly name by which to identify this campaign. |
allowedDays | string Specify just certain days of the week to send this campaign. Submit a comma separated string where 1=Saturday, 2=Sunday, 3=Monday, 4=Tuesday, and so on. |
previewText | string Optional preview text which displays next to the subject line in most email clients. See https://www.gmass.co/blog/preview-text/ |
throttling | integer <int32> Add a pause after each individual email that is sent as part of this campaign. Specify as 1, 2, or 3. See https://www.gmass.co/blog/mail-merge-feature-throttle-your-email-campaign/ |
suppressionDays | integer <int32> Filter out recipients that have received another campaign from you in the last X days. Specify the number of days as an integer. 1=5 to 10 seconds.2=10 to 60 seconds.3=1 to 5 minutes. See https://www.gmass.co/blog/suppress-addresses-by-number-of-days-since-last-email/ |
suppressionCampaigns | string Filter out recipients of a prior campaign. Specify a comma-separated string of campaign ID numbers. See https://www.gmass.co/blog/new-gmail-mail-merge-feature-use-suppression-lists-to-filter-out-recipients-of-past-campaigns/ |
sendAsReply | boolean Specify whether the campaign should be sent as a new thread of an existing thread. True or False. See https://www.gmass.co/blog/send-email-campaign-as-reply-to-recent-conversation/ |
replyTo | string Specify a custom Reply-To header for the campaign. If a Reply-To address is already set in your Gmail account, that will be used. This setting can override what's set in your Gmail account. See https://www.gmass.co/blog/reply-to-address/ |
createDrafts | boolean Specify whether to actually send emails for this campaign or just create DRAFTs which can be reviewed and sent later. True or False. Default value is False. See https://www.gmass.co/blog/no-more-fear-preview-your-emails-as-drafts-then-send-them-with-one-click/ |
emailsPerDay | integer <int32> Set a fixed number of emails that should be sent per day. |
fromName | string Specify the From Name that will be seen by your recipients. This will override the From Name set for the From Address in your Gmail account. |
useSMTP | boolean Specify whether the campaign should be sent through your SMTP server or natively through Gmail. True or False. |
skipSent | boolean Specify whether emails should be logged in your SENT folder. True or False. |
verify | boolean Specify whether each recipient address should be verified before sending. True or False. |
campaignIdToReplyTo | integer <int32> To be used in conjunction with sendAsReply. Specify an optional campaign if the replies should be threaded to a prior campaign. |
imagesMode | string Specify how images should be included. d: default, h: hosted, e: embedded |
stageOneDays | integer <int32> Number of days before this stage follow-up is sent |
stageOneCampaignText | string Text to use for the follow-up email. |
stageOneCampaignId | integer <int32> Custom content to be used for the follow-up email. If both stageOneCampaignId and stageOneCampaignText are set, then stageOneCampaignId will be used. |
stageOneAction | string Determines which behavior follow-ups should be sent based on. r=No Reply. o=No Open. c=No Click. s=No Reply or Click. a=Everyone |
stageOneTime | string Optionally, specify the time of day the follow-up should be sent. Specify without a time zone offset, but in the same time zone as sendTime. |
stageTwoDays | integer <int32> |
stageTwoCampaignText | string |
stageTwoCampaignId | integer <int32> |
stageTwoAction | string |
stageTwoTime | string |
stageThreeDays | integer <int32> |
stageThreeCampaignText | string |
stageThreeCampaignId | integer <int32> |
stageThreeAction | string |
stageThreeTime | string |
stageFourDays | integer <int32> |
stageFourCampaignText | string |
stageFourCampaignId | integer <int32> |
stageFourAction | string |
stageFourTime | string |
stageFiveDays | integer <int32> |
stageFiveCampaignText | string |
stageFiveCampaignId | integer <int32> |
stageFiveAction | string |
stageFiveTime | string |
stageSixDays | integer <int32> |
stageSixCampaignText | string |
stageSixCampaignId | integer <int32> |
stageSixAction | string |
stageSixTime | string |
stageSevenDays | integer <int32> |
stageSevenCampaignText | string |
stageSevenCampaignId | integer <int32> |
stageSevenAction | string |
stageSevenTime | string |
stageEightDays | integer <int32> |
stageEightCampaignText | string |
stageEightCampaignId | integer <int32> |
stageEightAction | string |
stageEightTime | string |
ABTest | boolean Set to true or false, based on whether this campaign is being A/B tested |
ABTestDecision | string Set to m or a, based on whether the winner should be decided manually or automatically |
ABTestHoursAfter | integer <int32> Set to the number of hours after the test portion is sent that a winner should be picked |
ABTestPercentage | integer <int32> Set the percentage of the campaign that should be sent as the test portion |
ABTestDecisionFactor | string Only required if ABTestDecision=a. The parameter by which the winner will be decided. o=opens c=clicks r=replies |
MultiSend | string Specify a comma-separated list of accounts to distribute the volume over. MultiSend accounts must already be connected to your primary account. |
{- "openTracking": true,
- "clickTracking": true,
- "sendTime": "string",
- "skipWeekends": true,
- "skipHolidays": true,
- "friendlyName": "string",
- "allowedDays": "string",
- "previewText": "string",
- "throttling": 0,
- "suppressionDays": 0,
- "suppressionCampaigns": "string",
- "sendAsReply": true,
- "replyTo": "string",
- "createDrafts": true,
- "emailsPerDay": 0,
- "fromName": "string",
- "useSMTP": true,
- "skipSent": true,
- "verify": true,
- "campaignIdToReplyTo": 0,
- "imagesMode": "string",
- "stageOneDays": 0,
- "stageOneCampaignText": "string",
- "stageOneCampaignId": 0,
- "stageOneAction": "string",
- "stageOneTime": "string",
- "stageTwoDays": 0,
- "stageTwoCampaignText": "string",
- "stageTwoCampaignId": 0,
- "stageTwoAction": "string",
- "stageTwoTime": "string",
- "stageThreeDays": 0,
- "stageThreeCampaignText": "string",
- "stageThreeCampaignId": 0,
- "stageThreeAction": "string",
- "stageThreeTime": "string",
- "stageFourDays": 0,
- "stageFourCampaignText": "string",
- "stageFourCampaignId": 0,
- "stageFourAction": "string",
- "stageFourTime": "string",
- "stageFiveDays": 0,
- "stageFiveCampaignText": "string",
- "stageFiveCampaignId": 0,
- "stageFiveAction": "string",
- "stageFiveTime": "string",
- "stageSixDays": 0,
- "stageSixCampaignText": "string",
- "stageSixCampaignId": 0,
- "stageSixAction": "string",
- "stageSixTime": "string",
- "stageSevenDays": 0,
- "stageSevenCampaignText": "string",
- "stageSevenCampaignId": 0,
- "stageSevenAction": "string",
- "stageSevenTime": "string",
- "stageEightDays": 0,
- "stageEightCampaignText": "string",
- "stageEightCampaignId": 0,
- "stageEightAction": "string",
- "stageEightTime": "string",
- "ABTest": true,
- "ABTestDecision": "string",
- "ABTestHoursAfter": 0,
- "ABTestPercentage": 0,
- "ABTestDecisionFactor": "string",
- "MultiSend": "string"
}
{- "campaignId": 0,
- "subject": "string",
- "friendlyName": "string",
- "stage": 0,
- "creationTime": "2019-08-24T14:15:22Z",
- "fromLine": "string",
- "statistics": {
- "recipients": 0,
- "opens": 0,
- "clicks": 0,
- "replies": 0,
- "unsubscribes": 0,
- "bounces": 0,
- "blocks": 0
}, - "status": "string",
- "lists": [
- {
- "listAddress": "string",
- "listSource": {
- "listSourceSheet": {
- "spreadsheetId": "string",
- "worksheetId": "string",
- "spreadsheetName": "string",
- "worksheetName": "string",
- "KeepDuplicates": true,
- "FilterCriteria": "string",
- "AndOr": "string",
- "UpdateSheet": true
}
}
}
], - "autoFollowups": [
- {
- "stage": 0,
- "campaignId": 0,
- "batches": [
- {
- "batchId": 0,
- "status": "string",
- "creationTime": "2019-08-24T14:15:22Z",
- "estimatedCount": 0
}
]
}
]
}
campaignId required | integer <int32> |
{- "campaignId": 0,
- "subject": "string",
- "friendlyName": "string",
- "stage": 0,
- "creationTime": "2019-08-24T14:15:22Z",
- "fromLine": "string",
- "statistics": {
- "recipients": 0,
- "opens": 0,
- "clicks": 0,
- "replies": 0,
- "unsubscribes": 0,
- "bounces": 0,
- "blocks": 0
}, - "status": "string",
- "lists": [
- {
- "listAddress": "string",
- "listSource": {
- "listSourceSheet": {
- "spreadsheetId": "string",
- "worksheetId": "string",
- "spreadsheetName": "string",
- "worksheetName": "string",
- "KeepDuplicates": true,
- "FilterCriteria": "string",
- "AndOr": "string",
- "UpdateSheet": true
}
}
}
], - "autoFollowups": [
- {
- "stage": 0,
- "campaignId": 0,
- "batches": [
- {
- "batchId": 0,
- "status": "string",
- "creationTime": "2019-08-24T14:15:22Z",
- "estimatedCount": 0
}
]
}
]
}
limit | integer <int32> |
offset | integer <int32> |
page | integer <int32> |
search | string |
q | string |
{- "count": 0,
- "offset": 0,
- "limit": 0,
- "total": 0,
- "lists": [
- {
- "id": 0,
- "aliasAddress": "string",
- "spreadSheetName": "string",
- "workSheetName": "string",
- "columns": "string",
- "filterCriteria": "string",
- "andOr": "string",
- "creationDate": "2019-08-24T14:15:22Z",
- "addressCount": 0
}
]
}
Creates a new list and returns a GMass list address alias
listAddress | string The GMass-generated address to represent an email list. Looks like aaabbb-cccc@gmass.co |
object (listSource) |
{- "listAddress": "string",
- "listSource": {
- "listSourceSheet": {
- "spreadsheetId": "string",
- "worksheetId": "string",
- "spreadsheetName": "string",
- "worksheetName": "string",
- "KeepDuplicates": true,
- "FilterCriteria": "string",
- "AndOr": "string",
- "UpdateSheet": true
}
}
}
{- "listAddress": "string",
- "listSource": {
- "listSourceSheet": {
- "spreadsheetId": "string",
- "worksheetId": "string",
- "spreadsheetName": "string",
- "worksheetName": "string",
- "KeepDuplicates": true,
- "FilterCriteria": "string",
- "AndOr": "string",
- "UpdateSheet": true
}
}
}
Specify the numeric campaign ID to retrieve the recipients for that campaign.
campaignId required | integer <int32> |
limit | integer <int32> |
offset | integer <int32> |
stage | integer <int32> |
date | string <date-time> |
{- "metadata": {
- "links": {
- "property1": "string",
- "property2": "string"
}, - "totalRecords": 0,
- "offset": 0,
- "limit": 0,
- "count": 0
}, - "data": [
- {
- "emailAddress": "string",
- "gmailResponseText": "string",
- "sentTime": "2019-08-24T14:15:22Z",
- "sender": "string"
}
]
}
Specify the numeric campaign ID to retrieve the "opens" for that campaign. Open tracking must have been enabled.
campaignId required | integer <int32> |
limit | integer <int32> |
offset | integer <int32> |
{- "metadata": {
- "links": {
- "property1": "string",
- "property2": "string"
}, - "totalRecords": 0,
- "offset": 0,
- "limit": 0,
- "count": 0
}, - "data": [
- {
- "sender": "string",
- "emailAddress": "string",
- "openCount": 0,
- "lastOpenTime": "2019-08-24T14:15:22Z"
}
]
}
Specify the numeric campaign ID to retrieve the recipients that clicked in this campaign. Click tracking must have been enabled.
campaignId required | integer <int32> |
limit | integer <int32> |
offset | integer <int32> |
{- "metadata": {
- "links": {
- "property1": "string",
- "property2": "string"
}, - "totalRecords": 0,
- "offset": 0,
- "limit": 0,
- "count": 0
}, - "data": [
- {
- "emailAddress": "string",
- "url": "string",
- "clickTime": "2019-08-24T14:15:22Z",
- "sender": "string"
}
]
}
Specify the numeric campaign ID to retrieve the recipients that unsubscribed. Unsubscribed addresses apply account-wide and are eliminated from future campaigns. Use campaignId=0 for all account unsubscribes.
campaignId required | integer <int32> |
limit | integer <int32> |
offset | integer <int32> |
{- "metadata": {
- "links": {
- "property1": "string",
- "property2": "string"
}, - "totalRecords": 0,
- "offset": 0,
- "limit": 0,
- "count": 0
}, - "data": [
- {
- "emailAddress": "string",
- "unsubscribeTime": "2019-08-24T14:15:22Z",
- "sender": "string"
}
]
}
Specify the numeric campaign ID to retrieve the recipients that bounced. Bounced addresses apply account-wide and are eliminated from future campaigns.
campaignId required | integer <int32> |
limit | integer <int32> |
offset | integer <int32> |
{- "metadata": {
- "links": {
- "property1": "string",
- "property2": "string"
}, - "totalRecords": 0,
- "offset": 0,
- "limit": 0,
- "count": 0
}, - "data": [
- {
- "emailAddress": "string",
- "bounceReason": "string",
- "bounceTime": "2019-08-24T14:15:22Z",
- "sender": "string"
}
]
}
campaignId required | integer <int32> |
limit | integer <int32> |
offset | integer <int32> |
{- "metadata": {
- "links": {
- "property1": "string",
- "property2": "string"
}, - "totalRecords": 0,
- "offset": 0,
- "limit": 0,
- "count": 0
}, - "data": [
- {
- "emailAddress": "string",
- "blockReason": "string",
- "blockTime": "2019-08-24T14:15:22Z",
- "sender": "string"
}
]
}
Specify the numeric campaign ID to retrieve the recipients that replied.
campaignId required | integer <int32> |
limit | integer <int32> |
offset | integer <int32> |
{- "metadata": {
- "links": {
- "property1": "string",
- "property2": "string"
}, - "totalRecords": 0,
- "offset": 0,
- "limit": 0,
- "count": 0
}, - "data": [
- {
- "emailAddress": "string",
- "replyId": 0,
- "alreadyReplied": true,
- "replyTime": "2019-08-24T14:15:22Z",
- "sender": "string"
}
]
}
If you need to send a transactional email to just one recipient as opposed to a campaign, use this method. You can also send transactional email via the SMTP relay at smtp.gmass.co.
transactionalEmailId | string |
fromEmail | string |
fromName | string |
to | string |
cc | string |
bcc | string |
subject | string |
message | string |
messageRaw | string |
object (transactionalSettings) |
{- "transactionalEmailId": "string",
- "fromEmail": "string",
- "fromName": "string",
- "to": "string",
- "cc": "string",
- "bcc": "string",
- "subject": "string",
- "message": "string",
- "messageRaw": "string",
- "settings": {
- "openTrack": true,
- "clickTrack": true,
- "messageType": "string",
- "useCustomerSmtp": true,
- "SmtpServerId": 0,
- "threadToCampaign": 0,
- "smtpRelay": true,
- "listUnsubscribeHeader": true
}
}
{- "transactionalEmailId": "string",
- "fromEmail": "string",
- "fromName": "string",
- "to": "string",
- "cc": "string",
- "bcc": "string",
- "subject": "string",
- "message": "string",
- "messageRaw": "string",
- "settings": {
- "openTrack": true,
- "clickTrack": true,
- "messageType": "string",
- "useCustomerSmtp": true,
- "SmtpServerId": 0,
- "threadToCampaign": 0,
- "smtpRelay": true,
- "listUnsubscribeHeader": true
}
}
emailAddress | string |
unsubscribeTime | string <date-time> |
{- "emailAddress": "string",
- "unsubscribeTime": "2019-08-24T14:15:22Z"
}
{- "emailAddress": "string",
- "unsubscribeTime": "2019-08-24T14:15:22Z",
- "sender": "string"
}
campaignId required | integer <int32> |
emailAddress | string |
unsubscribeTime | string <date-time> |
{- "emailAddress": "string",
- "unsubscribeTime": "2019-08-24T14:15:22Z"
}
{- "emailAddress": "string",
- "unsubscribeTime": "2019-08-24T14:15:22Z",
- "sender": "string"
}
Learn more about warm-up at https://www.gmass.co/blog/free-email-warm-up-tool/
[- {
- "Date": "2019-08-24T14:15:22Z",
- "Inbox": 0,
- "Spam": 0,
- "Promotions": 0,
- "Missing": 0
}
]
id | integer <int32> |
platformSource | string Must be one of: Opens, Clicks, Replies, Bounces, Unsubscribes, Sends |
eventType | string |
Url | string |
dataFormat | string |
enabled | boolean |
{- "id": 0,
- "platformSource": "string",
- "eventType": "string",
- "Url": "string",
- "dataFormat": "string",
- "enabled": true
}
{- "id": 0,
- "platformSource": "string",
- "eventType": "string",
- "Url": "string",
- "dataFormat": "string",
- "enabled": true
}
id | integer <int32> |
platformSource | string Must be one of: Opens, Clicks, Replies, Bounces, Unsubscribes, Sends |
eventType | string |
Url | string |
dataFormat | string |
enabled | boolean |
{- "id": 0,
- "platformSource": "string",
- "eventType": "string",
- "Url": "string",
- "dataFormat": "string",
- "enabled": true
}
{- "id": 0,
- "platformSource": "string",
- "eventType": "string",
- "Url": "string",
- "dataFormat": "string",
- "enabled": true
}