- Guides
- Webhooks
Webhooks
Subscribe an HTTPS endpoint, then send it a signed test delivery.
Up to 5 active subscriptions per account. Manage them with the webhook routes or in Account → API.
POST /hooks/tradeeasy
X-TradeEasy-Signature: <hex HMAC-SHA256 of the body>
X-TradeEasy-Event: test
X-TradeEasy-Delivery-Id: <id>
{
"event": "test",
"timestamp": "<ISO 8601>",
"data": {
"message": "This is a test webhook from TradeEasy Public API",
"webhook_id": "<webhook_id>"
}
}Signatures#
Every delivery carries X-TradeEasy-Signature: the hex HMAC-SHA256 of the raw body with the subscription’s secret. The secret is shown once, when you create the subscription. X-TradeEasy-Event names the event and X-TradeEasy-Delivery-Id identifies the delivery.
import hmac, hashlib
def verify(payload: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)Retries#
A failed delivery is retried after 1 s, 5 s, 30 s and 5 minutes, with a 10 s timeout per attempt. A subscription is switched off after repeated consecutive failures (max_failures, 10 by default). Deliveries never go to localhost, private or internal addresses.
Event names#
A subscription must name at least one of these. They are reserved names: live delivery of them has not started.
sentiment.flipbreaking_news.alertprediction.updaterisk.alertsignal.newmarket_regime.change
Educational market research, not investment advice; not for fully automated trade execution. Questions about the API or the MCP server: support@tradeeasyai.net.
