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

Retrieve bounces by specific 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/{classification}

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

This endpoint will return the number of bounces for the classification specified 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
classificationenum<string>required

The classification you want to filter by. Possible values are: Content, Frequency or Volume Too High, Invalid Address, Mailbox Unavailable, Reputation, Technical Failure, Unclassified.

Possible values:
ContentFrequency or Volume Too HighInvalid AddressMailbox UnavailableReputationTechnical FailureUnclassified
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).

200

200 OK

SchemaExample
Property nameTypeRequiredDescriptionChild properties
resultarray[object]

Retrieve bounces by specific classification

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

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


Rate this page: