% of Messages with SLA Breaches

  • 15 November 2023
  • 4 replies

Is there any possibility to fetch the messages (not conversation) which has respond time more than 48 hours (example). The purpose of this to fetch the messages respond which has breached pre-defined SLAs (which in our case is 48 hours).


So, what I am thinking is to fetch number of messages sent in a specific time period and then fetch the messages with respond time more than 48 hours.


The below code (API Endpoint) can be used to fetch number of messages sent:

import requests

url = ""

payload = { "metrics": ["num_messages_sent"] }

headers = {

    "accept": "application/json",

    "content-type": "application/json",

    "authorization": "Bearer <Token>"


response =, json=payload, headers=headers)



But how can I fetch messages with respond time more than 48 hours ?

If there is better approach to perform same task, feel free to mention ?



Best answer by justin 15 November 2023, 20:13

View original

4 replies

Userlevel 2
Badge +5


Justin here with the support engineering team 👋

By creating an analytics export and providing “messages” as the “type” value, you will receive a link to fetch the report

In the report payload, you will see a URL for a CSV. This will provide all messages within the timeframe set for the analytics report, plus any applicable filters. These message rows will contain a response time value that should help you determine if the message is greater than 48 hours. 

From there you can implement the logic needed on your end to count these messages and determine the metric. 

Hi Justin,


Thanks, it’s really a great solution.


Just to go further for automation of whole process. In this solution, I can get CSV file containing all the information. Once I get the CSV file, then the manual work need to be done which will involve opening the CSV file, implementing the filter for response time more than 48 hours, and then fetch the value. Well is there a way to automate the process via Front APIs or something else ?

Userlevel 2
Badge +5

Since response time is found in analytics, this would still be my best recommendation on how to obtain this custom metric with the current API endpoints. It is the most direct approach at the message level that will allow you to add in additional filters for the report such as timeframe, tags, inboxes, etc. 

If the concern is around automation, there are methods in which you can write scripts to read and extract values from a csv file. While we do not have the resources to provide here, however, there are several resources online that pertain to the topic that may help you in automating this further. 

Hopefully this helps provide further clarity and gets you moving in the right direction!

Thanks Justin, one last thing. I fetched the report. After seeing the reports I have few questions which are below:

  • Is the Response time in seconds ?
  • There are many sent messages which does not have any “Response Time”. Just for clarification, are these messages which initiated the conversion instead of response to current mail ?