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

Retrieve bounce totals by classification



API Overview

api-overview page anchor

An email is considered bounced when the message is undeliverable and then returned to the server that sent it. Bounced emails can be either permanent or temporary failures to deliver the message.

For more information, see our Bounces documentation.

You can also manage bounced emails from the Suppression settings menu in the Twilio SendGrid App(link takes you to an external page).


GET/v3/suppression/bounces/classifications

Base url: https://api.sendgrid.com

This endpoint will return the total number of bounces by classification in descending order for each day. You can retrieve the bounce classification totals in CSV format by specifying "text/csv" in the Accept header.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>

Acceptenum<string>required

Specifies the content type to be returned by this endpoint. You can choose to receive CSV-formatted data by passing "text/csv" in the header.

Default: application/jsonPossible values:
application/jsontext/csv

on-behalf-ofstringOptional

The on-behalf-of header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be "account-id" followed by the customer account's ID (e.g., on-behalf-of: account-id <account-id>). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., on-behalf-of: <subuser-username>). See On Behalf Of for more information.

Property nameTypeRequiredDescription
start_datestringOptional

The start of the time range, in YYYY-MM-DD format, when a bounce was created (inclusive).


end_datestringOptional

The end of the time range, in YYYY-MM-DD format, when a bounce was created (inclusive).

200401
SchemaExample
Property nameTypeRequiredDescriptionChild properties
resultarray[object]

Retrieve bounce totals by classification

retrieve-bounce-totals-by-classification page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_25
const client = require('@sendgrid/client');
_25
client.setApiKey(process.env.SENDGRID_API_KEY);
_25
_25
const headers = {
_25
"Accept": "application/json"
_25
};
_25
const queryParams = {
_25
"start_date": "2010-01-22"
_25
};
_25
_25
const request = {
_25
url: `/v3/suppression/bounces/classifications`,
_25
method: 'GET',
_25
headers: headers,
_25
qs: queryParams
_25
}
_25
_25
client.request(request)
_25
.then(([response, body]) => {
_25
console.log(response.statusCode);
_25
console.log(response.body);
_25
})
_25
.catch(error => {
_25
console.error(error);
_25
});


Rate this page: