Skip to main content
GET
/
metrics
/
recipient-behaviour
Retrieve Recipient Behaviour Metrics
curl --request GET \
  --url https://api.mailchannels.net/tx/v1/metrics/recipient-behaviour \
  --header 'X-Api-Key: <x-api-key>'
{
  "buckets": {
    "unsubscribe_delivered": [
      {
        "count": 1,
        "period_start": "2023-11-07T05:31:56Z"
      }
    ],
    "unsubscribed": [
      {
        "count": 1,
        "period_start": "2023-11-07T05:31:56Z"
      }
    ]
  },
  "unsubscribe_delivered": 1,
  "unsubscribed": 1,
  "end_time": "2023-11-07T05:31:56Z",
  "start_time": "2023-11-07T05:31:56Z"
}

Headers

X-Api-Key
string
required

Query Parameters

start_time
string

The beginning of the time range for retrieving recipient behaviour metrics (inclusive). Formats: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ. Defaults to one month ago if not provided.

end_time
string

The end of the time range for retrieving recipient behaviour metrics (exclusive). Formats: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ. Defaults to the current time if not provided.

campaign_id
string

The ID of the campaign to filter metrics by. If not provided, metrics for all campaigns will be returned.

interval
enum<string>
default:day

The interval for aggregating metrics data. Allowed values:

  • hour: Hourly breakdown
  • day: Daily breakdown (default)
  • week: Weekly breakdown
  • month: Monthly breakdown
Available options:
hour,
day,
week,
month

Response

Successfully retrieved recipient behaviour metrics

buckets
object
required

A series of metrics aggregations bucketed by time interval (e.g. hour, day)

unsubscribe_delivered
integer
required

Count of recipients of delivered messages that include at least one of the unsubscribe link or unsubscribe headers. Since the unsubscribe feature requires exactly one recipient per message, this count also represents the total number of delivered messages.

Required range: x >= 0
unsubscribed
integer
required

Count of unsubscribed events by recipients.

Required range: x >= 0
end_time
string<date-time>

The end of the time range for retrieving recipient behaviour metrics (exclusive).

start_time
string<date-time>

The beginning of the time range for retrieving recipient behaviour metrics (inclusive).