AGM API Routes

Authentication

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>"
RouteMethodsDescriptionQuery ParametersJSON Body
/GETServe the static AGM API landing page.
/accounts/commentsGETHandles GET requests for `/accounts/comments` JWT authentication required. optional query parameters: account_id.
  • account_id
/accounts/commentsPOSTHandles POST requests for `/accounts/comments` JWT authentication required. optional JSON body fields: account_id, author_email, author_name, body, user_id.
  • account_id
  • author_email
  • author_name
  • body
  • user_id
/accounts/comments/deletePOSTHandles POST requests for `/accounts/comments/delete` JWT authentication required. optional JSON body fields: comment_id, user_id.
  • comment_id
  • user_id
/accounts/comments/updatePOSTHandles POST requests for `/accounts/comments/update` JWT authentication required. optional JSON body fields: body, comment_id, user_id.
  • body
  • comment_id
  • user_id
/accounts/contactPOSTLink a contact to an account.
  • account_contact
/accounts/contact/updatePOSTUpdate an account-contact link.
  • account_contact
  • query
/accounts/contactsGETRead account-contact links filtered by account, contact, entity, or link ID.
/accounts/createPOSTCreate an account record in the AGM database.
  • account (default: None)
/accounts/ibkr/active_bank_instructionsPOSTRead the active bank instructions available for an IBKR cash instruction.
  • account_id (default: None)
  • bank_instruction_method (default: None)
  • client_instruction_id (default: None)
  • master_account (default: None)
/accounts/ibkr/business_and_occupationGETRead the business and occupation types from the IBKR service.
/accounts/ibkr/change_financial_informationPOSTUpdate the financial information fields held by IBKR for an account.
  • account_id (default: None)
  • master_account (default: None)
  • new_financial_information (default: None)
/accounts/ibkr/close_accountPOSTSubmit a request to close an IBKR account.
  • account_id
  • close_reason
  • master_account
/accounts/ibkr/clp_capabilityPOSTEnable CLP capability for an IBKR account, optionally with supporting documents.
  • account_id
  • document_submission (default: None)
  • master_account (default: None)
/accounts/ibkr/depositPOSTCreate or submit an IBKR deposit instruction for an account.
  • account_id (default: None)
  • instruction (default: None)
  • master_account (default: None)
/accounts/ibkr/detailsGETRead detailed account information from the IBKR service.
  • account_id (default: None)
  • master_account (default: None)
/accounts/ibkr/documentsPOSTSubmit account documents to the IBKR service.
  • document_submission (default: None)
  • master_account (default: None)
/accounts/ibkr/fee_templatePOSTApply an IBKR fee template to an account.
  • account_id
  • master_account (default: None)
  • template_name
/accounts/ibkr/financial_rangesGETRead the financial range types from the IBKR service.
/accounts/ibkr/formsPOSTDownload the IBKR agreements and disclosure forms used during account opening.
  • forms (default: None)
  • master_account (default: None)
/accounts/ibkr/instructionsGETRead the current status of an IBKR cash instruction.
  • client_instruction_id (default: None)
  • master_account (default: None)
/accounts/ibkr/pending_tasksGETRead current IBKR pending tasks for an account.
  • account_id (default: None)
  • master_account (default: None)
/accounts/ibkr/product_country_bundlesGETDownload the IBKR enum list of product-country bundles such as stocks or bonds by market.
/accounts/ibkr/statementsPOSTRead account statements from the IBKR service for a date range.
  • account_id (default: None)
  • end_date (default: None)
  • language (default: 'en')
  • master_account (default: None)
  • start_date (default: None)
/accounts/ibkr/trading_permissionsPOSTAdd or update IBKR trading permissions for an account.
  • account_id
  • master_account (default: None)
  • trading_permissions (default: [])
/accounts/ibkr/wire_instructionsPOSTRead IBKR wire instructions for an account and currency.
  • account_id (default: None)
  • currency (default: 'USD')
  • master_account (default: None)
/accounts/ibkr/withdrawPOSTCreate or submit an IBKR withdrawal instruction for an account.
  • account_id (default: None)
  • instruction (default: None)
  • master_account (default: None)
/accounts/ibkr/withdrawable_cashPOSTRead the withdrawable cash available for an IBKR account and instruction context.
  • account_id (default: None)
  • client_instruction_id (default: None)
  • master_account (default: None)
/accounts/instructionsGETRead the account banking instructions stored in the database for an account.
  • account_id (default: None)
/accounts/readGETRead accounts from the database filtered by id, user_id, or advisor_code.
  • advisor_code (default: None)
  • id (default: None)
  • user_id (default: None)
