provider Stats GET /devices/stats
@utdk/sendgrid /devices/stats
Retrieve email statistics by device type.
**This endpoint allows you to retrieve your email statistics segmented by the device type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ## Available Device Types | **Device** | **Description** | **Example** | |---|---|---| | Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | | Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | | Phone | A smart phone. | iPhone, Android, Blackberry, etc. | Tablet | A tablet computer. | iPad, android based tablet, etc. | | Other | An unrecognized device. | Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/).
on-behalf-of header
string
limit query
The number of results to return.
integer
offset query
The point in the list to begin retrieving results.
integer
aggregated_by query
How to group the statistics. Must be either "day", "week", or "month".
enum: day, week, month
start_date query required
The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.
string
end_date query
The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.
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.

getDevicesStats
GET/devices/stats
**This endpoint allows you to retrieve your email statistics segmented by the device type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ## Available Device Types | **Device** | **Description** | **Example** | |---|---|---| | Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | | Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | | Phone | A smart phone. | iPhone, Android, Blackberry, etc. | Tablet | A tablet computer. | iPad, android based tablet, etc. | | Other | An unrecognized device. | Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/).

The number of results to return.

The point in the list to begin retrieving results.

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

required

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

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

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.getDevicesStats({
  "on-behalf-of": "The subuser's username. This header generates the API call as if the subuser account was making the call."
})