Menu

Marketing Campaign Stats

The Marketing Campaigns Stats endpoints allow you to retrieve stats for both Automations and Single Sends.

Note: These endpoints provide stats for Marketing Campaigns only. For stats related to event tracking, please see the Stats section under Event Tracking below.

Get All Single Sends Stats

Get All Single Sends Stats

GET /marketing/stats/singlesends

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 50, but you specify a value between 1 and 100.

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

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required

Query String

singlesend_ids
array

This endpoint returns all Single Send IDs if no IDs are included in singlesend_ids.

maxItems: 25minItems: 1
page_size
integer

number of results to return

default: 100minimum: 0
page_token
string

token corresponding to a specific page of results, as provided by metadata

Responses

object
results
array[object]
required
id
string

This is the ID of the Single Dend you require stats for.

format: uuid
ab_variation
string

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: allformat: uuid
ab_phase
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: allAllowed Values: send, test, all
aggregation
string

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.

default: total
stats
object
bounce_drops
integer
required
bounces
integer
required
clicks
integer
required
delivered
integer
required
invalid_emails
integer
required
opens
integer
required
requests
integer
required
spam_report_drops
integer
required
spam_reports
integer
required
unique_clicks
integer
required
unique_opens
integer
required
unsubscribes
integer
required
_metadata
object
required
prev
string

The URL of the previous page of results. If this field isn't present, you're at the start of the list.

format: uri
self
string

The URL of the current page of results.

format: uri
next
string

The URL of the next page of results. If this field isn't present, you're at the end of the list.

format: uri
count
number

The number of items in the entire list, i.e., across all pages.

object
errors
array[object]
message
string

the error message

field
string

the field that generated the error

help
object

helper text or docs for troubleshooting

id
string
{
  "errors": [
    {
      "field": "field_name",
      "message": "error message"
    }
  ]
}

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the SendGrid tag on Stack Overflow.