/accounts/send_credentials_emailPOSTSend the account credentials email flow for a client account.
  • account_id
  • cc (default: '')
  • client_email
  • client_name (default: '')
  • lang (default: 'es')
  • send_welcome (default: False)
/accounts/send_funding_notification_emailPOSTHandles 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.
  • cc (default: '')
  • client_email (required)
  • content (required)
  • days_since_opened
  • lang (default: 'es')
  • notice_number
/accounts/send_missing_documents_emailPOSTHandles 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.
  • cc (default: '')
  • client_email (required)
  • content (required)
  • lang (default: 'en')
  • missing_type (default: 'multiple')
/accounts/send_to_ibkrPOSTSubmit an AGM account application to the IBKR onboarding flow.
  • account_id (default: None)
  • application (default: None)
  • master_account (default: None)
/accounts/send_transfer_instructions_emailPOSTHandles 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.
  • cc (default: '')
  • client_email (required)
  • content (required)
  • initial (default: True)
  • lang (default: 'es')
/accounts/send_welcome_emailPOSTHandles POST requests for `/accounts/send_welcome_email` JWT authentication required. required JSON body fields: client_email, content; optional JSON body fields: cc, lang.
  • cc (default: '')
  • client_email (required)
  • content (required)
  • lang (default: 'es')
/accounts/updatePOSTUpdate account records selected by the provided query payload.
  • account (default: None)
  • query (default: None)
/actions/run_screening_processGETRun the screening process, optionally skipping the write-back step when apply_screenings is false.
  • apply_screenings (default: 'true')
/actions/send_compliance_manual_update_emailPOSTSend the compliance manual update notification email.
/actions/send_unfunded_emailsGETSend the unfunded account follow-up email batch.
/actions/update_pending_aliasPATCHUpdate the alias in IBKR for accounts that still do not have an alias configured.
/advisor_changes/createPOSTCreate an advisor change request for an account.
  • advisor_change (default: None)
/advisor_changes/readGETRead advisor change requests filtered by request id or account_id.
  • account_id (default: None)
  • id (default: None)
/advisors/createPOSTCreate an advisor record.
  • advisor (default: None)
/advisors/readGETRead advisors from the database filtered by id, advisor code, or contact_id.
  • code (default: None)
  • contact_id (default: None)
  • id (default: None)
/advisors/updatePOSTUpdate an advisor record selected by the provided query payload.
  • advisor
  • query
/application_providers/createPOSTHandles POST requests for `/application_providers/create` JWT authentication required. optional JSON body fields: application_provider.
  • application_provider
/application_providers/readGETHandles GET requests for `/application_providers/read` JWT authentication required. optional query parameters: id.
  • id
/contacts/createPOSTCreate a contact record.
  • contact (default: None)
/contacts/documentsGETRead documents linked to a contact, with optional file data and document relationship metadata.
  • contact_id (default: None)
  • document_id
  • include_data (default: 'false')
  • include_documents (default: 'true')
  • include_processing (default: 'false')
/contacts/documentsPOSTUpload and attach a document to a contact, including file metadata and optional review fields.
  • account_id
  • category
  • comment
  • contact_id
  • data
  • document_language
  • expiry_date
  • file_length
  • file_name
  • issued_date
  • mime_type
  • sha1_checksum
  • type
/contacts/documentsPATCHUpdate metadata fields for a previously uploaded contact document.
  • category
  • comment
  • document_id
  • document_language
  • expiry_date
  • issued_date
  • type
/contacts/documentsDELETEDelete a contact document by document_id.
  • document_id
/contacts/readGETRead contacts from the database filtered by id or email address.
  • email (default: None)
  • id (default: None)
/contacts/screenPOSTRun or create a screening record for one contact.
  • contact_id
  • lists
  • ofac_list
  • uk_list
  • un_list
/contacts/screeningGETRead screening results associated with a contact.
  • contact_id (default: None)
/contacts/updatePOSTUpdate contact records selected by the provided query payload.
  • contact (default: None)
  • query (default: None)
/docsGETServe the generated AGM API route documentation page.
/document_review_emails/readGETRead tracked document-review email attempts by account, contact, or status.
/document_review_emails/sendPOSTSend and persist a missing-documents email attempt for a review row.
/document_review_responsibles/readGETRead document review assignments filtered by id, account, contact, or responsible user.
  • account_id (default: None)
  • contact_id (default: None)
  • id (default: None)
  • user_id (default: None)
/document_review_responsibles/upsertPOSTCreate or replace the responsible reviewer assignment for the given account/contact/user combination.
  • account_id (default: None)
  • comment (default: None)
  • contact_id (default: None)
  • user_id (default: None)
