Brokers Unified API
Auto-generated from
openapi-snapshot.json. Do not edit by hand — changes are overwritten byscripts/docs/generate_api_reference.py.
17 endpoints in this group.
GET /api/brokers/manual/positions
Manual Positions List
List latest manual positions persisted into portfolio snapshots (#629).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
account_id | query | — | optional | Manual broker_accounts.id |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/brokers/manual/positions
Manual Positions Create
Create or replace one manual holding snapshot (#629).
Request body: application/json
Responses
| Code | Description |
|---|---|
201 | Successful Response |
422 | Validation Error |
DELETE /api/brokers/manual/positions/{position_id}
Manual Positions Delete
Soft-delete a manual position snapshot (#629).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
position_id | path | integer | required |
Responses
| Code | Description |
|---|---|
204 | Successful Response |
422 | Validation Error |
PATCH /api/brokers/manual/positions/{position_id}
Manual Positions Patch
Patch a manual position snapshot by id (#629).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
position_id | path | integer | required |
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/brokers/manual/transactions
Manual Transactions List
List manual transaction rows from realized_trades (#629).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
account_id | query | — | optional | Manual broker_accounts.id |
year | query | — | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/brokers/manual/transactions
Manual Transactions Create
Create a manual transaction in realized_trades (#629).
Request body: application/json
Responses
| Code | Description |
|---|---|
201 | Successful Response |
422 | Validation Error |
DELETE /api/brokers/manual/transactions/{transaction_id}
Manual Transactions Delete
Soft-delete a manual transaction by id (#629).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
transaction_id | path | integer | required |
Responses
| Code | Description |
|---|---|
204 | Successful Response |
422 | Validation Error |
PATCH /api/brokers/manual/transactions/{transaction_id}
Manual Transactions Patch
Patch a manual transaction by id (#629).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
transaction_id | path | integer | required |
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/brokers/snaptrade/callback
Snaptrade Callback
Hosted SnapTrade redirect target.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
subbroker_slug | query | string | required | |
external_connection_id | query | — | optional | |
connection_id | query | — | optional | |
brokerage_authorization_id | query | — | optional | |
brokerageAuthorizationId | query | — | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/brokers/{broker_type}/accounts
Broker Accounts
Return account list — shape varies per broker today.
Schwab: list of {accountNumber, hashValue}. Alpaca/Tradier: broker-specific shapes.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
broker_type | path | string | required |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/brokers/{broker_type}/connect
Broker Connect
Exchange auth payload for tokens via adapter.
Body shape is broker-specific (e.g. {"auth_code": "..."} for OAuth
code-flow brokers). Phase E unifies once frontend lands.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
broker_type | path | string | required |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
402 | Payment Required |
422 | Validation Error |
POST /api/brokers/{broker_type}/disconnect
Broker Disconnect
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
broker_type | path | string | required |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/brokers/{broker_type}/positions
Broker Positions
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
broker_type | path | string | required | |
account_id | query | — | optional | Optional account scope (broker-specific id) |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/brokers/{broker_type}/quotes
Broker Quotes
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
broker_type | path | string | required | |
symbols | query | string | required | Comma-separated tickers |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/brokers/{broker_type}/refresh
Broker Refresh
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
broker_type | path | string | required |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/brokers/{broker_type}/status
Broker Status
Return canonical BrokerConnectionStatus (#650).
Strategy:
- If the adapter exposes
status_struct()— broker provides a fully-populated model. Adapters that expose this win the contract. - Else fall back to
get_token_status()(Schwab/Tradier shape) + opportunistically populateexpires_atvia_db_loadif reachable. Adapters withoutget_token_statusreportconnected=Falsewith a hint inextra.
Errors during status reads never raise — operators see connected: False plus the error string in extra.error so the frontend
banner stays informative.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
broker_type | path | string | required |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/brokers/{broker_type}/transactions
Broker Transactions
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
broker_type | path | string | required | |
account_hash | query | string | required | Broker-specific account id |
year | query | string | required | 4-digit tax year |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |