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.

Subuser Spam Reports

Retrieve Spam Reports

URI Parameter Required Requirements Description
task Yes Must be set to get Task to retrieve spam reports
user Yes Subuser must be under your account Subuser to retrieve the spam reports of
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.spamreports.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.spamreports.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=get&date=1

Response

<spamreports>
   <spamreport>
      <email>emaieexampexample@example.com</email>
      <created>2009-06-10 12:40:30</created>
   </spamreport>
   <spamreport>
      <email>emaileexampexample@example.com</email>
      <created>2009-06-10 12:40:30</created>
   </spamreport>
</spamreports>

Delete Spam Reports

SendGrid suppresses messages to spam-reporting addresses, but entries can be removed from the suppression list at any time if redelivery to a spam-reporting 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 address from spam report suppression list
user Yes Subuser must be under your account Subuser to remove spam reporting address from
email Yes Address exists on the list Address to remove from the Spam Report suppression list

Call

POST https://api.sendgrid.com/api/user.spamreports.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=delete&email=spamreport@domain.com

Response

{
  "message": "success"
}

Call

POST https://api.sendgrid.com/api/user.spamreports.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=delete&email=spamreport@domain.com

Response

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

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.