Skip to content

dhan raw

Call any Dhan API path directly. Use it for newly released Dhan endpoints that the CLI hasn’t been wrapped around yet, while still keeping authentication and the --json / --no-color output contract consistent.

Subcommand HTTP Purpose Flags
dhan raw get <path> GET Unwrapped GET.
dhan raw delete <path> DELETE Unwrapped DELETE.
dhan raw post <path> --file <json> [--include-client-id] POST Unwrapped POST. --file (req), --include-client-id
dhan raw put <path> --file <json> [--include-client-id] PUT Unwrapped PUT. --file (req), --include-client-id

<path> is the suffix after /v2/ — e.g. profile, globalstocks/marketstatus, charts/rollingoption.

For wrapped trading payloads (orders place, super place, etc.) the CLI auto-injects dhanClientId into the top-level JSON body only when not already present. raw post / raw put require the explicit --include-client-id flag to opt in to the same injection — the default is no injection, so you control the body shape precisely.

Terminal window
dhan raw get profile --json --no-color
dhan raw get globalstocks/marketstatus --json --no-color
dhan raw post charts/rollingoption --file payload.json --json --no-color
dhan raw post globalstocks/margincalculator --file payload.json --include-client-id --json --no-color
  • A Dhan endpoint was added after the last CLI release and isn’t yet wrapped.
  • You need an unusual method on a wrapped endpoint that the CLI doesn’t expose.

Do not use raw to bypass agent guardrails — there’s no --yes enforcement on mutating raw commands, so the operator (or agent) takes full responsibility for the payload they send.

  • Terminal agent guide — the raw escape hatch keeps auth and output behaviour consistent so it’s safe to use from terminal agents.