Skip to main content
Hit trading bots use API key authentication with HMAC-SHA256 signatures. Public market data endpoints do not require authentication. Private trading endpoints and the /user WebSocket namespace require a trading API key, secret and passphrase.
Keep the API secret and passphrase out of source control and browser code. They are for server-side bots and services.

Credentials

Configure your bot with:
API key creation and key management are handled in the Hit app. These docs cover how to use an existing trading key from a programmatic client.

REST HMAC Headers

Every authenticated REST request must include: The signature message is:
Rules:
  • method is uppercase, such as GET, POST or DELETE.
  • path includes /api/v1 and excludes the scheme, host and query string.
  • body is the exact JSON string sent on the request, or an empty string for requests without a body.
  • Timestamps must be within 30 seconds of server time.

REST Signing Examples

WebSocket Auth

The /user Socket.IO namespace authenticates after connect with a user-connect message. The WebSocket signature message is different from REST:
Payload:
The server responds on user-authenticated with { "success": true } or { "success": false, "error": "..." }.

Security Notes

  • Keep API secrets out of source control and client-side browser code.
  • Use separate keys for separate bots or services.
  • Deactivate unused or compromised keys immediately.
  • Keep host clocks synchronized; requests outside the timestamp window are rejected.