CLI
The hedge CLI (npm hedge-broker) runs the API flow from a terminal or a
script and handles sign-in and token renewal for you. Source lives at
github.com/taventech/hedge-cli.
Install
Section titled “Install”npm i -g hedge-brokerbrew install taventech/tap/hedgecurl -fsSL https://github.com/taventech/hedge-cli/releases/latest/download/install.sh | shSign in
Section titled “Sign in”hedge login # device code (default)hedge login --browser # browser sign-in on this machinehedge login --client-id bac_... --client-secret bas_... # an API key, for scriptsThe API key mode exchanges a key from Settings → API keys for a token and
renews it when it expires. Prefer HEDGE_CLIENT_SECRET in the environment over
the flag so the secret stays out of shell history. With an API key, every
submit command names the producing broker with --producer-email.
hedge whoami shows who you are signed in as. See
Authentication for the full model.
Global flags
Section titled “Global flags”| Flag | |
|---|---|
--sandbox |
Use the sandbox (sandbox-api.hedgespecialty.com). Sign-ins are kept per environment. |
--json |
Print the API’s JSON instead of tables. Errors print their JSON body too, with a non-zero exit code. |
The flow
Section titled “The flow”-
Check appetite and read what the markets need:
Terminal window hedge appetite "Residential landscaping, 6 employees" --state CA --lines gl --naics 561730hedge requirements --state CA --lines gl --naics 561730 -
Create the file (or
hedge intakewith PDFs):Terminal window hedge create --insured "Green Thumb Landscaping LLC" \--narrative "Residential landscaping and lawn care, 6 employees." \--lines gl --state CA --naics 561730 --effective 2026-11-15 \--set annual_revenue=850000 --set employee_count=6 \--client-reference AI-9f3c2b --quote --producer-email dana@youragency.com -
Follow it and answer the gaps:
Terminal window hedge status <submission-id> --waithedge answer <submission-id> --confirm-suggestionshedge answer <submission-id> --set annual_revenue=900000 # correct a fact -
Quote, then read the quotes and save every PDF:
Terminal window hedge quote <submission-id> --waithedge quotes <submission-id> --download ./quotes -
Get the bind link:
Terminal window hedge bind-link <submission-id> <quote-id>
Command reference
Section titled “Command reference”This matches hedge-broker 0.5. Run hedge <command> --help for every flag.
The flow
Section titled “The flow”| Command | What it does |
|---|---|
hedge appetite [description] --state <ST> --lines <lines> [--naics <code>] |
Which Hedge Instant Quote markets will quote the risk (POST /broker/appetite/instant). When none fits, prints the email_us block. |
hedge requirements --state <ST> --lines <lines> [--programs <ids>] [--naics] [--description] |
The core fields and each market’s questions (POST /broker/requirements). Without --programs, uses every instant market appetite returns. |
hedge create [applicant flags] [--programs <ids>] [--set ...] [--client-reference <ref>] [--quote] [--file <payload.json|->] [--producer-email] |
Create the file (POST /broker/submissions). Flags or a full JSON body with --file; flags win. submit is an alias. |
hedge intake [files...] [--text <text>|--text-file <path|->] [--insured] [--lines] [--state] [--effective] [--programs] [--client-reference] [--quote] [--producer-email] |
Create the file from PDFs and text (POST /broker/intake). Same result as create. |
hedge status <id> [--wait] [--timeout <min>] |
Each market’s state, what it is missing and what Hedge suggested (GET .../instant-quotes). --wait polls until no market is preparing or quoting. |
hedge answer <id> [--set ...] [--confirm-suggestions] [--file <answers.json>] [--producer-email] |
Answer the gaps (PATCH .../answers), all or nothing. --confirm-suggestions confirms every value Hedge suggested (suggested[]) as it stands. |
hedge business <id> [--insured] [--address --city --state --zip] [--contact-name] [--contact-email] [--contact-phone] [--effective] [--naics [--description]] [--producer-email] |
Correct the file’s core facts (PATCH .../business): name, mailing address, the insured’s contact, class, effective date. Use it when status points a gap at it or answer refuses a core field. The markets re-prepare. |
hedge quote <id> [--programs <ids>] [--wait] [--producer-email] |
Request quotes for the ready markets (POST .../quote); prints each market’s outcome. |
hedge quotes <id> [--download [dir]] |
The itemized quotes (GET .../quotes). --download saves every quote PDF to dir (default: the current directory): Hedge’s quote PDF, the carrier PDFs Hedge stored and carrier-hosted PDFs; other carrier-hosted pages (an online proposal) are listed. Hedge prepares its quote PDF on the first read, so a second run a few seconds later picks it up. |
hedge bind-link <id> <quoteId> [--for broker|insured] [--insured-email <email>] [--attest] [--producer-email] |
The link to bind the quote: the portal’s bind checklist, or the insured’s pay-and-bind page. |
hedge events [--since <cursor>] [--limit <n>] |
Your brokerage’s events feed (GET /broker/events), followed to the tail; prints the cursor to resume from. |
Applicant flags on create: --insured, --narrative, --lines,
--state, --naics, --effective, --website, --fein, --entity-type,
--business-phone, --business-email, --contact-first, --contact-last,
--contact-email, --contact-phone, and the mailing address (--address,
--address2, --city, --zip, with --state).
Answers with --set
Section titled “Answers with --set”--set (repeatable, on create and answer) takes:
| Form | Sends |
|---|---|
key=value |
shared_answers[key]. Numbers and true/false are typed; everything else is a string. |
key:=json |
shared_answers[key] as exact JSON, e.g. --set 'zip:="95610"' or --set 'lines:=["gl"]'. |
<programId>:<id>=value |
answers[programId][id]: one market’s own question. := works here too. |
key is a question’s canonical key from hedge requirements; id is the
market’s own question id.
Files, documents and the book
Section titled “Files, documents and the book”| Command | What it does |
|---|---|
hedge submissions [--status] [--search] [--limit] [--offset] [--updated-since] |
List your brokerage’s files. |
hedge upload <id> <file.pdf> [--name] |
Attach a document to a file. |
hedge documents <id> / hedge download <documentId> [-o file] |
List a file’s documents and download one. |
hedge withdraw <id> [--producer-email] |
Withdraw a file. |
hedge forms [search] / hedge form <formKey> [-o file] |
Search the blank application forms (ACORDs, Hedge supplementals) and download one, for risks you email Hedge. |
hedge policies / hedge policy <policyId> / hedge policy-doc <policyId> <kind> [-o file] |
Bound policies, one policy, and its binder, policy or declarations PDF. |
hedge payments |
Payment and invoice status. |
hedge login / hedge logout / hedge whoami |
Sign-in and identity. |
Scripting
Section titled “Scripting”hedge create --file payload.jsonsends a full body (-reads stdin); explicit flags win over the file.- Always pass
--client-referencefrom a script. The same reference returns the existing file instead of creating another, so a retry is safe. createandintakesend anIdempotency-Key(a random UUID per run, or--idempotency-key <key>).- Exit codes:
0on success,1on any error.hedge quotealso exits1when no market could be requested. - The CLI stops on a
403and prints theRetry-Afterwait on a429; it never retries either for you.
hedge --json status <submission-id> | jq '.markets[] | {market, state, missing: [.missing[].label]}'