Every webhook delivery is a JSON POST with two headers that let your endpoint verify origin and freshness.
Headers #
| Header | Value |
|---|---|
X-Rulemancer-Timestamp |
Unix time in seconds when the request was built |
X-Rulemancer-Signature |
sha256= + HMAC-SHA256 of timestamp.body using the endpoint secret |
User-Agent |
Rulemancer-Webhook/1.0 |
Verifying #
- Read the raw body exactly as sent — do not re-serialise JSON.
- Build the string
timestamp + "." + body. - Compute HMAC-SHA256 with the endpoint secret and compare in constant time.
- Reject requests whose timestamp is older than a few minutes to block replays.
Payload shape #
Each event includes the bot, the pair, the event name and a timestamp; trade events add fill price, quantity and fee. Failures are visible in the webhook log with the HTTP status the endpoint returned, and they never block the bot.
Leave a Reply