cURL
curl -X GET "https://app.cotool.ai/api/detections/:id/stats" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"import requests
url = "https://app.cotool.ai/api/detections/{id}/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cotool.ai/api/detections/{id}/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://app.cotool.ai/api/detections/{id}/stats")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/detections/{id}/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))
}{
"runsLast7d": 1,
"runsLast30d": 1,
"runningRunsLast30d": 1,
"hitsLast30d": 1,
"avgEvalScore30d": 123
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Detections
Get detection stats
Return rolling 7d/30d run, hit, and eval-score aggregates for a detection agent. Uses the same detection_hits-table aggregation as the agent list view so the KPI numbers shown on the detail page match the list page.
GET
/
api
/
detections
/
{id}
/
stats
cURL
curl -X GET "https://app.cotool.ai/api/detections/:id/stats" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"import requests
url = "https://app.cotool.ai/api/detections/{id}/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cotool.ai/api/detections/{id}/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://app.cotool.ai/api/detections/{id}/stats")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/detections/{id}/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))
}{
"runsLast7d": 1,
"runsLast30d": 1,
"runningRunsLast30d": 1,
"hitsLast30d": 1,
"avgEvalScore30d": 123
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Authorizations
API Key authentication for programmatic access. Include your API key in the Authorization header as: Bearer your_api_key_here
Path Parameters
Detection UUID
Response
Successful response
Total completed runs in the last 7 days
Required range:
x >= 0Total completed runs in the last 30 days
Required range:
x >= 0Active runs in the last 30 days (running or waiting)
Required range:
x >= 0Persisted detection hits in the last 30 days
Required range:
x >= 0Average LLM judge eval score (0-100) over last 30 days; null when no scored runs
Was this page helpful?
⌘I