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

Get All Automation 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/automations

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

This endpoint allows you to retrieve stats for all your Automations.

By default, all of your Automations will be returned, but you can specify a selection by passing in a comma-separated list of Automation IDs as the value of the query string parameter automation_ids.

Responses are paginated. You can limit the number of responses returned per batch using the page_size query string parameter. The default is 25, but you can specify a value between 1 and 50.

You can retrieve a specific page of responses with the page_token query string parameter.


Authentication

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

This endpoint returns all automation IDs if no automation_ids are specified.


page_sizeintegerOptional

The number of elements you want returned on each page.

Minimum: 1Maximum: 50Default: 25

page_tokenstringOptional

The stats endpoints are paginated. To get the next page, call the passed _metadata.next URL. If _metadata.prev doesn't exist, you're at the first page. Similarly, if _metadata.next is not present, you're at the last page.

200400
Schema
Property nameTypeRequiredDescriptionChild properties
resultsarray[object]

_metadataobject

Get All Automation Stats

get-all-automation-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
"page_size": 25
_21
};
_21
_21
const request = {
_21
url: `/v3/marketing/stats/automations`,
_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: