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 /v3/marketing/stats/automations/{id}
Base url: https://api.sendgrid.com
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
Path Parameters
The ID of the Event Webhook you want to retrieve.
default: NoneQuery String
Automations can have multiple steps. Including step_id
as a group_by
metric allows further granularity of stats.
Comma-separated list of step_ids
that you want the link stats for.
Dictates how the stats are time-sliced. Currently, "total"
and "day"
are supported.
Format: YYYY-MM-DD
. If this parameter is included, the stats' start date is included in the search.
Format: YYYY-MM-DD
.If this parameter is included, the stats' end date is included in the search.
IANA Area/Region string representing the timezone in which the stats are to be presented, e.g., "America/Chicago".
default: UTCThe number of elements you want returned on each page.
default: 50The 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.
Responses
This is the ID of the Automation you are requesting stats for.
format: uuidThis 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.
This is the ID of the step if the stats were requested to be grouped by step_id
.
The URL of the previous page of results. If this field isn't present, you're at the start of the list.
format: uriThe URL of the current page of results.
format: uriThe URL of the next page of results. If this field isn't present, you're at the end of the list.
format: uriThe number of items in the entire list, i.e., across all pages.
the error message
the field that generated the error
helper text or docs for troubleshooting
{
"errors": [
{
"field": "field_name",
"message": "error message"
}
]
}
Need some help?
We all do sometimes. Get help now from the Twilio SendGrid Support Team.
Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.