# Analytics

# Get accumulated activity data by date

With this endpoint you can get accumulated data, grouped by date, based on activity.

# Request

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

# Request Parameters

Query Parameter Type Required Limitations Details
domain_id string no
recipient_id[] string no Max number of recipients: 50 TBD Not yet implemented
date_from int yes Timestamp is assumed to be UTC. Must be lower than date_to Format: 1443651141
date_to int yes Timestamp is assumed to be UTC. Must be higher than date_from Format: 1443661141
group_by string no Possible options: days, weeks, months, years Default: days
tag[] string[] no
search string no
event[] string[] yes Possible events: processed,queued,sent,delivered,soft_bounced,
hard_bounced,junk,opened,clicked,unsubscribed,
spam_complaints

# Responses

Response key Type Details
data.stats.*.date timestamp The 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] int Every queried event[] will be present in the response with a default value - 0

# Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
{
  "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
      }
    ]
  }
}

# Error

Response Code: 422 Unprocessable Entity

See - Validations Errors

# Get accumulated opens by country

With this endpoint you can get accumulated country data, based on activity.

# Request

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

# Request Parameters

Query Parameter Type Required Limitations Details
domain_id string no
recipient_id[] string no Max number of recipients: 50 TBD Not yet implemented
date_from int yes Timestamp is assumed to be UTC. Must be lower than date_to Format: 1443651141
date_to int yes Timestamp is assumed to be UTC. Must be higher than date_from Format: 1443661141
tag[] string[] no
search string no

# Responses

Response key Type Details
data.stats.*.name string 2 Letter code of the country. Will not be present if there's no data.
data.stats.*.count int

# Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
{
  "data": {
    "date_from": 1591228800,
    "date_to": 1591401599,
    "stats": [
      {
        "name": "LT",
        "count": 2
      }
    ]
  }
}

# Error

Response Code: 422 Unprocessable Entity

See - Validations Errors

# Get accumulated opens by user agent name

With this endpoint you can get accumulated user agent name data, based on activity.

# Request

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

# Request Parameters

Query Parameter Type Required Limitations Details
domain_id string no
recipient_id[] string no Max number of recipients: 50 TBD Not yet implemented
date_from int yes Timestamp is assumed to be UTC. Must be lower than date_to Format: 1443651141
date_to int yes Timestamp is assumed to be UTC. Must be higher than date_from Format: 1443661141
tag[] string[] no
search string no

# Responses

Response key Type Details
data.stats.*.name string User Agent Name. Will not be present if there's no data.
data.stats.*.count int

# Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
{
  "data": {
    "date_from": 1591228800,
    "date_to": 1591401599,
    "stats": [
      {
        "name": "Chrome",
        "count": 2
      }
    ]
  }
}

# Error

Response Code: 422 Unprocessable Entity

See - Validations Errors

# Get accumulated opens by reading environment

With this endpoint you can get accumulated user agent type data, based on activity.

# Request

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

# Request Parameters

Query Parameter Type Required Limitations Details
domain_id string no
recipient_id[] string no Max number of recipients: 50 TBD Not yet implemented
date_from int yes Timestamp is assumed to be UTC. Must be lower than date_to Format: 1443651141
date_to int yes Timestamp is assumed to be UTC. Must be higher than date_from Format: 1443661141
tag[] string[] no
search string no

# Responses

Response key Type Details
data.stats.*.name string One of webmail, mobile,desktop . Will not be present if there's no data.
data.stats.*.count int

# Valid

Response Code: 200 OK
Response Headers:
	Content-Type: application/json
{
  "data": {
    "date_from": 1591228800,
    "date_to": 1591401599,
    "stats": [
      {
        "name": "webmail",
        "count": 2
      },
      {
        "name": "mobile",
        "count": 2
      },
      {
        "name": "desktop",
        "count": 2
      }
    ]
  }
}

# Error

Response Code: 422 Unprocessable Entity

See - Validations Errors

Last Updated: 10/5/2020, 2:54:42 PM