Skip to contentSkip to navigationSkip to topbar
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 (for global users and subusers)

Base url: https://api.eu.sendgrid.com (for EU regional subusers)

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 classificationLink to code sample: Retrieve bounces by specific classification
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const classification = "Content";
5
const headers = {
6
Accept: "application/json",
7
};
8
const queryParams = {
9
start_date: "2010-01-22",
10
};
11
12
const request = {
13
url: `/v3/suppression/bounces/classifications/${classification}`,
14
method: "GET",
15
headers: headers,
16
qs: queryParams,
17
};
18
19
client
20
.request(request)
21
.then(([response, body]) => {
22
console.log(response.statusCode);
23
console.log(response.body);
24
})
25
.catch((error) => {
26
console.error(error);
27
});

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.