StrataRelay REST API & Webhooks
Programmatic access to low-latency quantitative signals, trade execution telemetry, risk firewall controls, and cryptographically verified audit streams.
Bearer Authentication
Include your live API key or OAuth JWT token in every request header:
Cryptographic Scopes
Keys are strictly scoped according to principle of least privilege:
Outbound Webhooks
Every webhook delivery is signed with HMAC-SHA256:
Quickstart Implementation
# 1. Verify API Connectivity
curl -X GET "http://127.0.0.1:8000/api/v1/health"
# 2. Fetch Latest Quantitative Model Signals
curl -X GET "http://127.0.0.1:8000/api/v1/signals" \
-H "Authorization: Bearer er_live_Tz9PJoMbT4hXop5DyDWwu2cpIIMXYaHvVFkPOuZZbes"
# 3. Trigger Emergency Kill Switch (Fleet-Wide)
curl -X POST "http://127.0.0.1:8000/api/v1/risk/kill-switch" \
-H "Authorization: Bearer er_live_Tz9PJoMbT4hXop5DyDWwu2cpIIMXYaHvVFkPOuZZbes" \
-H "Content-Type: application/json" \
-d '{"action": "CANCEL_AND_PAUSE", "pause": true}'Core REST Endpoints
Canonical v1 SpecLiveness and operational status of StrataRelay control plane.
{
"status": "HEALTHY",
"version": "1.0.0"
}List all active quantitative models, trading universes, and verification hashes.
[
{
"id": "core-v3-7",
"name": "Core Multi-Asset",
"universe": ["BTC", "ETH", "SOL", "BNB", "AVAX"],
"version": "3.7.3",
"status": "FORWARD_PAPER"
}
]Fetch real-time opportunity signals strictly for your workspace's active model(s) (Signal: 1 active model, Execute: up to 5). Supports optional ?model_id= filter.
[
{
"id": "sig-001",
"model_id": "core-v3-7",
"pair": "BTC/USDT",
"action": "ENTER_LONG",
"entry_price": 65420.0,
"created_at": "2026-10-04T10:15:00Z"
}
]Query executed paper and live order ledgers with timestamps and friction attribution.
[
{
"id": "TR-8953",
"model": "Core Multi-Asset",
"pair": "BTC/USDT",
"direction": "LONG",
"entry_price": 65420.0,
"exit_price": 66890.0,
"pnl_pct": 2.25,
"status": "OPEN"
}
]Retrieve tenant risk parameters, maximum portfolio exposure, and kill switch status.
{
"tenant_id": "tenant-8f12a",
"max_open_trades": 5,
"max_exposure_usd": 20000.0,
"trading_paused": false
}Trigger emergency execution halt, cancel pending orders, or resume automation across fleet.
{
"status": "TRIGGERED",
"trading_paused": true,
"model_id": "all",
"canceled_orders": 0,
"success": true
}Retrieve immutable security, risk & kill switch incident trail with SHA-256 integrity.
[
{
"id": "INC-89A12B",
"action": "EMERGENCY_KILL_SWITCH_ENGAGED",
"actor": "[email protected]",
"status": "ENGAGED",
"timestamp": "2026-10-04 17:15:00 UTC"
}
]Provision a new high-entropy, scoped API key for external bots and pipelines.
{
"id": "tok-9842",
"name": "Production Bot",
"token": "er_live_Tz9PJoMbT4hXop5DyDWwu2cpIIMXYaHvVFkPOuZZbes",
"prefix": "er_live_Tz9P",
"scopes": ["signals:read", "trades:read"]
}Register an HTTPS webhook URL for real-time HMAC-SHA256 signed event delivery.
{
"id": "wh-491",
"url": "https://api.yourcompany.com/webhook",
"status": "ACTIVE",
"signing_secret": "whsec_8f910a92b8c049e..."
}Webhook HMAC-SHA256 Verification
StrataRelay delivers real-time notifications directly to your HTTPS endpoint. Verify the X-StrataRelay-Signature header against the raw request body to guard against tampering and replay attacks.
import hmac
import hashlib
def verify_stratarelay_webhook(raw_body: bytes, received_signature: str, signing_secret: str) -> bool:
computed = "sha256=" + hmac.new(
signing_secret.encode('utf-8'),
raw_body,
hashlib.sha256
).hexdigest()
return hmac.compare_digest(computed, received_signature)