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

Blocks


(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 Blocks list.


Get

get page anchor

Retrieve a list of Blocks with addresses and response codes. You may optionally specify a date range to constrain the results.

URI ParameterRequiredRequirementsDescription
datefalseMust be set to 1.Retrieve the timestamp of the Block records. It will return a date in a MySQL timestamp format - YYYY-MM-DD HH:MM:SS.
daysfalseIf specified, must be an integer greater than 0.Number of days in the past for which to retrieve blocks (includes today).
start_datefalseDate 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 blocks.
end_datefalseDate 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 blocks.
limitfalseMust be an integer.Optional field to limit the number of results returned.
offsetfalseMust be an integer.Optional beginning index in the list to retrieve from.
JSONXML

Call

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

Response


_20
[
_20
{
_20
"status": "4.0.0",
_20
"created": "2012-09-02 00:12:12",
_20
"reason": "550 Access denied...04d52d35b93501d500a9bca895ddad5cddd1a9f8486c89ace8c5e959398198cd49cd58288c9d11313975284d852811... (throttled)",
_20
"email": "example@example.com"
_20
},
_20
{
_20
"status": "4.0.0",
_20
"created": "2012-09-02 00:21:29",
_20
"reason": "Connection timed out",
_20
"email": "example@example.com"
_20
},
_20
{
_20
"status": "4.0.0",
_20
"created": "2012-09-02 00:25:33",
_20
"reason": "Unable to resolve MX record for exampledomain.com: nxdomain",
_20
"email": "example@example.com"
_20
}
_20
]


Delete an address from the Block list.

URI ParameterRequiredRequirementsDescription
emailtrueMust be a valid user account email.Blocked email address to remove.
JSONXML
POSThttps://api.sendgrid.com/api/blocks.delete.json
POST Dataapi_user=apikey&api_key=your_sendgrid_api_key&email=emailToDelete@domain.com

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


URI ParameterRequiredRequirementsDescription
start_datefalseDate must be in YYYY-MM-DD format and be before the end_date parameter.Optional date to start counting from.
end_datefalseDate must be in YYYY-MM-DD format and be after the start_date parameter.Optional date to start counting from.
typefalsehard or softThe type of bounce to count.
JSONXML
GEThttps://api.sendgrid.com/api/blocks.count.json
GET Dataapi_user=apikey&api_key=your_sendgrid_api_key

_10
{
_10
"count": "4"
_10
}


Rate this page: