Governance Trending API
Retrieve time-series governance metrics for dashboards and analytics — API calls, scores, PII detections, violations, and latency over configurable time periods.
Endpoint
GET
/v1/admin/trendingGet time-series governance dataAuthentication
Requires API key authentication. Subject to admin-level rate limiting.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
metric | string | calls | Metric to retrieve (see available metrics below) |
period | string | 30d | Time period: 7d, 30d, or 90d |
Available Metrics
| Metric | Description | Data Points |
|---|---|---|
calls | Total governance API calls over time | date, total, allow, redact, deny |
scores | Average TORKING-X governance scores | date, average, min, max |
pii | PII detections by type | date, emails, phones, ssns, credit_cards, other |
violations | Policy violation counts | date, total, by_severity |
latency | API response latency percentiles | date, p50, p95, p99 |
use_cases | Top use cases by call volume | use_case, count, percentage |
score_distribution | Distribution of governance scores | range, count, percentage |
Examples
API Call Trends (30 days)
bash
curl "https://api.tork.network/v1/admin/trending?metric=calls&period=30d" \
-H "x-tork-api-key: tork_sk_your_api_key"json
{
"metric": "calls",
"period": "30d",
"data": [
{ "date": "2026-01-14", "total": 1250, "allow": 980, "redact": 210, "deny": 60 },
{ "date": "2026-01-15", "total": 1340, "allow": 1050, "redact": 225, "deny": 65 },
{ "date": "2026-01-16", "total": 1180, "allow": 920, "redact": 195, "deny": 65 }
]
}PII Detection Trends (7 days)
bash
curl "https://api.tork.network/v1/admin/trending?metric=pii&period=7d" \
-H "x-tork-api-key: tork_sk_your_api_key"json
{
"metric": "pii",
"period": "7d",
"data": [
{ "date": "2026-02-06", "emails": 45, "phones": 12, "ssns": 3, "credit_cards": 1, "other": 8 },
{ "date": "2026-02-07", "emails": 52, "phones": 15, "ssns": 1, "credit_cards": 0, "other": 11 }
]
}Latency Percentiles (90 days)
bash
curl "https://api.tork.network/v1/admin/trending?metric=latency&period=90d" \
-H "x-tork-api-key: tork_sk_your_api_key"json
{
"metric": "latency",
"period": "90d",
"data": [
{ "date": "2026-01-01", "p50": 6, "p95": 18, "p99": 42 },
{ "date": "2026-01-02", "p50": 5, "p95": 16, "p99": 38 }
]
}Error Responses
| Status | Description |
|---|---|
400 | Invalid metric or period value |
401 | Missing or invalid API key |
429 | Rate limit exceeded |
500 | Internal server error |