Notification Routing API
Configure how governance alerts are routed to stakeholders, with escalation policies and channel-specific delivery.
Endpoints
/v1/notifications/routingGet routing configuration/v1/notifications/routingUpdate routing rules/v1/notifications/testSend test notificationAuthentication
All notification routing endpoints require API key authentication via the x-tork-api-key header or Authorization: Bearer header.
Admin Rate Limit
Get Routing Configuration
/v1/notifications/routingReturns the current routing configuration including rules, stakeholders, escalation settings, and recent notification history.
Response Fields
| Field | Type | Description |
|---|---|---|
config | object | Current routing configuration with rules, stakeholders, and escalation settings |
history | array | Last 50 notification deliveries with timestamps and status |
labels.stakeholders | string[] | Available stakeholder identifiers |
labels.channels | string[] | Delivery channels: email, slack, webhook, sms |
labels.events | string[] | Supported event types for routing rules |
Example
curl -X GET "https://api.tork.network/v1/notifications/routing" \
-H "x-tork-api-key: tork_sk_your_api_key"{
"config": {
"stakeholders": [
{ "id": "eng-lead", "name": "Engineering Lead", "channels": ["email", "slack"] }
],
"rules": [
{ "event": "PII_DETECTED", "severity_min": 3, "stakeholder_ids": ["eng-lead"], "channels": ["slack"] }
],
"escalation": {
"critical_timeout_minutes": 15,
"high_timeout_minutes": 60
}
},
"history": [
{ "id": "ntf_abc123", "event": "PII_DETECTED", "severity": 4, "delivered_at": "2026-02-12T10:00:00Z", "channel": "slack", "status": "delivered" }
],
"labels": {
"stakeholders": ["eng-lead", "security-team", "compliance"],
"channels": ["email", "slack", "webhook", "sms"],
"events": ["PII_DETECTED", "EMERGENCY_SHUTDOWN", "POLICY_VIOLATION", "SCORING_ANOMALY"]
}
}Update Routing Rules
/v1/notifications/routingUpdates routing rules, stakeholders, or escalation configuration. All fields are optional — only provided fields are updated.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
stakeholders | array | No | Array of stakeholder objects with id, name, and channels |
rules | array | No | Array of routing rules with event, severity_min, stakeholder_ids, and channels |
escalation | object | No | Escalation timeouts configuration |
escalation.critical_timeout_minutes | number | No | Minutes before critical alerts escalate (min: 5) |
escalation.high_timeout_minutes | number | No | Minutes before high-severity alerts escalate (min: 15) |
Example
curl -X PUT "https://api.tork.network/v1/notifications/routing" \
-H "x-tork-api-key: tork_sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"escalation": {
"critical_timeout_minutes": 10,
"high_timeout_minutes": 30
},
"rules": [
{
"event": "EMERGENCY_SHUTDOWN",
"severity_min": 1,
"stakeholder_ids": ["eng-lead", "security-team"],
"channels": ["slack", "email", "sms"]
}
]
}'{
"config": {
"stakeholders": [...],
"rules": [
{ "event": "EMERGENCY_SHUTDOWN", "severity_min": 1, "stakeholder_ids": ["eng-lead", "security-team"], "channels": ["slack", "email", "sms"] }
],
"escalation": {
"critical_timeout_minutes": 10,
"high_timeout_minutes": 30
}
}
}Send Test Notification
/v1/notifications/testSend a test notification through the routing engine. Use dry_run to preview routing without delivering.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
event_type | string | Yes | Event type to simulate (see valid values below) |
severity | number | No | Severity level 1-5 (clamped to range) |
dry_run | boolean | No | If true, preview routing without delivering |
Valid event types: PII_DETECTED, EMERGENCY_SHUTDOWN, POLICY_VIOLATION, SCORING_ANOMALY, BOUNTY_SUBMISSION, HIGH_AUTONOMY, RATE_LIMIT_EXCEEDED, KEY_REVOKED
Example: Dry Run
curl -X POST "https://api.tork.network/v1/notifications/test" \
-H "x-tork-api-key: tork_sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"event_type": "PII_DETECTED",
"severity": 4,
"dry_run": true
}'{
"mode": "preview",
"event_type": "PII_DETECTED",
"severity": 4,
"matched_rules": 2,
"would_notify": [
{ "stakeholder": "eng-lead", "channel": "slack" },
{ "stakeholder": "security-team", "channel": "email" }
]
}Error Responses
| Status | Description |
|---|---|
400 | Invalid request body (e.g., invalid event_type, escalation timeout below minimum) |
401 | Missing or invalid API key |
429 | Rate limit exceeded |
500 | Internal server error |