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 Automation Stats by ID

Get Automation Stats by ID

GET /marketing/stats/automations/{id}

This endpoint allows you to retrieve stats for a single Automation using its ID.

Multiple Automation IDs can be retrieved using the "Get All Automation Stats" endpoint. Once you have an ID, this endpoint will return detailed stats for the single automation specified.

You may constrain the stats returned using the start_date and end_date query string parameters. You can also use the group_by and aggregated_by query string parameters to further refine the stats returned.

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required

Path Parameters

id
string
default: None
required

Query String

group_by
array

A/B Single Sends have multiple variation IDs and phase IDs. Including these additional fields allows further granularity of stats by these fields.

default: None
step_ids
array

Comma-separated list of step_ids that you want the link stats for.

default: None
aggregated_by
string

How to group the statistics. Must be either "day", "week", or "month".

default: None
start_date
string

The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.

default: None
required
end_date
string

The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.

default: None
timezone
string

IANA Area/Region string representing the timezone in which the stats are to be presented, e.g., "America/Chicago".

default: UTC
page_size
integer

number of results to return

default: 100
page_token
string

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

default: None

Responses

object
results
array[object]
required
id
string

This is the ID of the Automation you are requesting stats for.

format: uuid
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
step_id
string

This is the ID of the step if the stats were requested to be grouped by step_id.

default: all
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
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 or null

the field that generated the error

help
object

helper text or docs for troubleshooting

id
string
{
  "errors": [
    {
      "field": "field_name",
      "message": "error message"
    }
  ]
}
No response body.
Rate this page:

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.

Thank you for your feedback!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more