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

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

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

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.