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.
Operation overview
GET/v3/marketing/stats/singlesends
Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)
This endpoint allows you to retrieve stats for all your Single Sends.
By default, all of your Single Sends will be returned, but you can specify a selection by passing in a comma-separated list of Single Send IDs as the value of the query string parameter singlesend_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 specify a value between 1 and 50.
You can retrieve a specific page of responses with the page_token query string parameter.
Operation details
Authentication
Headers
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Query string
Property nameTypeRequiredDescription
singlesend_idsarray[string]
Optional
This endpoint returns all Single Send IDs if no IDs are included in singlesend_ids.
page_sizeinteger
Optional
The number of elements you want returned on each page.
Minimum: 1Maximum: 50Default: 25
page_tokenstring
Optional
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.
This is the ID of the Single Send you require stats for.
ab_variationstring<uuid>
This is the A/B variation of the Single Send stat returned. If the group_by parameter doesn't include ab_variation in the request, then the value is "all".
Default: a14dcc63-d651-4c57-9826-4a3705f5c78d
ab_phaseenum<string>
This is the A/B phase of the Single Send stat returned. If the group_by parameter doesn't include ab_phase in the request, then the value is "all".
Default: allPossible values:
sendtestall
aggregationstring
This describes the time unit to which the stat is rolled up. It is based on the aggregated_by parameter included in the request. It can be "total" or the date (in YYYY-MM-DD format) the stats are for.