provider Stats GET
/stats @utdk/sendgrid
/stats Retrieve global email statistics
**This endpoint allows you to retrieve all of your global email statistics between a given date range.**
Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats.
- 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.
Code snippet
Updates live as you fill in the form above.
TypeScript
import sendgrid from '@utdk/sendgrid';
await sendgrid.getStats({
"on-behalf-of": "The subuser's username. This header generates the API call as if the subuser account was making the call."
})