Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Invalid Emails


(warning)

This documentation is for the SendGrid Web API v2

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

This endpoint allows you to retrieve and delete entries in the Invalid Emails list.


Get

get page anchor

Retrieve a list of invalid emails with addresses and response codes, optionally with dates.

URI ParameterRequiredRequirementsDescription
dateNoMust be set to 1Retrieve the timestamp of the invalid email records. It will return a date in a MySQL timestamp format - YYYY-MM-DD HH:MM:SS
daysNoIf specified, must be an integer greater than 0Number of days in the past for which to retrieve invalid emails (includes today)
start_dateNoDate must be in YYYY-MM-DD format and be earlier than the end_date parameter.The start of the date range for which to retrieve invalid emails.
end_dateNoDate must be in YYYY-MM-DD format and be later than the start_date parameter.The end of the date range for which to retrieve invalid emails.
limitNoSome integerOptional field to limit the number of results returned.
offsetNoSome integerOptional beginning point in the list to retrieve from.
emailNoEmail address e.g. testing@example.comOptional email addresses to search for.
JSONXML

Call

GEThttps://api.sendgrid.com/api/invalidemails.get.json
GET Dataapi_user=apikey&api_key=your_sendgrid_api_key&date=1

Response


_12
[
_12
{
_12
"reason": "Known bad domain",
_12
"created": "2011-06-06 16:11:57",
_12
"email": "test@example.com"
_12
},
_12
{
_12
"reason": "Invalid address",
_12
"created": "2012-08-17 11:04:38",
_12
"email": "brandon"
_12
}
_12
]



Retrieve the count of invalid emails.

URI ParameterRequiredRequirementsDescription
start_dateNoDate must be in YYYY-MM-DD format and be earlier than the end_date parameter.The start of the date range for which to retrieve invalid emails.
end_dateNoDate must be in YYYY-MM-DD format and be later than the start_date parameter.The end of the date range for which to retrieve invalid emails.
JSONXML
GEThttps://api.sendgrid.com/api/invalidemails.count.json
GET Dataapi_user=apikey&api_key=your_sendgrid_api_key

_10
{
_10
"count": 2
_10
}



Delete an address from the Invalid Email list.

URI ParameterRequiredRequirementsDescription
emailYesMust be a valid user account emailEmail Invalid Email address to remove
JSONXML
POSThttps://api.sendgrid.com/api/invalidemails.delete.json
POST Dataapi_user=apikey&api_key=your_sendgrid_api_key&email=emailToDelete@domain.com

_10
{
_10
"message": "success"
_10
}


Rate this page: