Skip to main content
GET
/
email-meter
/
stats
/
clients
/
lowest-resolved
/
{startDate}
/
{endDate}
Get clients with the lowest resolved conversations
curl --request GET \
  --url http://localhost:2000/email-meter/stats/clients/lowest-resolved/{startDate}/{endDate} \
  --header 'Authorization: Bearer <token>'
import requests

url = "http://localhost:2000/email-meter/stats/clients/lowest-resolved/{startDate}/{endDate}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('http://localhost:2000/email-meter/stats/clients/lowest-resolved/{startDate}/{endDate}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_PORT => "2000",
  CURLOPT_URL => "http://localhost:2000/email-meter/stats/clients/lowest-resolved/{startDate}/{endDate}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:2000/email-meter/stats/clients/lowest-resolved/{startDate}/{endDate}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("http://localhost:2000/email-meter/stats/clients/lowest-resolved/{startDate}/{endDate}")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:2000/email-meter/stats/clients/lowest-resolved/{startDate}/{endDate}")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "message": "",
  "data": {
    "clientsByLowestResolved": [
      {
        "domain": "example.com",
        "count": 15
      },
      {
        "domain": "client.org",
        "count": 12
      },
      {
        "domain": "mail.com",
        "count": 8
      }
    ]
  }
}
Returns the top 3 client domains that have the highest number of unresolved conversations within the given date range. A conversation is considered unresolved if it does not contain a resolved category.

Request

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token

Path Parameters

ParameterTypeRequiredDescription
startDatestringYesStart date for the range (YYYY-MM-DD)
endDatestringYesEnd date for the range (YYYY-MM-DD)

Parameter Format

  • Format: YYYY-MM-DD (ISO 8601 date)
  • Timezone: UTC
  • Default: Last 7 days if not provided

Response

200 OK - Successfully retrieved clients with lowest resolved conversations

{
  "message": "",
  "data": {
    "clientsByLowestResolved": [
      {
        "domain": "example.com",
        "count": 15
      },
      {
        "domain": "client.org",
        "count": 12
      },
      {
        "domain": "mail.com",
        "count": 8
      }
    ]
  }
}

400 Bad Request

{
  "error": {
    "code": "INVALID_DATE_RANGE",
    "message": "Invalid date range or bad request"
  }
}

401 Unauthorized

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing or invalid token"
  }
}

500 Internal Server Error

{
  "error": {
    "code": "SERVER_ERROR",
    "message": "Internal server error"
  }
}

Example

curl -X GET 'http://localhost:2000/email-meter/stats/clients/lowest-resolved/2025-10-01/2025-10-20' \
  -H 'Authorization: oBearerbearer your-jwt-token'

Data Fields Explained

Clients by Lowest Resolved Array

FieldTypeDescription
domainstringThe client’s email domain
countintegerNumber of unresolved conversations

Use Cases

  • Problem Identification: Identify clients with resolution issues
  • Service Improvement: Target improvements for specific domains
  • Quality Assurance: Monitor resolution quality by client
  • Relationship Management: Address client-specific issues
  • Process Optimization: Identify patterns in unresolved conversations

Analysis Examples

Resolution Rate Calculation

const calculateResolutionRate = (unresolvedData, totalData) => {
  return unresolvedData.clientsByLowestResolved.map(client => {
    const totalClient = totalData.topClients.find(c => c.domain === client.domain);
    const totalConversations = totalClient ? totalClient.count : 0;
    const resolutionRate = totalConversations > 0 ? 
      ((totalConversations - client.count) / totalConversations) * 100 : 0;
    
    return {
      domain: client.domain,
      unresolved: client.count,
      total: totalConversations,
      resolutionRate: resolutionRate.toFixed(2)
    };
  });
};

Trend Monitoring

const monitorUnresolvedTrends = (currentData, previousData) => {
  return currentData.clientsByLowestResolved.map(client => {
    const previousClient = previousData.clientsByLowestResolved.find(c => c.domain === client.domain);
    const previousCount = previousClient ? previousClient.count : 0;
    const trend = client.count > previousCount ? 'worsening' : 
                  client.count < previousCount ? 'improving' : 'stable';
    const change = client.count - previousCount;
    
    return {
      ...client,
      previousCount,
      change,
      trend
    };
  });
};

Best Practices

  1. Regular Monitoring: Track unresolved conversations weekly
  2. Root Cause Analysis: Investigate why certain domains have more unresolved issues
  3. Client Communication: Proactively address issues with problematic domains
  4. Process Review: Review resolution processes for specific client types
  5. Performance Tracking: Monitor improvement over time
  • Use /email-meter/stats/clients/top-domains for overall domain volume
  • Use /email-meter/stats/clients/response-times for domain performance metrics
  • Use /email-meter/stats/resolved-times for overall resolution analysis

Notes

  • Only domains with unresolved conversations are included
  • Unresolved conversations are those without resolved status
  • Data helps identify clients needing special attention
  • Results are sorted by highest unresolved count first
  • Limited to top 3 to focus on most critical issues

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

startDate
string<date>
required

Start date for the range (YYYY-MM-DD)

endDate
string<date>
required

End date for the range (YYYY-MM-DD)

Response

Successfully retrieved clients with lowest resolved conversations

message
string
Example:

""

data
object