Skip to content

Idempotency

Network calls fail and retry. To make sure a retried submission never creates a duplicate signal, send a client_signal_id — a stable string you generate per logical signal.

  • The first request with a given client_signal_id is stored and returns 201 Created with "deduped": false.
  • Any later request from the same desk with the same client_signal_id is not stored again. It returns 200 OK with "deduped": true and the original signal’s id.

Deduplication is scoped per desk: two different desks may use the same client_signal_id without colliding.

Terminal window
# First send → 201 Created, deduped: false
curl -X POST https://api.traderz.dev/v1/signals \
-H "Authorization: Bearer $TRADERZ_API_KEY" -H "Content-Type: application/json" \
-d '{"source":"binance","type":"crypto","symbol":"ETH/USDT","side":"open","client_signal_id":"trade-8842-open"}'
# Same client_signal_id again → 200 OK, deduped: true, same id
  • Make it deterministic for a given logical event — e.g. ${strategy}-${trade}-${side}.
  • Keep it stable across retries of the same event, and unique across different events.
  • If you omit client_signal_id, every request is stored as a new signal (no dedup).