curl --request GET \
--url https://api.1club.ai/v1/platform/reports/at-risk \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.1club.ai/v1/platform/reports/at-risk"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.1club.ai/v1/platform/reports/at-risk', 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://api.1club.ai/v1/platform/reports/at-risk",
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://api.1club.ai/v1/platform/reports/at-risk"
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://api.1club.ai/v1/platform/reports/at-risk")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/reports/at-risk")
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{
"asOf": "2023-12-25",
"totals": {
"people": 123,
"monthlyValue": 123
},
"thresholds": {
"atRiskDays": 123,
"decliningMinPrevious": 123,
"decliningMaxPercent": 123,
"periodDays": 123
},
"tags": [
{
"signal": "at_risk",
"name": "<string>",
"color": "<string>"
}
],
"signals": {
"at_risk": true,
"declining": true
},
"rowsScope": "contacts:read",
"total": 123,
"limit": 123,
"offset": 123,
"rows": [
{
"contactId": 123,
"name": "<string>",
"email": "<string>",
"signals": [
"at_risk"
],
"lastVisitDay": "2023-12-25",
"visitsThisPeriod": 123,
"visitsPreviousPeriod": 123,
"planName": "<string>",
"planKind": "<string>",
"monthlyValue": 123,
"taggedAt": "2023-11-07T05:31:56Z",
"taggedDay": "2023-12-25"
}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Who is at risk of leaving
The admin’s Members › At-risk customers report: the Billable Members the organization’s At Risk and Declining smart tags apply to today, with when they last came, their visits in the last period and the one before, their plan and what it is worth a month (ex-tax), and when they were tagged. The tags are read, never recomputed: the thresholds are the organization’s own smart tag rules, returned with the report. There is no period: it is today’s list.
Readable with analytics:read. The people need contacts:read as well: without it rows and total are null and the figures come alone, as get_members_report answers its lifecycle; rowsScope names the scope. Paged with limit and offset. Reports have their own limit of 20 requests a minute, on top of the platform’s.
curl --request GET \
--url https://api.1club.ai/v1/platform/reports/at-risk \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.1club.ai/v1/platform/reports/at-risk"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.1club.ai/v1/platform/reports/at-risk', 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://api.1club.ai/v1/platform/reports/at-risk",
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://api.1club.ai/v1/platform/reports/at-risk"
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://api.1club.ai/v1/platform/reports/at-risk")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/reports/at-risk")
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{
"asOf": "2023-12-25",
"totals": {
"people": 123,
"monthlyValue": 123
},
"thresholds": {
"atRiskDays": 123,
"decliningMinPrevious": 123,
"decliningMaxPercent": 123,
"periodDays": 123
},
"tags": [
{
"signal": "at_risk",
"name": "<string>",
"color": "<string>"
}
],
"signals": {
"at_risk": true,
"declining": true
},
"rowsScope": "contacts:read",
"total": 123,
"limit": 123,
"offset": 123,
"rows": [
{
"contactId": 123,
"name": "<string>",
"email": "<string>",
"signals": [
"at_risk"
],
"lastVisitDay": "2023-12-25",
"visitsThisPeriod": 123,
"visitsPreviousPeriod": 123,
"planName": "<string>",
"planKind": "<string>",
"monthlyValue": 123,
"taggedAt": "2023-11-07T05:31:56Z",
"taggedDay": "2023-12-25"
}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Query Parameters
Response
The report, with a page of its people
Was this page helpful?