We will deprecate this version on February 10, 2025. To access all the latest features and upcoming developments, please see our v3 API. For assistance with transitioning, refer to our migration guide.
This endpoint allows you to retrieve and delete entries in the Blocks list.
Retrieve a list of Blocks with addresses and response codes. You may optionally specify a date range to constrain the results.
URI Parameter | Required | Requirements | Description |
---|---|---|---|
date | false | Must 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 . |
days | false | If specified, must be an integer greater than 0. | Number of days in the past for which to retrieve blocks (includes today). |
start_date | false | 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 blocks. |
end_date | false | 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 blocks. |
limit | false | Must be an integer. | Optional field to limit the number of results returned. |
offset | false | Must be an integer. | Optional beginning index in the list to retrieve from. |
GET | https://api.sendgrid.com/api/blocks.get.json |
---|---|
GET Data | api_user=apikey&api_key=your_sendgrid_api_key&date=1 |
1[2{3"status": "4.0.0",4"created": "2012-09-02 00:12:12",5"reason": "550 Access denied...04d52d35b93501d500a9bca895ddad5cddd1a9f8486c89ace8c5e959398198cd49cd58288c9d11313975284d852811... (throttled)",6"email": "example@example.com"7},8{9"status": "4.0.0",10"created": "2012-09-02 00:21:29",11"reason": "Connection timed out",12"email": "example@example.com"13},14{15"status": "4.0.0",16"created": "2012-09-02 00:25:33",17"reason": "Unable to resolve MX record for exampledomain.com: nxdomain",18"email": "example@example.com"19}20]
Delete an address from the Block list.
URI Parameter | Required | Requirements | Description |
---|---|---|---|
true | Must be a valid user account email. | Blocked email address to remove. |
URI Parameter | Required | Requirements | Description |
---|---|---|---|
start_date | false | Date must be in YYYY-MM-DD format and be before the end_date parameter. | Optional date to start counting from. |
end_date | false | Date must be in YYYY-MM-DD format and be after the start_date parameter. | Optional date to start counting from. |
type | false | hard or soft | The type of bounce to count. |