Skip to content

API For CLI Developers

Use this when you automate trade-idea workflows (IB CLI, scripts) outside the browser.

1. Create a token

  1. Sign in at Jow Dones.
  2. Open SettingsAPI tokens.
  3. Name the token (for example IB workstation) and click Create token.
  4. Copy the secret immediately — it is shown once. Store it in a password manager or secret store.

Revoke unused tokens from the same page.

2. Base URL and auth

  • API host: https://api.jowdones.com (production).
  • Paths: user-facing REST routes live under /api/....
  • Header: Authorization: Bearer <token> where <token> is your personal secret (prefix jd_).
Terminal window
export JOW_DONES_API_BASE_URL="https://api.jowdones.com" # no trailing /api
export JOW_DONES_API_TOKEN="jd_...."

Local Docker typically uses http://localhost with the same /api/... paths behind the gateway (see your compose port mapping).

3. Trade ideas lifecycle (REST)

Typical flow: list ideas → approve → place or fail at broker → record execution.

MethodPathPurpose
GET/api/orders?status=approvedList ideas (filter by status as needed)
POST/api/orders/{id}/approveApprove for broker
POST/api/orders/{id}/placeMark accepted at broker (optional broker ids in JSON body)
POST/api/orders/{id}/failMark submission failed (failure_reason in body)
POST/api/orders/{id}/executeRecord fill (executed_price, optional qty/fees/timestamp)

Token management

MethodPath
GET/api/users/me/api-tokens
POST/api/users/me/api-tokens with {"name": "My CLI"}
DELETE/api/users/me/api-tokens/{token_id}

4. curl example

Terminal window
BASE="$JOW_DONES_API_BASE_URL/api"
HDR=(-H "Authorization: Bearer $JOW_DONES_API_TOKEN")
curl -s "${HDR[@]}" "$BASE/orders?status=approved"

5. Python example

import os, requests
base = os.environ["JOW_DONES_API_BASE_URL"].rstrip("/") + "/api"
h = {"Authorization": f"Bearer {os.environ['JOW_DONES_API_TOKEN']}"}
r = requests.get(f"{base}/orders", params={"status": "approved"}, headers=h, timeout=30)
r.raise_for_status()

6. OpenAPI (Swagger)

Interactive docs for the investor API (including schemas) are published on the API host:

For the product workflow in chat, see Trade Ideas.