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
Parameter Value Requirements Description

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

1
2
3
4
5
6
7
8
9
10
[
  {
    "email": "email1@domain.com",
    "created": "2009-06-01 19:41:39"
  },
  {
    "email": "email2@domain2.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

1
2
3
4
5
6
7
8
9
10
<spamreports>
   <spamreport>
      <email>email1@domain.com</email>
      <created>2009-06-10 12:40:30</created>
   </spamreport>
   <spamreport>
      <email>email2@domain2.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
Parameter Value Requirements Description

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

1
2
3
{
  "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

1
2
3
<result>
   <message>success</message>
</result>