Most routes require a JWT access token. Public routes are /, /docs, /token, and /users/login.
Fetch a token by posting an AGM user email and password to /token:
curl -X POST http://localhost:5000/token \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"…"}'
The response includes access_token. Send that value on protected requests using the bearer authorization header:
curl http://localhost:5000/users/read \
-H "Authorization: Bearer <access_token>"
| Route | Methods | Description | Query Parameters | JSON Body |
|---|---|---|---|---|
/ | GET | Serve the static AGM API landing page. | ||
/accounts/comments | GET | Handles GET requests for `/accounts/comments` JWT authentication required. optional query parameters: account_id. |
| |
/accounts/comments | POST | Handles POST requests for `/accounts/comments` JWT authentication required. optional JSON body fields: account_id, author_email, author_name, body, user_id. |
| |
/accounts/comments/delete | POST | Handles POST requests for `/accounts/comments/delete` JWT authentication required. optional JSON body fields: comment_id, user_id. |
| |
/accounts/comments/update | POST | Handles POST requests for `/accounts/comments/update` JWT authentication required. optional JSON body fields: body, comment_id, user_id. |
| |
/accounts/contact | POST | Link a contact to an account. |
| |
/accounts/contact/update | POST | Update an account-contact link. |
| |
/accounts/contacts | GET | Read account-contact links filtered by account, contact, entity, or link ID. | ||
/accounts/create | POST | Create an account record in the AGM database. |
| |
/accounts/ibkr/account_holder_detail | POST | Handles POST requests for `/accounts/ibkr/account_holder_detail` JWT authentication required. optional JSON body fields: account_id, changes, person_key. |
| |
/accounts/ibkr/account_holder_edit_context | GET | Handles GET requests for `/accounts/ibkr/account_holder_edit_context` JWT authentication required. optional query parameters: account_id. |
| |
/accounts/ibkr/active_bank_instructions | POST | Read the active bank instructions available for an IBKR cash instruction. |
| |
/accounts/ibkr/business_and_occupation | GET | Read the business and occupation types from the IBKR service. | ||
/accounts/ibkr/change_financial_information | POST | Update the financial information fields held by IBKR for an account. |
| |
/accounts/ibkr/close_account | POST | Submit a request to close an IBKR account. |
| |
/accounts/ibkr/clp_capability | POST | Enable CLP capability for an IBKR account, optionally with supporting documents. |
| |
/accounts/ibkr/complex_asset_transfer_brokers | GET | Read IBKR's accepted broker/custodian names for Basic FOP transfers. | ||
/accounts/ibkr/deposit | POST | Create or submit an IBKR deposit instruction for an account. |
| |
/accounts/ibkr/details | GET | Read detailed account information from the IBKR service. |
| |
/accounts/ibkr/documents | POST | Submit account documents to the IBKR service. |
| |
/accounts/ibkr/external_asset_transfer | POST | Persist and submit one outbound request using stored account/master context. | ||
/accounts/ibkr/external_asset_transfer/status | POST | Handles POST requests for `/accounts/ibkr/external_asset_transfer/status` JWT authentication required.. | ||
/accounts/ibkr/external_asset_transfer/ticket | POST | Handles POST requests for `/accounts/ibkr/external_asset_transfer/ticket` JWT authentication required.. | ||
/accounts/ibkr/external_asset_transfers | GET | Handles GET requests for `/accounts/ibkr/external_asset_transfers` JWT authentication required. optional query parameters: account_id. |
| |
/accounts/ibkr/fee_template | POST | Apply an IBKR fee template to an account. |
| |
/accounts/ibkr/financial_ranges | GET | Read the financial range types from the IBKR service. | ||
/accounts/ibkr/forms | POST | Download the IBKR agreements and disclosure forms used during account opening. |
| |
/accounts/ibkr/instructions | GET | Read the current status of an IBKR cash instruction. |
| |
/accounts/ibkr/login_messages | GET | Read Account Management login messages for the selected account. |
| |
/accounts/ibkr/pending_tasks | GET | Read current IBKR pending tasks for an account. |
| |
/accounts/ibkr/positions | GET | Read current positions for an IBKR account through the trading API. |
| |
/accounts/ibkr/product_country_bundles | GET | Download the IBKR enum list of product-country bundles such as stocks or bonds by market. | ||
/accounts/ibkr/registration_tasks | GET | Read the full IBKR registration-task inventory, including completed tasks. |
| |
/accounts/ibkr/statements | POST | Read account statements from the IBKR service for a date range. |
| |
/accounts/ibkr/trading_permissions | POST | Add or update IBKR trading permissions for an account. |
| |
/accounts/ibkr/wire_instructions | POST | Read IBKR wire instructions for an account and currency. |
| |
/accounts/ibkr/withdraw | POST | Create or submit an IBKR withdrawal instruction for an account. |
| |
/accounts/ibkr/withdrawable_cash | POST | Read the withdrawable cash available for an IBKR account and instruction context. |
| |
/accounts/instructions | GET | Read the account banking instructions stored in the database for an account. |
| |
/accounts/read | GET | Read accounts from the database filtered by id, user_id, or advisor_code. |
| |
/accounts/send_credentials_email | POST | Send the account credentials email flow for a client account. |
| |
/accounts/send_funding_notification_email | POST | Handles POST requests for `/accounts/send_funding_notification_email` JWT authentication required. required JSON body fields: client_email, content; optional JSON body fields: cc, days_since_opened, lang, notice_number. |
| |
/accounts/send_missing_documents_email | POST | Handles POST requests for `/accounts/send_missing_documents_email` JWT authentication required. required JSON body fields: client_email, content; optional JSON body fields: cc, lang, missing_type. |
| |
/accounts/send_to_ibkr | POST | Submit an AGM account application to the IBKR onboarding flow. |
| |
/accounts/send_transfer_instructions_email | POST | Handles POST requests for `/accounts/send_transfer_instructions_email` JWT authentication required. required JSON body fields: client_email, content; optional JSON body fields: cc, initial, lang. |
| |
/accounts/send_welcome_email | POST | Handles POST requests for `/accounts/send_welcome_email` JWT authentication required. required JSON body fields: client_email, content; optional JSON body fields: cc, lang. |
| |
/accounts/update | POST | Update account records selected by the provided query payload. |
| |
/actions/prepare_daily_agreements | POST | Download and validate agreement PDFs without submitting them to IBKR. | ||
/actions/run_screening_process | GET | Run the screening process, optionally skipping the write-back step when apply_screenings is false. |
| |
/actions/send_compliance_manual_update_email | POST | Send the compliance manual update notification email. | ||
/actions/send_unfunded_emails | GET | Send the unfunded account follow-up email batch. | ||
/actions/submit_daily_agreements | POST | Preload the configured agreement PDFs at IBKR without automatic replay. | ||
/actions/update_pending_alias | PATCH | Update the alias in IBKR for accounts that still do not have an alias configured. | ||
/advisor_changes/create | POST | Create an advisor change request for an account. |
| |
/advisor_changes/read | GET | Read advisor change requests filtered by request id or account_id. |
| |
/advisors/create | POST | Create an advisor record. |
| |
/advisors/me/account_contacts | GET | Read contact links for an account owned by the authenticated advisor. |
| |
/advisors/me/account_proposals | GET | Read proposals for holders of an advisor-owned account. |
| |
/advisors/me/account_statement | POST | Read a statement for an advisor-owned account. |
| |
/advisors/me/accounts | GET | Read managed accounts for the authenticated advisor only. | ||
/advisors/me/latest_nav | GET | Read the latest NAV values for the authenticated advisor's accounts. | ||
/advisors/me/nav | GET | Read monthly NAV rows for the authenticated advisor only. |
| |
/advisors/me/open_positions | GET | Read open positions for the authenticated advisor only. |
| |
/advisors/read | GET | Read advisors from the database filtered by id, advisor code, or contact_id. |
| |
/advisors/update | POST | Update an advisor record selected by the provided query payload. |
| |
/application_providers/create | POST | Handles POST requests for `/application_providers/create` JWT authentication required. optional JSON body fields: application_provider. |
| |
/application_providers/read | GET | Handles GET requests for `/application_providers/read` JWT authentication required. optional query parameters: id. |
| |
/contacts/create | POST | Create a contact record. |
| |
/contacts/documents | GET | Read documents linked to a contact, with optional file data and document relationship metadata. |
| |
/contacts/documents | POST | Upload and attach a document to a contact, including file metadata and optional review fields. |
| |
/contacts/documents | PATCH | Update metadata fields for a previously uploaded contact document. |
| |
/contacts/documents | DELETE | Delete a contact document by document_id. |
| |
/contacts/read | GET | Read contacts by id (repeat up to 100 for bulk reads) and/or email. |
| |
/contacts/reconcile_application | POST | Resolve contacts from the saved pending application; never return raw identity. |
| |
/contacts/screen | POST | Run or create a screening record for one contact. |
| |
/contacts/screening | GET | Read screening results by contact_id (repeat up to 100 for bulk reads). |
| |
/contacts/update | POST | Update contact records selected by the provided query payload. |
| |
/docs | GET | Serve the generated AGM API route documentation page. | ||
/document_review_emails/read | GET | Read tracked document-review email attempts by account, contact, or status. | ||
/document_review_emails/send | POST | Send and persist a missing-documents email attempt for a review row. | ||
/document_review_responsibles/read | GET | Read document review assignments filtered by id, account, contact, or responsible user. |
| |
/document_review_responsibles/upsert | POST | Create or replace the responsible reviewer assignment for the given account/contact/user combination. |
| |
/etl/clients | GET | Run the clients ETL pipeline. | ||
/etl/market_data | GET, POST | Dispatch the market job, or poll its operation; never run ETL in Flask. | ||
/fee_template_requests/create | POST | Create a fee template request record for an account. |
| |
/fee_template_requests/read | GET | Read fee template requests filtered by request id or account_id. |
| |
/fee_template_requests/update | POST | Update the data payload of an existing fee template request by request id. |
| |
/flagged_deposits/create | POST | Create a flagged deposit record for compliance or operations follow-up. |
| |
/flagged_deposits/read | GET | Read flagged deposit records filtered by id or account_id. |
| |
/investment_proposals/create/assets | POST | Create an investment proposal from an explicit asset allocation payload. |
| |
/investment_proposals/create/plan | POST | Create an investment proposal from a saved portfolio plan payload. |
| |
/investment_proposals/create/risk | POST | Create an investment proposal from a risk profile payload. |
| |
/investment_proposals/preview/assets | POST | Handles POST requests for `/investment_proposals/preview/assets` JWT authentication required. optional JSON body fields: assets, risk_profile_id, starting_amount. |
| |
/investment_proposals/preview/plan | POST | Preview an investment proposal from a portfolio plan payload without persisting it. |
| |
/investment_proposals/read | GET | Read investment proposals filtered by ownership and source. |
| |
/management_type_requests/create | POST | Create a management type change request for an account. |
| |
/reporting/account_performance | GET | Handles GET requests for `/reporting/account_performance` JWT authentication required. optional query parameters: end_date, start_date. |
| |
/reporting/accounting_statements | GET | Handles GET requests for `/reporting/accounting_statements` JWT authentication required. optional query parameters: account, refresh, year. |
| |
/reporting/accounting_statements/accounts | GET, POST | Handles GET/POST requests for `/reporting/accounting_statements/accounts` JWT authentication required. optional JSON body fields: accounts, revision. |
| |
/reporting/accounting_statements/annual_download | POST | Handles POST requests for `/reporting/accounting_statements/annual_download` JWT authentication required. optional JSON body fields: account, institution, year. |
| |
/reporting/accounting_statements/detail | GET | Handles GET requests for `/reporting/accounting_statements/detail` JWT authentication required. optional query parameters: account, month, transactions, year. |
| |
/reporting/accounting_statements/download | POST | Handles POST requests for `/reporting/accounting_statements/download` JWT authentication required. optional JSON body fields: account, month, source_key, year. |
| |
/reporting/accounting_statements/upload | POST | Handles POST requests for `/reporting/accounting_statements/upload` JWT authentication required. optional JSON body fields: account, content, filename, month, year. |
| |
/reporting/brokerage_commissions | GET | Read the brokerage commissions reporting dataset. | ||
/reporting/clients | GET | Read the base clients reporting dataset. | ||
/reporting/clients/fees | GET | Read the client fees reporting dataset. | ||
/reporting/deposits_withdrawals | GET | Read the deposits and withdrawals reporting dataset. | ||
/reporting/deposits_withdrawals/monthly | GET | Read deposits and withdrawals filtered by date range or one or more years and months. |
| |
/reporting/ending_balances_from_statements | GET | Read ending balances derived from account statements. | ||
/reporting/etfs | GET | Read the ETFs reporting dataset. | ||
/reporting/ibkr_details | GET | Download the daily backup of IBKR account details, including account, financial, and account holder information. | ||
/reporting/ibkr_statement_summary | GET | Read monthly IBKR account-value summaries from Drive statements. |
| |
/reporting/ibkr_statement_transactions | GET | Read IBKR Base Currency Summary transactions from Drive statements. |
| |
/reporting/management_commissions | GET | Read the management commissions reporting dataset. | ||
/reporting/nav | GET | Read the NAV reporting dataset. | ||
/reporting/nav/monthly | GET | Read monthly NAV figures filtered by one or more years and months. |
| |
/reporting/open_positions | GET | Read the open positions reporting dataset. |
| |
/reporting/proposals_equity | GET | Read the proposals equity reporting dataset. | ||
/reporting/rtd | GET | Download the large RTD bond list dataset, similar in scope to the U.S. Treasury bond report. | ||
/reporting/stocks | GET | Read the stocks reporting dataset. | ||
/reporting/trade_confirmations | GET | Read the grouped all-account trade confirmations from Flex Query 1215183. | ||
/reporting/trades | GET | Read the trades reporting dataset filtered by one or more years and months. |
| |
/reporting/ust_bonds | GET | Read the U.S. Treasury bonds reporting dataset. | ||
/risk_profiles/create | POST | Create a risk profile assessment result. |
| |
/risk_profiles/list | GET | Read the available risk archetype definitions used to classify risk profiles. | ||
/risk_profiles/read | GET | Read stored risk profile results filtered by id. |
| |
/token | POST | Generate a short-lived token for an existing AGM user. The former universal ``{"token":"all"}`` credential is deliberately rejected. Callers must authenticate with an actual AGM user account. |
| |
/trade_tickets/export_improsa | POST | Handles POST requests for `/trade_tickets/export_improsa` JWT authentication required. optional JSON body fields: execution_ids, format, query_id, review_sample. |
| |
/trade_tickets/generate | POST | Generate trade ticket output from a flex query payload and a list of selected indices. |
| |
/trade_tickets/list | GET | Read trade ticket records filtered by id or user_id. |
| |
/trade_tickets/read | GET | Read a generated trade ticket payload by query_id. |
| |
/trade_tickets/send_email | POST | Handles POST requests for `/trade_tickets/send_email` JWT authentication required. required JSON body fields: client_email, content. |
| |
/users/login | POST | Authenticate a user by email and password and return the sanitized user record for valid credentials. |
| |
/users/read | GET | Read users from the database, optionally filtered by internal id or user_id. |
| |
/users/update | POST | Update a user record selected by id or email without allowing password_hash updates through this route. |
|