AGM API Routes

Authentication

Most routes require a JWT access token. Public routes are /, /docs, /token, /users/login, and /users/create.

Fetch a token by posting the local token payload to /token:

curl -X POST http://localhost:5000/token \
  -H "Content-Type: application/json" \
  -d '{"token":"all"}'

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.
/account_contacts/createPOSTCreate a relationship record between an account and a contact.
  • account_contact (default: None)
/account_contacts/deletePOSTDelete account-contact relationship records that match the provided query payload.
  • query (default: None)
/account_contacts/readGETRead account-contact relationship records filtered by id, account, contact, or entity.
  • account_id (default: None)
  • contact_id (default: None)
  • entity_id (default: None)
  • id (default: None)
/account_contacts/updatePOSTUpdate an account-contact relationship selected by the incoming query payload.
  • account_contact (default: None)
  • query (default: None)
/accounts/contacts_screenings_summaryGETRead the contact and screening summary for a single account.
  • account_id (default: None)
/accounts/createPOSTCreate an account record in the AGM database.
  • account (default: None)
/accounts/ibkr/account_emailPOSTUpdate the email address associated with an IBKR account user.
  • access (default: True)
  • master_account (default: None)
  • new_email
  • reference_user_name
/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/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)
/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/registration_tasksGETRead pending IBKR registration tasks for an account.
  • account_id (default: None)
  • master_account (default: None)
/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/statements/availableGETRead the list of statement periods available in IBKR for an account.
  • account_id (default: None)
  • master_account (default: None)
/accounts/ibkr/submit_all_agreementsPOSTSubmit all pending IBKR agreements for the provided account context.
  • forms (default: None)
  • master_account (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/transfer_position_externallyPOSTTransfer a position from an IBKR account to an external broker account.
  • account_id (default: None)
  • client_instruction_id (default: None)
  • conid (default: None)
  • contra_broker_account_id (default: None)
  • contra_broker_dtc_code (default: None)
  • master_account (default: None)
  • quantity (default: None)
/accounts/ibkr/transfer_position_internallyPOSTTransfer a position between two internal IBKR accounts.
  • conid (default: None)
  • master_account (default: None)
  • source_account_id (default: None)
  • target_account_id (default: None)
  • transfer_quantity (default: None)
/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_to_ibkrPOSTSubmit an AGM account application to the IBKR onboarding flow.
  • account_id (default: None)
  • application (default: None)
  • master_account (default: None)
/accounts/updatePOSTUpdate account records selected by the provided query payload.
  • account (default: None)
  • query (default: None)
/accounts/with-metadataGETRead accounts together with derived metadata and optional advisor details.
  • advisor_code (default: None)
  • id (default: None)
  • include_advisor (default: 'false')
  • refresh (default: 'false')
  • user_id (default: None)
/accounts/with_metadataGETRead accounts together with derived metadata and optional advisor details.
  • advisor_code (default: None)
  • id (default: None)
  • include_advisor (default: 'false')
  • refresh (default: 'false')
  • user_id (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)
/applications/createPOSTCreate an application record.
  • application (default: None)
/applications/readGETRead applications by id or user_id, with an option to strip the raw application payload from the response.
  • id (default: None)
  • strip_application (default: '0')
  • user_id (default: None)
/applications/updatePOSTUpdate application records selected by the provided query payload.
  • application (default: None)
  • query (default: None)
/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/documents/linkPOSTAttach an existing raw document row to a contact_document record.
  • account_id
  • category
  • comment
  • contact_id
  • document_id
  • document_language
  • expiry_date
  • issued_date
  • type
/contacts/readGETRead contacts from the database filtered by id or email address.
  • email (default: None)
  • id (default: None)
/contacts/screeningGETRead screening results associated with a contact.
  • contact_id (default: None)
/contacts/screeningPOSTRun or create a screening record for a contact using its contact_id.
  • contact_id
/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_responsibles/createPOSTCreate an explicit reviewer assignment for an account or contact document workflow.
  • document_review_responsible (default: None)
/document_review_responsibles/deletePOSTDelete document review assignments that match the provided query payload.
  • query (default: None)
/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)
/documentsDELETEDelete a raw document row by document_id.
  • document_id
/documents/get_document_dataGETRead the raw stored data for a single document by document_id.
  • document_id (default: None)
/documents/readGETRead all document records and contact-document links without returning raw file data.
  • include_processing (default: 'false')
/email/send_email/application_linkPOSTSend a client-facing application link email.
  • client_email (required)
  • content (required)
  • lang (required)
/email/send_email/credentialsPOSTSend platform credential details to a client.
  • cc (required)
  • client_email (required)
  • content (required)
  • lang (required)
/email/send_email/email_confirmationPOSTSend the application email confirmation message to a client.
  • client_email (required)
  • content (required)
  • lang (required)
/email/send_email/funding_notificationPOSTSend a funding notification email to a client.
  • cc (default: '')
  • client_email (required)
  • content (required)
  • lang (default: 'es')
/email/send_email/lead_reminderPOSTSend an internal lead reminder email to an AGM user.
  • agm_user_email (required)
  • content (required)
/email/send_email/missing_documentsPOSTSend a missing documents email to a client with the requested missing_type template.
  • cc (default: '')
  • client_email (required)
  • content (required)
  • lang (default: 'en')
  • missing_type (default: 'multiple')
/email/send_email/task_reminderPOSTSend an internal task reminder email to an AGM user.
  • agm_user_email (required)
  • content (required)
/email/send_email/trade_ticketPOSTSend the generated trade ticket email to the client.
  • client_email (required)
  • content (required)
/email/send_email/transfer_instructionsPOSTSend transfer instructions to a client for an initial or existing funding flow.
  • cc (required)
  • client_email (required)
  • content (required)
  • initial (required)
  • lang (required)
/email/send_email/welcomePOSTSend the welcome email to a new client.
  • client_email (required)
  • content (required)
  • lang (default: 'es')
/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)
  • risk_profile_id (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)
/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 proposal id, risk_profile_id, or account_id.
  • account_id (default: None)
  • id (default: None)
  • risk_profile_id (default: None)
/management_type_requests/createPOSTCreate a management type change request for an account.
  • management_type_request
/management_type_requests/readGETRead management type change requests filtered by request id or account_id.
  • account_id
  • id
/reporting/brokerage_commissionsGETRead the brokerage commissions reporting dataset.
/reporting/clientsGETRead the base clients reporting dataset.
/reporting/clients/feesGETRead the client fees reporting dataset.
/reporting/clients/fees/monthlyGETRead monthly client fees filtered by one or more years and months.
  • month (default: '')
  • months
  • year (default: '')
  • years
/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 API access token for the special local token payload.
  • token
/trade_tickets/generatePOSTGenerate trade ticket output from a flex query payload and a list of selected indices.
  • flex_query_dict (required)
  • indices (required)
  • query_id (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)
/users/createPOSTCreate a user record after removing any incoming password hash and enforcing email uniqueness.
  • user (required)
/users/loginPOSTAuthenticate a user by email and password and return the sanitized user record for valid credentials.
  • email (required)
  • password (required)
/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)