provider Marketing Campaigns Stats GET /marketing/stats/automations/{id}
@utdk/sendgrid /marketing/stats/automations/{id}
Get Automation Stats by 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.
id path required
string
group_by query
Automations can have multiple steps. Including `step_id` as a `group_by` metric allows further granularity of stats.
array
step_ids query
Comma-separated list of `step_ids` that you want the link stats for.
array
aggregated_by query
Dictates how the stats are time-sliced. Currently, `"total"` and `"day"` are supported.
enum: day, total
start_date query
Format: `YYYY-MM-DD`. If this parameter is included, the stats' start date is included in the search.
string
end_date query
Format: `YYYY-MM-DD`.If this parameter is included, the stats' end date is included in the search.
string
timezone query
[IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones) string representing the timezone in which the stats are to be presented, e.g., "America/Chicago".
string
page_size query
The number of elements you want returned on each page.
integer
page_token query
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.
string

Try it

Authentication
Configure credentials for Email Activity (beta)
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

getAutomationStat
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.

Parameters

required

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](https://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones) string representing the timezone in which the stats are to be presented, e.g., "America/Chicago".

The number of elements you want returned on each page.

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.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import sendgrid from '@utdk/sendgrid';

await sendgrid.getAutomationStat({
  "aggregated_by": "total",
  "timezone": "UTC",
  "page_size": 50
})