API Reference
Webhooks
Receive real-time notifications for governance events via HTTP webhooks.
Overview
Webhooks allow you to receive real-time notifications when events occur in your Tork environment.
Event-Driven
Push notifications for events
Signed Payloads
HMAC signature verification
Auto Retry
Failed deliveries retried
Configuring Webhooks
Webhooks are delivered by Tork, so they are registered over the REST API. There is no Python cloud SDK — @torknetwork/sdk is npm-only, and tork-governance on PyPI decides on-device and never calls out. Register an endpoint with a Bearer token:
Event Types
Available webhook event types:
policy.violationAn agent action was blocked by a policypii.detectedPII was detected in governed contenthitl.pendingAn action is waiting on human approvalhitl.approvedA human approved a pending actionhitl.rejectedA human rejected a pending actionagent.blockedAn agent was blocked from actingcircuit_breaker.triggeredA circuit breaker was trippedrate_limit.exceededA rate limit was exceededsecurity.alertA security alert was raisedapproval_requestedA new approval request was created (legacy)approval_approvedAn approval was granted (legacy)approval_rejectedAn approval was rejected (legacy)approval_timeoutAn approval request timed out (legacy)approval_expiredAn approval request expired (legacy)Webhook Payload
All webhooks follow this payload structure:
Signature Verification
Verify webhook signatures to ensure authenticity:
Retry Policy
Failed webhook deliveries are automatically retried:
| Attempt | Delay |
|---|---|
| 1st retry | 1 minute |
| 2nd retry | 5 minutes |
| 3rd retry | 30 minutes |
| 4th retry | 2 hours |
| 5th retry | 24 hours |
Important: Your webhook endpoint must respond with a 2xx status code within 30 seconds, or it will be marked as failed.