/etl/clientsGETRun the clients ETL pipeline.
/etl/market_dataGETRun the market data ETL pipeline.
/fee_template_requests/createPOSTCreate a fee template request record for an account.
  • fee_template_request (required)
/fee_template_requests/readGETRead fee template requests filtered by request id or account_id.
  • account_id (default: None)
  • id (default: None)
/fee_template_requests/updatePOSTUpdate the data payload of an existing fee template request by request id.
  • data
  • fee_template_request_id
/flagged_deposits/createPOSTCreate a flagged deposit record for compliance or operations follow-up.
  • flagged_deposit (default: None)
/flagged_deposits/readGETRead flagged deposit records filtered by id or account_id.
  • account_id (default: None)
  • id (default: None)
/investment_proposals/create/assetsPOSTCreate an investment proposal from an explicit asset allocation payload.
  • assets (default: None)
  • contact_id (default: None)
  • risk_profile_id (default: None)
  • starting_amount (default: None)
/investment_proposals/create/planPOSTCreate an investment proposal from a saved portfolio plan payload.
  • portfolio_plan (default: None)
/investment_proposals/create/riskPOSTCreate an investment proposal from a risk profile payload.
  • risk_profile (default: None)
  • starting_amount
/investment_proposals/preview/planPOSTPreview an investment proposal from a portfolio plan payload without persisting it.
  • portfolio_plan (default: None)
/investment_proposals/readGETRead investment proposals filtered by ownership and source.
  • account_id (default: None)
  • contact_id (default: None)
  • id (default: None)
  • risk_profile_id (default: None)
  • source_type (default: None)
/management_type_requests/createPOSTCreate a management type change request for an account.
  • management_type_request
/reporting/brokerage_commissionsGETRead the brokerage commissions reporting dataset.
/reporting/clientsGETRead the base clients reporting dataset.
/reporting/clients/feesGETRead the client fees reporting dataset.
/reporting/deposits_withdrawalsGETRead the deposits and withdrawals reporting dataset.
/reporting/deposits_withdrawals/monthlyGETRead deposits and withdrawals filtered by date range or one or more years and months.
  • end_date (default: '')
  • month (default: '')
  • months
  • start_date (default: '')
  • year (default: '')
  • years
/reporting/ending_balances_from_statementsGETRead ending balances derived from account statements.
/reporting/etfsGETRead the ETFs reporting dataset.
/reporting/ibkr_detailsGETDownload the daily backup of IBKR account details, including account, financial, and account holder information.
/reporting/management_commissionsGETRead the management commissions reporting dataset.
/reporting/navGETRead the NAV reporting dataset.
/reporting/nav/monthlyGETRead monthly NAV figures filtered by one or more years and months.
  • month (default: '')
  • months
  • year (default: '')
  • years
/reporting/open_positionsGETRead the open positions reporting dataset.
/reporting/proposals_equityGETRead the proposals equity reporting dataset.
/reporting/rtdGETDownload the large RTD bond list dataset, similar in scope to the U.S. Treasury bond report.
/reporting/stocksGETRead the stocks reporting dataset.
/reporting/tradesGETRead the trades reporting dataset filtered by one or more years and months.
  • months (default: '')
  • years (default: '')
/reporting/ust_bondsGETRead the U.S. Treasury bonds reporting dataset.
/risk_profiles/createPOSTCreate a risk profile assessment result.
  • data (default: None)
/risk_profiles/listGETRead the available risk archetype definitions used to classify risk profiles.
/risk_profiles/readGETRead stored risk profile results filtered by id.
  • id (default: None)
/tokenPOSTGenerate 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.
  • email
  • password
/trade_tickets/generatePOSTGenerate trade ticket output from a flex query payload and a list of selected indices.
  • flex_query_dict (required)
  • indices (required)
/trade_tickets/listGETRead trade ticket records filtered by id or user_id.
  • id (default: None)
  • user_id (default: None)
/trade_tickets/readGETRead a generated trade ticket payload by query_id.
  • query_id (default: None)
/trade_tickets/send_emailPOSTHandles POST requests for `/trade_tickets/send_email` JWT authentication required. required JSON body fields: client_email, content.
  • client_email (required)
  • content (required)
/users/loginPOSTAuthenticate a user by email and password and return the sanitized user record for valid credentials.
  • email
  • password
/users/readGETRead users from the database, optionally filtered by internal id or user_id.
  • id (default: None)
  • user_id (default: None)
/users/updatePOSTUpdate a user record selected by id or email without allowing password_hash updates through this route.
  • email (default: None)
  • id (default: None)
  • user (default: None)