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

Manage your Customer Subusers' Invalid Email records.

Retrieve Invalid Emails

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

Call

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

Response

[
  {
    "email": "example@example.com",
    "reason": "Mail domain mentioned in email address is unknown",
    "created": "2009-06-01 19:41:39"
  },
  {
    "email": "isaac@hotmail",
    "reason": "Bad Syntax",
    "created": "2009-06-01 19:41:39"
  },
  {
    "email": "example@example.com",
    "reason": "Known bad domain",
    "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=invalidemails&user=example@example.com&task=get&date=1

Response

<invalidemails>
   <invalidemail>
      <email>example@example.com</email>
      <reason>Mail domain mentioned in email address is unknown</reason>
      <created>2009-06-10 12:40:30</created>
   </invalidemail>
   <invalidemail>
      <email>isaac@hotmail</email>
      <reason>Bad Syntax</reason>
      <created>2009-06-10 12:40:30</created>
   </invalidemail>
   <invalidemail>
      <email>example@example.com</email>
      <reason>Known bad domain</reason>
      <created>2009-06-10 12:40:30</created>
   </invalidemail>
</invalidemails>

Delete Invalid Emails

Since SendGrid does not deliver to invalid emails, users can remove invalid emails from their list at any time if re-delivery to a spam reported address is desired.

URI Parameter Required Requirements Description
user Yes Customer subuser must be registered under your account The customer subuser we are retrieving invalid emails from
task Yes Must be set to delete This will allow you to delete an invalid email for the specified customer subuser
email No Must be an invalid email You must specify the invalid emails to remove
method Yes Must be set to invalidemails Allows you to access invalid email functionality

Call

POST https://api.sendgrid.com/apiv2/reseller.subuserManage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=invalidemails&user=example@example.com&task=delete&email=invalidemail@example.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=invalidemails&user=example@example.com&task=delete&email=invalidemail@example.com

Response

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

Need some help?

We all do sometimes. Get help now from the Twilio SendGrid Support Team.

Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

Loading Code Sample...
        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

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

        Thanks for your feedback!

        thanks-feedback-gif