This endpoint allows you to retrieve and delete entries in the Invalid Emails list.
get
Retrieve a list of invalid emails with addresses and response codes, optionally with dates.
|
Parameter
|
Required
|
Requirements
|
Description
|
|
date
|
No
|
Must be set to 1
|
Retrieve the timestamp of the invalid email records. It will return a date in a MySQL timestamp format - YYYY-MM-DD HH:MM:SS
|
|
days
|
No
|
If specified, must be an integer greater than 0
|
Number of days in the past for which to retrieve invalid emails (includes today)
|
|
start_date
|
No
|
Date 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_date
|
No
|
Date 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.
|
| limit |
No |
some integer |
Optional field to limit the number of results returned. |
| offset |
No |
some integer |
Optional beginning point in the list to retrieve from. |
| email |
No |
email address eg testing@example.com |
Optional email addresses to search for. |
Call
1
| https://sendgrid.com/api/invalidemails.get.xml?api_user=youremail@domain.com&api_key=secureSecret&date=1
|
Response
1
2
3
4
5
6
7
8
9
10
11
12
| [
{
"reason": "Known bad domain",
"created": "2011-06-06 16:11:57",
"email": "test@example.com"
},
{
"reason": "Invalid address",
"created": "2012-08-17 11:04:38",
"email": "brandon"
}
]
|
Call
1
| https://sendgrid.com/api/invalidemails.get.xml?api_user=youremail@domain.com&api_key=secureSecret&date=1
|
Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| <?xml version="1.0" encoding="ISO-8859-1"?>
<invalidemails>
<invalidemail>
<reason>Known bad domain</reason>
<created>2011-06-06 16:11:57</created>
<email>test@example.com</email>
</invalidemail>
<invalidemail>
<reason>Invalid address</reason>
<created>2012-08-17 11:04:38</created>
<email>brandon</email>
</invalidemail>
</invalidemails>
|
delete
Delete an address from the Invalid Email list.
| Parameter |
Required |
Requirements |
Description |
| email |
Yes |
Must be a valid user account email |
Email Invalid Email address to remove |
Call
1
| https://sendgrid.com/api/invalidemails.delete.json?api_user=youremail@domain.com&api_key=secureSecret&email=emailToDelete@domain.com
|
Response: Success
1
2
3
| {
"message": "success"
}
|
Response: Error
1
2
3
4
5
6
| {
"message": "error",
"errors": [
"...error messages..."
]
}
|
Call
1
| https://sendgrid.com/api/invalidemails.delete.xml?api_user=youremail@domain.com&api_key=secureSecret&email=emailToDelete@domain.com
|
Response: Success
1
2
3
| <result>
success
<result>
|
Response: Error
1
2
3
4
5
6
| <?xml version="1.0" encoding="ISO-8859-1"?>
<result>
Email does not exist
@nodes
</result>
|