Skip to main content
API keys are minted through the wallet-service (doji-auth-backend/apps/wallet-service). You can create them from the dashboard’s Developer page or directly over HTTP.

Key format

Both values are SHA-256 hashed at rest. The raw secret is returned only once at creation - save it immediately or revoke and regenerate.

Endpoints

These endpoints use the wallet-service base URL, not the trading engine.

List keys

Returns all active keys for the user (without secrets).

Create a key

string
required
Human-readable name for the key.
string[]
required
One or more permission scopes. See Permission scopes below.
string[]
Optional list of allowed source IPs. Requests from other IPs return 403.
string
Optional HTTPS URL to receive trade lifecycle events. Must start with https://.
string
Optional ISO 8601 expiry timestamp (must be in the future).
Response
The secret field appears once in this response and never again. Copy it to a secrets manager before the request completes.
Constraints
  • Maximum 10 active keys per user - revoke before creating an 11th.
  • webhookUrl must use https://.
  • expiresAt must be an ISO 8601 timestamp in the future.

Revoke a key

Revocation is immediate and unrecoverable.

Permission scopes

You can grant multiple scopes on a single key: ["TRADE", "READ_ONLY"].

Authenticating requests

Send both headers on every /v1/* call:
The engine validates each request by calling POST /api/api-keys/validate against the wallet-service. Validation checks:
  • Key exists and is active
  • Secret hash matches
  • Key has not expired
  • Source IP is in ipWhitelist (if configured)
  • Key permissions cover the endpoint being called
Testnet caveat: current testnet endpoints accept calls without headers while enforcement is being wired at the gateway. Build your client with headers attached from day one - production will return 401 without them.

Store credentials as environment variables rather than hardcoding them:
Then reference them in requests: