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:

Subuser Unsubscribes

Retrieve Unsubscribes

URI Parameter Required Requirements Description
task Yes Must be set to get Task to retrieve unsubscribes for subuser
user Yes Subuser must be under your account Subuser to retrieve unsubscribes for
date No 0 or 1 Optional argument to retrieve the timestamps, in ISO-8601 format, Pacific Timezone: YYYY-MM-DD HH:MM:SS

Call

POST https://api.sendgrid.com/api/user.unsubscribes.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&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/api/user.unsubscribes.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&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

SendGrid suppresses messages to unsubscribed addresses, but entries can be removed from the suppression list at any time if redelivery to an unsubscribed address is desired. Take care that the address should be redelivered to.

URI Parameter Required Requirements Description
task Yes Must be set to delete Task to remove unsubscribed address from subuser
user Yes Subuser must be under your account Subuser to remove unsubscribed address from
email Yes Address exists on the list Address to remove from the Unsubscribe suppression list

Call

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

Response

{
  "message": "success"
}

Call

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

Response

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

Add Unsubscribes

Manually add address to the Unsubscribe suppression list, to prevent delivery to the address.

URI Parameter Required Requirements Description
task Yes Must be set to add Task to add address to subuser Unsubscribe list
user Yes Subuser must be under your account Subuser to add Unsubscribed address
email Yes Valid email address Address to add to the Unsubscribe suppression list

Call

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

Response

{
  "message": "success"
}

Call

POST https://api.sendgrid.com/api/user.unsubscribes.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&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. Please select the reason(s) for your feedback or provide additional information about how we can improve:

        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