To access all the latest features and upcoming developments, please see our v3 API.
Subuser Statistics
Retrieve daily statistics for a subuser.
The days
argument and the start_date
/end_date
arguments are exclusive from each other.
URI Parameter | Required | Requirements | Description |
---|---|---|---|
user | Yes | Subuser must be under your account | Subuser to retrieve statistics from |
days | No | Unsigned Integer | Number of days in the past to include statistics (includes today) |
start_date | No | Date must be in YYY-mm-dd format and be before the end_date parameter | Beginning of date range |
end_date | No | Date must be in YYY-mm-dd format and be after the start_date parameter | End of date range |
POST | https://api.sendgrid.com/apiv2/customer.stats.json |
---|---|
POST Data | api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username |
_19[_19 {_19 "date": "2014-11-27",_19 "requests": 0,_19 "delivered": 0,_19 "bounces": 0,_19 "repeat_bounces": 0,_19 "unsubscribes": 0,_19 "repeat_unsubscribes": 0,_19 "clicks": 0,_19 "opens": 0,_19 "spamreports": 0,_19 "repeat_spamreports": 0,_19 "invalid_email": 0,_19 "blocks": 0,_19 "unique_clicks": 0,_19 "unique_opens": 0_19 }_19]
Retrieve lifetime total statistics for a subuser.
URI Parameter | Required | Requirements | Description |
---|---|---|---|
user | Yes | Subuser must be under your account | Subuser to retrieve statistics from |
aggregate | Yes | Must be set to 1 | argument to provide total statistics instead of daily |
Category statistics are available for the previous thirteen months only.
Retrieve a list of all the categories used by a subuser.
URI Parameter | Required | Requirements | Description |
---|---|---|---|
user | Yes | Subuser must be under your account | Subuser to pull categories from |
list | Yes | The value must be set to true | Task to retrieve list of categories |
Retrieve statistics broken down by category. If the category does not exist, it will return an empty result set.
The days
argument and the start_date
/end_date
arguments are exclusive from each other.
URI Parameter | Required | Requirements | Description |
---|---|---|---|
user | Yes | Subuser must be under your account | Subuser to retrieve statistics from |
category | Yes | Existing category on the account | Category to retrieve statistics from |
days | No | Unsigned Integer | Number of days in the past to include statistics (includes today) |
start_date | No | Date must be in YYY-mm-dd format and be before the end_date parameter | Beginning of date range |
end_date | No | Date must be in YYY-mm-dd format and be after the start_date parameter | End of date range |
POST | https://api.sendgrid.com/apiv2/customer.stats.json |
---|---|
POST Data | api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&category=categoryA |
_11[_11 {_11 "date": "2009-06-20",_11 "category": "categoryA",_11 "requests": 12342,_11 "bounces": 12,_11 "clicks": 10223,_11 "opens": 9992,_11 "spamreports": 5_11 }_11]
When retrieving statistics for more than one category, use an array category argument.
POST | https://api.sendgrid.com/apiv2/customer.stats.json |
---|---|
POST Data | api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&category[]=categoryA&category[]=categoryB |
_20[_20 {_20 "date": "2009-06-20",_20 "category": "categoryA",_20 "requests": 12342,_20 "bounces": 12,_20 "clicks": 10223,_20 "opens": 9992,_20 "spamreports": 5_20 },_20 {_20 "date": "2009-06-21",_20 "category": "categoryB",_20 "requests": 32342,_20 "bounces": 10,_20 "clicks": 14323,_20 "opens": 10995,_20 "spamreports": 7_20 }_20]