Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Statistics


(warning)

This documentation is for the SendGrid Web API v2

To access all the latest features and upcoming developments, please see our v3 API.

Subuser Statistics


Retrieve Subuser Statistics

retrieve-subuser-statistics page anchor

Retrieve daily statistics for a subuser.

(information)

Info

The days argument and the start_date/end_date arguments are exclusive from each other.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to retrieve statistics from
daysNoUnsigned IntegerNumber of days in the past to include statistics (includes today)
start_dateNoDate must be in YYY-mm-dd format and be before the end_date parameterBeginning of date range
end_dateNoDate must be in YYY-mm-dd format and be after the start_date parameterEnd of date range
JSONXML

Call

POSThttps://api.sendgrid.com/apiv2/customer.stats.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username

Response


_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 Aggregate Statistics

retrieve-aggregate-statistics page anchor

Retrieve lifetime total statistics for a subuser.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to retrieve statistics from
aggregateYesMust be set to 1argument to provide total statistics instead of daily
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.stats.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&aggregate=1

_10
{
_10
"requests": "12342",
_10
"bounces": "12",
_10
"clicks": "10223",
_10
"opens": "9992",
_10
"spamreports": "5"
_10
}


(information)

Info

Category statistics are available for the previous thirteen months only.

Retrieve a list of all the categories used by a subuser.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to pull categories from
listYesThe value must be set to trueTask to retrieve list of categories
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.stats.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&list=true

_11
[
_11
{
_11
"category": "categoryA"
_11
},
_11
{
_11
"category": "categoryB"
_11
},
_11
{
_11
"category": "categoryC"
_11
}
_11
]


Retrieve statistics broken down by category. If the category does not exist, it will return an empty result set.

(information)

Info

The days argument and the start_date/end_date arguments are exclusive from each other.

URI ParameterRequiredRequirementsDescription
userYesSubuser must be under your accountSubuser to retrieve statistics from
categoryYesExisting category on the accountCategory to retrieve statistics from
daysNoUnsigned IntegerNumber of days in the past to include statistics (includes today)
start_dateNoDate must be in YYY-mm-dd format and be before the end_date parameterBeginning of date range
end_dateNoDate must be in YYY-mm-dd format and be after the start_date parameterEnd of date range
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.stats.json
POST Dataapi_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
]


Multiple Category Statistics

multiple-category-statistics page anchor

When retrieving statistics for more than one category, use an array category argument.

JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.stats.json
POST Dataapi_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
]


Rate this page: