Campaigns API
Elements that can be shared among more than one endpoint definition.
Update a Campaign
PATCH /v3/campaigns/{campaign_id}
Base url: https://api.sendgrid.com
This endpoint allows you to update a specific campaign.
This is especially useful if you only set up the campaign using POST /campaigns, but didn't set many of the parameters.
Authentication
- API Key
Headers
The on-behalf-of
header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be "account-id" followed by the customer account's ID (e.g., on-behalf-of: account-id <account-id>
). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., on-behalf-of: <subuser-username>
). See On Behalf Of for more information.
Request Body
The title of the campaign.
The subject line for your campaign.
The categories you want to tag on this campaign.
The HTML content of this campaign.
The plain content of this campaign.
{
"title": "May Newsletter",
"subject": "New Products for Summer!",
"categories": [
"summer line"
],
"html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>",
"plain_content": "Check out our summer line!"
}
Path Parameters
The id of the campaign you would like to retrieve.
default: NoneResponses
The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI.
The subject of your campaign that your recipients will see.
The ID of the "sender" identity that you have created. Your recipients will see this as the "from" on your marketing emails.
The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs
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 categories you would like associated to this campaign.
The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type.
This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups.
The pool of IPs that you would like to send this email from.
The HTML of your marketing email.
The plain text content of your emails.
The editor used in the UI.
Allowed Values: code, designThe status of your campaign.
{
"id": 986724,
"title": "May Newsletter",
"subject": "New Products for Summer!",
"sender_id": 124451,
"list_ids": [
110,
124
],
"segment_ids": [
110
],
"categories": [
"summer line"
],
"suppression_group_id": 42,
"custom_unsubscribe_url": "",
"ip_pool": "marketing",
"html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>",
"plain_content": "Check out our summer line!",
"status": "Draft"
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
Need some help?
We all do sometimes. Get help now from the Twilio SendGrid Support Team.
Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.