Skip to content

Latest commit

 

History

History
115 lines (94 loc) · 3.5 KB

File metadata and controls

115 lines (94 loc) · 3.5 KB
layout page
weight 0
title Invalid Emails
navigation
show
true

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

{% anchor h2 %} get {% endanchor %}

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

{% parameters get %}

{% parameter 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' %}
{% parameter 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)' %}
{% parameter 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.' %}
{% parameter 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.' %}
{% parameter limit No 'Some integer' 'Optional field to limit the number of results returned.' %}
{% parameter offset No 'Some integer' 'Optional beginning point in the list to retrieve from.' %}
{% parameter email No 'Email address eg [email protected]' 'Optional email addresses to search for.' %} {% endparameters %}

{% apiexample get GET https://api.sendgrid.com/api/invalidemails.get api_user=your_sendgrid_username&api_key=your_sendgrid_password&date=1 %} {% response json %} [ { "reason": "Known bad domain", "created": "2011-06-06 16:11:57", "email": "[email protected]" }, { "reason": "Invalid address", "created": "2012-08-17 11:04:38", "email": "brandon" } ] {% endresponse %} {% response xml %} Known bad domain 2011-06-06 16:11:57 [email protected] Invalid address 2012-08-17 11:04:38 brandon

{% endresponse %} {% endapiexample %}


{% anchor h2 %} count {% endanchor %}

Retrieve the count of invalid emails.

{% parameters count %}

{% parameter 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.' %}
{% parameter 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.' %} {% endparameters %}

{% apiexample count GET https://api.sendgrid.com/api/invalidemails.count api_user=your_sendgrid_username&api_key=your_sendgrid_password %} {% response json %} { "count": 2 } {% endresponse %} {% response xml %} 2

{% endresponse %} {% endapiexample %}


{% anchor h2 %} delete {% endanchor %}

Delete an address from the Invalid Email list.

{% parameters delete %}

{% parameter email Yes 'Must be a valid user account email' 'Email Invalid Email address to remove' %} {% endparameters %}

{% apiexample delete POST https://api.sendgrid.com/api/invalidemails.delete api_user=your_sendgrid_username&api_key=your_sendgrid_password&email=[email protected] %} {% response json %} { "message": "success" } {% endresponse %} {% response xml %} success

{% endresponse %} {% endapiexample %}