Manage your customers' unsubscribes.
Note that you can use either the days
parameter or the start_date
and end_date
parameters.
URI Parameter
Required
Requirements
Description
user
Yes
Customer must be registered under your account
The customer we are retrieving unsubscribes from
task
Yes
Must be set to get
This will allow you to retrieve the unsubscribes for the specified customer
date
No
Must be set to 1
Retrieves the timestamps. It will return a date in a MySQL timestamp format - YYYY-MM-DD HH:MM:SS
method
Yes
Must be set to unsubscribes
Allows you to access unsubscribe functionality
JSON
XML
POST
https://api.sendgrid.com/apiv2/reseller.manage.json
POST Data
api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=eexampexample@example.com&task=get&date=1
[
{
"email": "emaieexampexample@example.com",
"created": "2009-06-01 19:41:39"
},
{
"email": "emaileexampexample@example.com",
"created": "2009-06-01 19:41:39"
}
]
POST
https://api.sendgrid.com/apiv2/reseller.manage.xml
POST Data
api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=eexampexample@example.com&task=get&date=1
<unsubscribes>
<unsubscribe>
<email>emaieexampexample@example.com</email>
<created>2009-06-10 12:40:30</created>
</unsubscribe>
<unsubscribe>
<email>emaileexampexample@example.com</email>
<created>2009-06-10 12:40:30</created>
</unsubscribe>
</unsubscribes>
Since SendGrid does not deliver to unsubscribe addresses, users can remove unsubscribes from their list at any time if re-delivery to an unsubscribed address is desired.
URI Parameter
Required
Requirements
Description
user
Yes
Customer must be registered under your account
The customer we are retrieving unsubscribes from
task
Yes
Must be set to delete
This will allow you to delete an unsubscribe record for the specified customer
method
Yes
Must be set to unsubscribes
Allows you to access unsubscribe functionality
email
No
Must be an unsubscribe record
You must specify the unsubscribe record to remove
JSON
XML
POST
https://api.sendgrid.com/apiv2/reseller.manage.json
POST Data
api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=eexampexample@example.com&task=delete&email=unsubscribe@sample.com
POST
https://api.sendgrid.com/apiv2/reseller.manage.xml
POST Data
api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=eexampexample@example.com&task=delete&email=unsubscribe@sample.com
<result>
<message>success</message>
</result>
Add unsubscribe email records to a customer's account if they need to stop sending email messages to a specific recipient.
URI Parameter
Required
Requirements
Description
user
Yes
Customer must be registered under your account
The customer we are retrieving unsubscribes from
task
Yes
Must be set to add
This will allow you to add an unsubscribe record for the specified customer
method
Yes
Must be set to unsubscribes
Allows you to access unsubscribe functionality
email
No
Must be an unsubscribe record
You must specify the unsubscribe record to add
JSON
XML
POST
https://api.sendgrid.com/apiv2/reseller.manage.json
POST Data
api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=eexampexample@example.com&task=add&email=unsubscribe@sample.com
POST
https://api.sendgrid.com/apiv2/reseller.manage.xml
POST Data
api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=eexampexample@example.com&task=add&email=unsubscribe@sample.com
<result>
<message>success</message>
</result>