provider Campaigns API POST /campaigns
@utdk/sendgrid /campaigns
Create a Campaign
**This endpoint allows you to create a campaign.** In order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both html and plain text), and at least one list or segment ID. This information is not required when you create a campaign.
on-behalf-of header
string

Try it

Authentication
Configure credentials for Email Activity (beta)
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

postCampaigns
POST/campaigns
**This endpoint allows you to create a campaign.** In order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both html and plain text), and at least one list or segment ID. This information is not required when you create a campaign.

Input

The categories you would like associated to this campaign.

This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups.

The editor used in the UI.

The HTML of your marketing email.

The pool of IPs that you would like to send this email from.

The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs

The plain text content of your emails.

The segment IDs that you are sending this list to. You can have both segment IDs and list IDs. Segments are limited to 10 segment IDs.

The ID of the "sender" identity that you have created. Your recipients will see this as the "from" on your marketing emails.

The subject of your campaign that your recipients will see.

The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type.

required

The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import sendgrid from '@utdk/sendgrid';

await sendgrid.postCampaigns({
  "on-behalf-of": "The subuser's username. This header generates the API call as if the subuser account was making the call."
})