Skip to main content

Station · macOS

Beta

Connect Dhan

Create Dhan consent app credentials (Dhan Client ID, App ID, App Secret), register loopback redirect, paste in Station, then complete consent login in browser.

Last verified · Official docs: dhanhq.co

What you need

  • Dhan trading account and DhanHQ developer app
  • Dhan Client ID, App ID, and App Secret
  • Redirect URL from this guide registered in Dhan consent app
  • Mac with TradeAutopsy Station

Station fields for this broker: Dhan Client ID · App ID · App Secret.

Register loopback redirect in Dhan consent app. Station opens auth.dhan.co consent login; agent completes callback.

Redirect URL (register at broker)

Paste this exact URL in your broker developer app. Station listens on loopback port 9140 for the OAuth callback.

https://127.0.0.1:9140/api/daemon/broker/dhan/callback

Part 1: Get your keys from Dhan

  1. 1.Read dhanhq.co/docs/v2/ for consent-based authentication and app credentials.

    Report an issue with this guide

  2. 2.Sign in to DhanHQ developer portal. Copy Dhan Client ID, App ID, and App Secret for your consent app.

    Report an issue with this guide

  3. 3.Register redirect URL https://127.0.0.1:9140/api/daemon/broker/dhan/callback in the Dhan app settings.

    Report an issue with this guide

Part 2: Paste them into Station

  1. 4.Station → Brokers → Dhan. Enter Dhan Client ID, App ID, and App Secret in the labeled fields.

    Report an issue with this guide

  2. 5.Connect opens auth.dhan.co consent login in the browser. Agent completes the loopback callback.

    Report an issue with this guide

Troubleshooting

Redirect mismatch
Dhan consent app must use the exact loopback callback URL from this guide.
401 after consent
Regenerate App Secret in DhanHQ and reconnect.

Security notes

  • App Secret in macOS Keychain on your Mac.
  • Use read-only consent scopes where Dhan allows.
  • Hosted TradeAutopsy does not store Dhan secrets.

Other broker guides