Get the retention schedule
LogsGET /compliance/retention
Returns the tenant's data retention period for each record class (audit_logs, readings, invoices, sessions), with is_default showing whether the built-in period applies (365, 1825, 3650 and 90 days respectively). When the background sweep has run, each class also shows the cutoff before which records are past retention, how many there are, and when they were marked. Requires compliance:read.
Returns
200 Get the retention schedule
Show attributes
dataShow child attributes
classone of
audit_logs,readings,invoices,sessionsretention_daysis_defaultexpired_beforeexpired_countmarked_at
Permissions compliance:read · Roles: admin, owner
curl -X GET "$BUSINESS_API/compliance/retention" \
-H "Authorization: Bearer sk_test_..."
# No matching CLI command; use cURL or direct HTTP.
const res = await fetch("$BUSINESS_API/compliance/retention", {
method: "GET",
headers: {
Authorization: "Bearer sk_test_..."
}
});
const data = await res.json();
import requests
res = requests.get(
"$BUSINESS_API/compliance/retention",
headers={
"Authorization": "Bearer sk_test_..."
}
)
data = res.json()
req, _ := http.NewRequest("GET", "$BUSINESS_API/compliance/retention", nil)
req.Header.Set("Authorization", "Bearer sk_test_...")
resp, err := http.DefaultClient.Do(req)
{
"data": [
{
"class": "audit_logs",
"retention_days": 1,
"is_default": true,
"expired_before": "2026-11-19T09:30:00Z",
"expired_count": 1,
"marked_at": "2026-11-19T09:30:00Z"
}
]
}