Analytics
Get Dunning Timing Insights
Historical retry success rates by hour of day and day of week, with the best-performing slots.
GET
/
v1
/
analytics
/
dunning
/
timing
Best-time-to-retry insights
curl --request GET \
--url https://billing.example.com/v1/analytics/dunning/timing \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/analytics/dunning/timing"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/analytics/dunning/timing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/analytics/dunning/timing",
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 := "https://billing.example.com/v1/analytics/dunning/timing"
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("https://billing.example.com/v1/analytics/dunning/timing")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/analytics/dunning/timing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"by_hour": [
{
"bucket": 123,
"total": 123,
"successes": 123,
"success_rate": 123
}
],
"by_day_of_week": [
{
"bucket": 123,
"total": 123,
"successes": 123,
"success_rate": 123
}
],
"best_hour": 123,
"best_day": 123,
"sample_size": 123
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Returns historical retry success rates by hour-of-day (0–23) and day-of-week (0–6, Sunday = 0), in UTC, plus the best-performing hour and day among buckets with enough samples. This endpoint is read-only — it reports what history shows and does not change the live retry scheduler. Responses are cached for up to 5 minutes.
Example Request
curl "https://api.recurso.dev/v1/analytics/dunning/timing" \
-H "Authorization: Bearer $API_KEY"
Response
{
"data": {
"by_hour": [
{ "bucket": 9, "total": 112, "successes": 81, "success_rate": 0.723 },
{ "bucket": 14, "total": 96, "successes": 60, "success_rate": 0.625 },
{ "bucket": 22, "total": 41, "successes": 19, "success_rate": 0.463 }
],
"by_day_of_week": [
{ "bucket": 1, "total": 203, "successes": 142, "success_rate": 0.7 },
{ "bucket": 5, "total": 168, "successes": 99, "success_rate": 0.589 }
],
"best_hour": 9,
"best_day": 1,
"sample_size": 1247
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
by_hour[] | array | One entry per hour bucket: bucket (0–23, UTC), total attempts, successes, success_rate |
by_day_of_week[] | array | One entry per day bucket: bucket (0–6, Sunday = 0, UTC), total, successes, success_rate |
best_hour | integer | null | Best-performing hour among buckets with enough samples; null when there is not enough data |
best_day | integer | null | Best-performing day of week among buckets with enough samples; null when there is not enough data |
sample_size | integer | Total retry attempts the insights are computed from |
See the dunning overview and dunning weights endpoints for what the retry system is doing and learning right now.
⌘I
Best-time-to-retry insights
curl --request GET \
--url https://billing.example.com/v1/analytics/dunning/timing \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/analytics/dunning/timing"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/analytics/dunning/timing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/analytics/dunning/timing",
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 := "https://billing.example.com/v1/analytics/dunning/timing"
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("https://billing.example.com/v1/analytics/dunning/timing")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/analytics/dunning/timing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"by_hour": [
{
"bucket": 123,
"total": 123,
"successes": 123,
"success_rate": 123
}
],
"by_day_of_week": [
{
"bucket": 123,
"total": 123,
"successes": 123,
"success_rate": 123
}
],
"best_hour": 123,
"best_day": 123,
"sample_size": 123
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}