Skip to Content
BlitzPulse docs are live. Looking for Blitz Global? Visit https://blitzglobalcapital.com.
Api ReferenceSchwab API

Schwab API

Auto-generated from openapi-snapshot.json. Do not edit by hand — changes are overwritten by scripts/docs/generate_api_reference.py.

19 endpoints in this group.

GET /api/schwab/account-activity

Schwab Account Activity

Persisted account activity for Portfolio widgets.

Reads the streamer-backed schwab_activity_events table plus stored schwab_transactions so the feed still works after market close and for after-hours events, when the websocket may be quiet or disconnected.

Parameters

NameInTypeRequiredDescription
daysqueryintegeroptional
limitqueryintegeroptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/schwab/accounts

Schwab Accounts

Return linked account numbers (display only — not the encrypted hashes).

Responses

CodeDescription
200Successful Response

GET /api/schwab/auth-url

Schwab Auth Url

Return the Schwab OAuth authorisation URL and CSRF state nonce for the connect flow.

Responses

CodeDescription
200Successful Response

GET /api/schwab/balance

Schwab Balance

Return account balance / margin data from Schwab (currentBalances + projectedBalances).

Responses

CodeDescription
200Successful Response

POST /api/schwab/connect

Schwab Connect

Exchange a one-time Schwab authorization code for tokens. The auth code is obtained by redirecting the user to the auth_url and capturing the code query parameter on the callback URL.

Pentest C4: this endpoint REQUIRES the state returned from /auth-url. Without it (or with a mismatched/expired state) the request is rejected — otherwise an attacker can CSRF-bind their own Schwab account to the victim’s BlitzPulse tenant.

Responses

CodeDescription
200Successful Response

POST /api/schwab/disconnect

Schwab Disconnect

Remove stored Schwab tokens.

Responses

CodeDescription
200Successful Response

GET /api/schwab/instrument

Schwab Instrument

Parameters

NameInTypeRequiredDescription
symbolquerystringrequiredTicker symbol or CUSIP
projectionquerystringoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/schwab/market-hours

Schwab Market Hours

Parameters

NameInTypeRequiredDescription
marketsquerystringoptional
datequeryoptionalYYYY-MM-DD (defaults to today)
persistquerybooleanoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/schwab/movers

Schwab Movers

Parameters

NameInTypeRequiredDescription
indexquerystringoptionalIndex: $SPX
sortquerystringoptional
frequencyqueryintegeroptional0=all

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/schwab/open-orders

Schwab Open Orders

Parameters

NameInTypeRequiredDescription
account_hashqueryoptionalhashValue from /accounts. Omit for all linked accounts.

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/schwab/option-chain

Schwab Option Chain

Parameters

NameInTypeRequiredDescription
symbolquerystringrequiredUnderlying ticker
contract_typequerystringoptionalALL
strike_countqueryoptional
strategyquerystringoptional
from_datequeryoptionalYYYY-MM-DD
to_datequeryoptionalYYYY-MM-DD

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/schwab/positions

Schwab Positions

Fetch current positions from the Schwab broker API.

Wraps the fetch in sync_orchestrator.sync_attempt (Phase C #648) so each user-initiated read writes a row to broker_sync_log. The sync_kind is “manual” — this is a foreground request, not a scheduled background sync.

Responses

CodeDescription
200Successful Response

GET /api/schwab/price-history

Schwab Price History

Parameters

NameInTypeRequiredDescription
symbolquerystringrequiredTicker symbol
period_typequerystringoptional
periodqueryintegeroptional
frequency_typequerystringoptional
frequencyqueryintegeroptional
need_extended_hoursquerybooleanoptional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/schwab/purchasing-power

Schwab Purchasing Power

Aggregate buying power across all Schwab accounts for the Funds widget.

BP-016 (was BP-005 regression): widget called this endpoint and got 404 because only /balance existed. This is a thin summation over /balance that degrades gracefully on Schwab API failure instead of 502-ing.

Returns zeros with degraded=true on failure so the widget can still render.

Responses

CodeDescription
200Successful Response

GET /api/schwab/quotes

Schwab Quotes

Real-time quotes from Schwab Market Data API. Falls back to yfinance (15-min delayed) if Schwab API is unavailable.

Parameters

NameInTypeRequiredDescription
symbolsquerystringrequiredComma-separated ticker symbols, e.g. AAPL,MSFT

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/schwab/refresh

Schwab Refresh

Force-refresh the Schwab access token using the stored refresh token.

Responses

CodeDescription
200Successful Response

GET /api/schwab/status

Schwab Status

Return whether Schwab is connected and when it was last synced.

Responses

CodeDescription
200Successful Response

GET /api/schwab/transactions

Schwab Transactions

Fetch TRADE transactions for a full tax year. account_hash must be the encrypted hashValue, NOT the plain account number.

Parameters

NameInTypeRequiredDescription
account_hashquerystringrequiredEncrypted account hashValue from /accounts
yearquerystringrequiredTax year, e.g. 2025

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/schwab/transactions-auto

Schwab Transactions Auto

Fetch transactions for ALL linked Schwab accounts automatically. Resolves account hashes internally — no account_hash param needed. Flattens each transaction’s transferItems into individual rows.

Parameters

NameInTypeRequiredDescription
yearquerystringrequiredTax year, e.g. 2025
typesquerystringoptionalComma-separated transaction types, e.g. TRADE,DIVIDEND

Responses

CodeDescription
200Successful Response
422Validation Error