Analytics

With these requests, get analytics on the activity of your emails like open rate, CTR, bounce rate, and other data for a dedicated list of recipients, domain names, or even tags.

Activity data by date

Retrieve data grouped by date, based on activity, with this GET request:

GET https://api.mailersend.com/v1/analytics/date
1

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
recipient_id[]stringnoMax number of recipients: 50 TBDNot yet implemented
date_fromintyesTimestamp is assumed to be UTC. Must be lower than date_to.Format: 1443651141
date_tointyesTimestamp is assumed to be UTC. Must be higher than date_from.Format: 1443661141
group_bystringnoPossible options: days, weeks, months, yearsDefault: days
tags[]string[]no
event[]string[]yesPossible events: processed,queued,sent,delivered,soft_bounced,
hard_bounced,junk,opened,clicked,unsubscribed,
spam_complaints

Responses

Response keyTypeDetails
data.stats.*.datetimestampThe date will be at the start of the group_by unit (so start of day/week/month/year). Every date in the date range will be present, even if there are no events for that day.
data.stats.*.[event]intEvery queried event[] will be present in the response with a default value - 0

Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
1
2
3
{
  "data": {
    "date_from": "1591228800",
    "date_to": "1591401599",
    "group_by": "days",
    "stats": [
      {
        "date": "1591228800",
        "processed": 0,
        "queued": 0,
        "sent": 0,
        "delivered": 0,
        "soft_bounced": 0,
        "hard_bounced": 0,
        "junk": 0,
        "opened": 0,
        "clicked": 0,
        "unsubscribed": 0,
        "spam_complaints": 0
      },
      {
        "date": "1591315200",
        "processed": 2,
        "queued": 2,
        "sent": 2,
        "delivered": 2,
        "soft_bounced": 2,
        "hard_bounced": 2,
        "junk": 2,
        "opened": 2,
        "clicked": 2,
        "unsubscribed": 2,
        "spam_complaints": 2
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

Error

Response Code: 422 Unprocessable Entity
1

See - Validation errors

Opens by country

Retrieve data grouped by country, based on activity, with this GET request:

GET https://api.mailersend.com/v1/analytics/country
1

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
recipient_id[]stringnoMax number of recipients: 50 TBDNot yet implemented
date_fromintyesTimestamp is assumed to be UTC. Must be lower than date_to.Format: 1443651141
date_tointyesTimestamp is assumed to be UTC. Must be higher than date_from.Format: 1443661141
tags[]string[]no

Responses

Response keyTypeDetails
data.stats.*.namestring2 Letter code of the country.open in new window Will not be present if there's no data.
data.stats.*.countint

Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
1
2
3
{
  "data": {
    "date_from": 1591228800,
    "date_to": 1591401599,
    "stats": [
      {
        "name": "LT",
        "count": 2
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12

Error

Response Code: 422 Unprocessable Entity
1

See - Validation errors

Opens by user-agent name

Retrieve data grouped by user-agent name (browser and operating system), based on activity, with this GET request:

GET https://api.mailersend.com/v1/analytics/ua-name
1

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
recipient_id[]stringnoMax number of recipients: 50 TBDNot yet implemented
date_fromintyesTimestamp is assumed to be UTC. Must be lower than date_to.Format: 1443651141
date_tointyesTimestamp is assumed to be UTC. Must be higher than date_from.Format: 1443661141
tags[]string[]no

Responses

Response keyTypeDetails
data.stats.*.namestringUser Agent Name. Will not be present if there's no data.
data.stats.*.countint

Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
1
2
3
{
  "data": {
    "date_from": 1591228800,
    "date_to": 1591401599,
    "stats": [
      {
        "name": "Chrome",
        "count": 2
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12

Error

Response Code: 422 Unprocessable Entity
1

See - Validation errors

Opens by reading environment

Retrieve data grouped by the reading environment (webmail, mobile, desktop), based on activity, with this GET request:

GET https://api.mailersend.com/v1/analytics/ua-type
1

Request parameters

Query parameterTypeRequiredLimitationsDetails
domain_idstringno
recipient_id[]stringnoMax number of recipients: 50 TBDNot yet implemented
date_fromintyesTimestamp is assumed to be UTC. Must be lower than date_to.Format: 1443651141
date_tointyesTimestamp is assumed to be UTC. Must be higher than date_from.Format: 1443661141
tags[]string[]no

Responses

Response keyTypeDetails
data.stats.*.namestringOne of webmail, mobile,desktop. Will not be present if there's no data.
data.stats.*.countint

Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
1
2
3
{
  "data": {
    "date_from": 1591228800,
    "date_to": 1591401599,
    "stats": [
      {
        "name": "webmail",
        "count": 2
      },
      {
        "name": "mobile",
        "count": 2
      },
      {
        "name": "desktop",
        "count": 2
      }
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Error

Response Code: 422 Unprocessable Entity
1

See - Validation errors

Last Updated: