Cancel Flows
Get Cancel Flow Statistics
Aggregated session outcomes for one cancel flow — save rate, reason breakdown, offer acceptance.
GET
/
v1
/
cancel-flows
/
stats
Cancel flow analytics
curl --request GET \
--url https://billing.example.com/v1/cancel-flows/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/cancel-flows/stats"
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/cancel-flows/stats', 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/cancel-flows/stats",
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/cancel-flows/stats"
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/cancel-flows/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/cancel-flows/stats")
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{
"total_sessions": 123,
"completed_count": 123,
"saved_count": 123,
"save_rate": 123,
"reason_breakdown": {},
"offer_accept_rate": 123
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
flow_id | string (uuid) | Yes | The cancel flow to aggregate. Omitting it returns 400. |
Example Request
curl "https://api.recurso.dev/v1/cancel-flows/stats?flow_id=1e6b3d84-9a2f-4c7e-b5d0-8f3a6c9e2b41" \
-H "Authorization: Bearer $API_KEY"
Response
{
"data": {
"total_sessions": 1842,
"completed_count": 1607,
"saved_count": 491,
"save_rate": 0.3055,
"offer_accept_rate": 0.2214,
"reason_breakdown": {
"too_expensive": 624,
"missing_features": 389,
"switching_competitor": 297,
"not_using": 185,
"other": 112
}
}
}
| Field | Description |
|---|---|
total_sessions | Sessions started on this flow. |
completed_count | Sessions that reached an outcome (canceled or saved). |
saved_count | Sessions where the customer accepted a retention offer and stayed. |
save_rate | saved_count / completed_count. |
offer_accept_rate | How often a presented retention offer was accepted. |
reason_breakdown | Session counts keyed by cancellation reason (too_expensive, not_using, switching_competitor, missing_features, technical_issues, customer_service, temporary_pause, other). |
Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Query Parameters
⌘I
Cancel flow analytics
curl --request GET \
--url https://billing.example.com/v1/cancel-flows/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/cancel-flows/stats"
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/cancel-flows/stats', 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/cancel-flows/stats",
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/cancel-flows/stats"
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/cancel-flows/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/cancel-flows/stats")
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{
"total_sessions": 123,
"completed_count": 123,
"saved_count": 123,
"save_rate": 123,
"reason_breakdown": {},
"offer_accept_rate": 123
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}