Webhooks Guide
Truth Satellite supports real-time webhooks that notify users when classified intelligence matches their predefined criteria. This guide explains how to set up, configure, and manage webhook notificat
πΉ What Are Webhooks?
Webhooks allow your systems to receive real-time alerts when intelligence reports meet specific conditions. Instead of constantly polling the API, your server will receive instant updates whenever relevant intelligence data becomes available.
π¨ Example Use Cases: β Get notified about insider trading alerts before market movements. β Track diplomatic meetings between high-profile figures. β Monitor classified financial transactions and offshore movements.
πΉ Setting Up a Webhook Subscription
To receive webhook notifications, send a POST request to the /alerts
endpoint.
π¨ Code Example: Subscribing to a Webhook
POST /alerts Authorization: Bearer YOUR_API_KEY Content-Type: application/json
{
"event": "insider_trade",
"callback_url": "https://yourserver.com/webhook",
"keywords": ["offshore", "stock drop"],
"priority_level": "high"
}
Required Parameters:
event
string
β Yes
Type of intelligence event to track.
callback_url
string
β Yes
Your server's endpoint to receive webhook data.
keywords
array
β No
List of keywords to filter intelligence reports.
priority_level
string
β No
"high", "medium", or "low" (default: "medium").
πΉ Receiving Webhook Events
When an intelligence event matches your filter, Truth Satellite sends a POST request to your callback_url
.
π¨ Code Example: Webhook Payload Example
{
"event": "insider_trade",
"category": "finance",
"source": "classified",
"content": "CEO of XYZ Corp moved $500M offshore before stock drop.",
"timestamp": "2025-02-08T14:00:00Z"
}
πΉ Verifying Webhook Authenticity
To ensure that the webhook data is from Truth Satellite, verify the HMAC-SHA256 signature included in the request headers.
π¨ Code Example: Verifying Webhook Signature (Python)
import hashlib
import hmac
SECRET_KEY = b"your_secret_key"
def verify_signature(payload, received_signature):
signature = hmac.new(SECRET_KEY, payload.encode(), hashlib.sha256).hexdigest()
return signature == received_signature
Webhook Headers:
X-TruthSatellite-Signature
HMAC-SHA256 signature for verifying authenticity.
X-TruthSatellite-Timestamp
Timestamp of the request.
πΉ Handling Webhook Responses
Your server must respond with HTTP 200 OK to confirm successful receipt of the webhook.
π¨ Code Example: Handling Webhook in Python Flask Server
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route("/webhook", methods=["POST"])
def receive_webhook():
data = request.json
print("Received Webhook:", data)
return jsonify({"status": "success"}), 200
if __name__ == "__main__":
app.run(port=5000)
If the server does not respond within 5 seconds, the webhook will be retried up to 3 times.
πΉ Managing Webhook Subscriptions
To list all active webhooks: π¨ Code Example: Fetching Active Webhooks
GET /alerts
Authorization: Bearer YOUR_API_KEY
To delete a webhook subscription: π¨ Code Example: Removing a Webhook Subscription
DELETE /alerts
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"event": "insider_trade",
"callback_url": "https://yourserver.com/webhook"
}
πΉ Webhook Best Practices
β Validate the Signature β Always verify webhook authenticity. β Use HTTPS for Webhooks β Ensure all communication is encrypted. β Respond Quickly β Acknowledge receipt within 5 seconds. β Log Webhook Events β Keep track of all received payloads for debugging.
πΉ Contact & Support
For webhook-related issues or debugging help: π© Email: support@truthsatellit.space π Website: https://truthsatellit.space
Last updated