Menu

Expand

This documentation is for the SendGrid Web API v2

To access all the latest features and upcoming developments, please see our v3 API.

Rate this page:

Customer Subuser Unsubscribes

Manage your Customer Subusers' Unsubscribe records.

Retrieve Unsubscribes

Note that you can use either the days parameter or the start_date and end_date parameter.

URI Parameter Required Requirements Description
user Yes Customer subuser must be registered under your account The customer subuser we are retrieving unsubscribes from
task Yes Must be set to get This will allow you to retrieve the unsubscribes for the specified customer subuser
method Yes Must be set to unsubscribes Allows you to access unsubscribe functionality
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

Call

POST https://api.sendgrid.com/apiv2/reseller.subuserManage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=example@example.com&task=get&date=1

Response

[
  {
    "email": "emaieexampexample@example.com",
    "created": "2009-06-01 19:41:39"
  },
  {
    "email": "emaileexampexample@example.com",
    "created": "2009-06-01 19:41:39"
  }
]

Call

POST https://api.sendgrid.com/apiv2/reseller.subuserManage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=example@example.com&task=get&date=1

Response

<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>

Delete 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 subuser must be registered under your account The customer subuser 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 subuser
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

Call

POST https://api.sendgrid.com/apiv2/reseller.subuserManage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=example@example.com&task=delete&email=unsubscribe@sample.com

Response

{
  "message": "success"
}

Call

POST https://api.sendgrid.com/apiv2/reseller.subuserManage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=example@example.com&task=delete&email=unsubscribe@sample.com

Response

<result>
   <message>success</message>
</result>

Add Unsubscribes

Add unsubscribe email records to a customer subuser's account if they need to stop sending email messages to a specific recipient.

URI Parameter Required Requirements Description
user Yes Customer subuser must be registered under your account The customer subuser 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 subuser
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

Call

POST https://api.sendgrid.com/apiv2/reseller.subuserManage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=example@example.com&task=add&email=unsubscribe@sample.com

Response

{
  "message": "success"
}

Call

POST https://api.sendgrid.com/apiv2/reseller.subuserManage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=unsubscribes&user=example@example.com&task=add&email=unsubscribe@sample.com

Response

<result>
   <message>success</message>
</result>
Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the SendGrid tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more