Refresh Health
curl --request POST \
--url https://api.example.com/deals/{deal_id}/health/refresh \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/deals/{deal_id}/health/refresh"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/deals/{deal_id}/health/refresh', 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.example.com/deals/{deal_id}/health/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.example.com/deals/{deal_id}/health/refresh"
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/deals/{deal_id}/health/refresh")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/deals/{deal_id}/health/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Deals
Refresh Health Score
POST
/
deals
/
{deal_id}
/
health
/
refresh
Refresh Health
curl --request POST \
--url https://api.example.com/deals/{deal_id}/health/refresh \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/deals/{deal_id}/health/refresh"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/deals/{deal_id}/health/refresh', 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.example.com/deals/{deal_id}/health/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.example.com/deals/{deal_id}/health/refresh"
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/deals/{deal_id}/health/refresh")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/deals/{deal_id}/health/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}No feature flag — always available, unlike the other AI-generation endpoints on this router.
Synchronous and purely rule-based, no LLM involved. Applies a base-50-point, 10-factor model to the deal (champion seniority, communication recency, recent meetings, email activity, stakeholder-role coverage, contact count, stage velocity, close-date proximity, task status, and a keyword-based buying-intent/silence scan), clamped to 0–100. Looks up the org’s connected calendar/email integrations first so it doesn’t penalize meeting/email factors it has no way to measure, and classifies a trend by comparing the new score against the deal’s current denormalized
deals.health_score — i.e. whatever the last refresh wrote, however long ago that was, not a fixed lookback (a swing of more than 3 points is improving/declining; otherwise stable, as it is when the deal has no score yet). Inserts a new snapshot (deal_health_scores + deal_health_factors) and updates the denormalized deals.health_score.
Auth
Requires a CRM manage scope and an active organization on the token. Any*:manage scope qualifies — in practice contacts:manage, deals:manage, companies:manage, or activities:manage.
Response
| Field | Type | Description |
|---|---|---|
score | integer | 0–100. |
trend | string | improving | stable | declining. |
factors | array | 10 rows: {factor_name, score, max_score, status, evidence}. status is good (delta > 5), neutral, or critical (delta <= -5). |
prev_score | integer | null | Score from ~7 days ago, if any. Informational only — trend is not computed from it. |
snapshot_id | string | New deal_health_scores.id. |