curl --request GET \
--url https://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/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://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/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://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/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://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/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{
"trigger": "rule:checkout-5xx",
"sessions": 123,
"last_at": "<string>",
"all_sessions": 123,
"crashed": 123,
"abnormal_exit": 123,
"days": [
{
"day": "<string>",
"sessions": 123,
"all_sessions": 123
}
],
"retention_days": 90
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}A rule's sessions
curl --request GET \
--url https://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/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://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/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://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/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://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/rules/{ruleId}/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{
"trigger": "rule:checkout-5xx",
"sessions": 123,
"last_at": "<string>",
"all_sessions": 123,
"crashed": 123,
"abnormal_exit": 123,
"days": [
{
"day": "<string>",
"sessions": 123,
"all_sessions": 123
}
],
"retention_days": 90
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}Authorizations
A project token (apsio_pt_v0...), which reads exactly one project, or an OAuth access token issued for the API, which reads what its user can. Access tokens issued for Apsio's MCP server are accepted only from the MCP server itself.
Path Parameters
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"0192f3a4-0000-7000-8000-00000000a101"
The rule's id in the app's policy (spec 15.8).
^[a-z0-9._-]{1,64}$"checkout-5xx"
Query Parameters
Start of the time range, inclusive (RFC 3339). Defaults to the range end minus the default length.
"2026-10-01T00:00:00Z"
End of the time range, exclusive (RFC 3339). Defaults to now.
"2026-10-08T00:00:00Z"
The app whose policy defines the rules: the same id in two apps is two rules.
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Response
The rule's sessions.
"rule:checkout-5xx"
When the newest session in the range in which the rule fired started; null when it fired in none.
Of the sessions in which the rule fired, those that crashed.
Of the sessions in which the rule fired, those that ended abnormally.
Show child attributes
Show child attributes
How many days of crashes and release health the project's plan keeps (D94). Nothing older is returned, whatever the time range.
90