Skip to content
Webhooks
  1. Guides
  2. Webhooks

Webhooks

Subscribe an HTTPS endpoint, then send it a signed test delivery.

Test deliveries only today. Subscriptions can be created, edited and tested, but no live events are sent yet. The event names are reserved for when live delivery starts.

Up to 5 active subscriptions per account. Manage them with the webhook routes or in Account → API.

Test delivery
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.

Verify the signature · Python
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.flip
  • breaking_news.alert
  • prediction.update
  • risk.alert
  • signal.new
  • market_regime.change