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

Export Single Send Stats



API Overview

api-overview page anchor

As a Marketing Campaigns customer, you have access to rich statistics about your Single Sends and Automations. The Marketing Campaigns Statistics API allows you to retrieve these statistics programmatically. for detailed information about the statistics available, see the Marketing Campaigns Stats Overview.

(information)

Note

These endpoints provide stats for Marketing Campaigns only. For stats related to event tracking, please see the Stats API.


GET/v3/marketing/stats/singlesends/export

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

This endpoint allows you to export Single Send stats as .CSV data.

You can specify one Single Send or many: include as many Single Send IDs as you need, separating them with commas, as the value of the ids query string parameter.

The data is returned as plain text response but in .CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a .csv file.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
idsarray[string]Optional

The IDs of Single Sends for which to export stats.


timezonestringOptional

The IANA Area/Region(link takes you to an external page) string representing the timezone in which the stats are to be presented; i.e. "America/Chicago". This parameter changes the timezone format only; it does not alter which stats are returned.

Default: UTC
200400
Schema
string

CSV data

Export Single Send Stats

export-single-send-stats page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_21
const client = require('@sendgrid/client');
_21
client.setApiKey(process.env.SENDGRID_API_KEY);
_21
_21
const queryParams = {
_21
"timezone": "UTC"
_21
};
_21
_21
const request = {
_21
url: `/v3/marketing/stats/singlesends/export`,
_21
method: 'GET',
_21
qs: queryParams
_21
}
_21
_21
client.request(request)
_21
.then(([response, body]) => {
_21
console.log(response.statusCode);
_21
console.log(response.body);
_21
})
_21
.catch(error => {
_21
console.error(error);
_21
});


Rate this page: