openapi: 3.2.0 info: title: CallidusAI E Discovery API description: Callidus AI backend API version: 0.1.0 tags: - name: eDiscovery paths: /discovery/dataset/: get: tags: - eDiscovery summary: Dataset List description: 'This function will list all the currently created datasets for the given user ID (making the connection) and return them as a paginated list of DatasetResponse objects. It optionally filters datasets by their type.' operationId: dataset_list_discovery_dataset__get parameters: - name: dataset_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter datasets by their type (e.g., 'contract', 'discovery', 'benchmark') title: Dataset Type description: Filter datasets by their type (e.g., 'contract', 'discovery', 'benchmark') - name: include_linked in: query required: false schema: type: boolean description: Include linked datasets information in the response default: true title: Include Linked description: Include linked datasets information in the response - name: page in: query required: false schema: type: integer minimum: 1 description: Page number (starting from 1) default: 1 title: Page description: Page number (starting from 1) - name: page_size in: query required: false schema: type: integer maximum: 100 minimum: 1 description: Number of datasets per page (max 100) default: 5 title: Page Size description: Number of datasets per page (max 100) responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetListPaginatedResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Dataset Create description: 'This function will create a dataset for the given user, if the user doesn''t exist in the database we''ll add them into it, then create the dataset. We''ll also generate an azure storage blob "path" that can be used to upload eDiscovery documents for the given dataset.' operationId: dataset_create_discovery_dataset__post requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset: get: tags: - eDiscovery summary: Dataset List description: 'This function will list all the currently created datasets for the given user ID (making the connection) and return them as a paginated list of DatasetResponse objects. It optionally filters datasets by their type.' operationId: dataset_list_discovery_dataset_get parameters: - name: dataset_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter datasets by their type (e.g., 'contract', 'discovery', 'benchmark') title: Dataset Type description: Filter datasets by their type (e.g., 'contract', 'discovery', 'benchmark') - name: include_linked in: query required: false schema: type: boolean description: Include linked datasets information in the response default: true title: Include Linked description: Include linked datasets information in the response - name: page in: query required: false schema: type: integer minimum: 1 description: Page number (starting from 1) default: 1 title: Page description: Page number (starting from 1) - name: page_size in: query required: false schema: type: integer maximum: 100 minimum: 1 description: Number of datasets per page (max 100) default: 5 title: Page Size description: Number of datasets per page (max 100) responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetListPaginatedResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Dataset Create description: 'This function will create a dataset for the given user, if the user doesn''t exist in the database we''ll add them into it, then create the dataset. We''ll also generate an azure storage blob "path" that can be used to upload eDiscovery documents for the given dataset.' operationId: dataset_create_discovery_dataset_post requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}: get: tags: - eDiscovery summary: Dataset Find description: This function will find an already created dataset and return it to the caller. operationId: dataset_find_discovery_dataset__dataset_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DetailDatasetResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - eDiscovery summary: Dataset Update description: 'Update dataset fields from the request body. Persists name, context, case relevancy (background / anchors / considerations), and reliance options (expert_name, preferred_format). Does not change dataset_type or parent_id via PATCH (those remain create-time / separate flows). Optional fields on ``DatasetRequest`` default to ``None``. A JSON body that omits those keys is parsed as ``None`` and will clear the corresponding DB columns. Callers should send the full save payload (same shape as create), e.g. ``UpdateEDiscoveryDataset`` — not a partial PATCH that only sets name/context.' operationId: dataset_update_discovery_dataset__dataset_id__patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - eDiscovery summary: Dataset Delete description: This function will delete a dataset for the given user based on the query ID that is passed long to the route. operationId: dataset_delete_discovery_dataset__dataset_id__delete parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Dataset Delete Discovery Dataset Dataset Id Delete '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/task_id: get: tags: - eDiscovery summary: Dataset Task Id description: 'Return the platform task id (Conversation.id) linked to this dataset, if any. Used by the frontend for doc-hub integration: when creating an aiDiscovery dataset, the task is updated with reference_data = str(dataset_id). This endpoint lets the frontend resolve task_id from dataset_id so it can call "add document to task" and enable "Start processing" (workflow/import) for doc-hub-backed flows.' operationId: dataset_task_id_discovery_dataset__dataset_id__task_id_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetTaskIdResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/matter_file_suggestions: get: tags: - eDiscovery summary: Matter File Suggestions description: 'Return candidate matter-level files to suggest after the Add Files step. Same permission model as ``dataset_task_id``: requires ``can_view`` on the dataset (inherited or owner).' operationId: matter_file_suggestions_discovery_dataset__dataset_id__matter_file_suggestions_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: expert_name in: query required: false schema: anyOf: - type: string - type: 'null' title: Expert Name - name: expert_opinions in: query required: false schema: anyOf: - type: string - type: 'null' title: Expert Opinions responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MatterFileSuggestionsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/copy_parent_docs: post: tags: - eDiscovery summary: Copy Parent Docs description: 'Copy doc-hub document links from a parent dataset''s task to this FACTS child''s task. Called once after dataset creation and task linking so the child''s file browser shows inherited documents before processing starts. Idempotent — safe to call multiple times.' operationId: copy_parent_docs_discovery_dataset__dataset_id__copy_parent_docs_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/count: get: tags: - eDiscovery summary: Dataset Document Count description: This function will find an already created dataset and return it to the caller. operationId: dataset_document_count_discovery_dataset__dataset_id__count_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: with_score in: query required: false schema: type: boolean default: false title: With Score responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetDocumentStatusResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/parties: get: tags: - eDiscovery summary: Dataset Parties description: 'This little guy has to run through all the contracts in the dataset and collect all "parties involved", when it finds a duplicate party it will update the frequency of the name. Then we shall sort the results by the most frequency. The goal is to find the customer''s company / entity names, the theory is that the customer will be uploading contracts that they are involved in and thus, their names shall appear the most in the party lists.' operationId: dataset_parties_discovery_dataset__dataset_id__parties_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/DatasetContractParty' title: Response Dataset Parties Discovery Dataset Dataset Id Parties Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/entities: post: tags: - eDiscovery summary: Dataset Entities description: 'Set the business entities for the dataset based on the user selecting the parties involved that represent their company''s dataset (dataset_parties() returns a list of all the parties, one or more of those shall be set as "entities" here)' operationId: dataset_entities_discovery_dataset__dataset_id__entities_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: type: array items: type: string title: Entities responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/revenue: post: tags: - eDiscovery summary: Dataset Set Revenue description: 'This function will go through all the dataset contracts and see if the ''revenue_party'' is one of the names in the dataset''s ''contract_entities'', if it is we will set revenue to True (even if it was False), otherwise we will set revenue to False (even if it was true). Because one company''s contract revenue is another companies expense :)' operationId: dataset_set_revenue_discovery_dataset__dataset_id__revenue_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetRevenueResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/export: post: tags: - eDiscovery summary: Dataset Export description: test operationId: dataset_export_discovery_dataset__dataset_id__export_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/summary: get: tags: - eDiscovery summary: Dataset Contract Summary description: 'We have a number of contract types, we want to collect all the types of contracts that are in this database and count the total occurance of each contract type, but separate them out by "revenue" vs. "non-revenue" for the customer. to be able to differenciate the results.' operationId: dataset_contract_summary_discovery_dataset__dataset_id__summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ContractSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/columns: get: tags: - eDiscovery summary: Dataset Get Contract Mdata Columns description: Get metadata columns for contract data export/display. operationId: dataset_get_contract_mdata_columns_discovery_dataset__dataset_id__columns_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ColumnsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/details: post: tags: - eDiscovery summary: Dataset Get Contract Details description: Get detailed contract information with pagination and filtering. operationId: dataset_get_contract_details_discovery_dataset__dataset_id__details_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 100 minimum: 1 default: 10 title: Page Size requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ContractDetailRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PagedResponse_ContractDetailResponse_' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/score: post: tags: - eDiscovery summary: Dataset Contract Score Temporal description: 'Start the job that will run an ARQ job to score all the contracts, the user will expect this to take awhile so we''ll not give them all the answers right away, but tell them that it''s "started" and they can watch the job execution status for when it''s completed.' operationId: dataset_contract_score_temporal_discovery_dataset__dataset_id__score_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetTemporalJobsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/scores: post: tags: - eDiscovery summary: Dataset Get Contract Scores description: 'Fetch the general scores for the contract categories as well as the contract types and return them to the caller. We will send over all the grades and their totals and allow the UI to convert them to percentages if they want, they''ll know the total grades and where they all fit so they can generate %.' operationId: dataset_get_contract_scores_discovery_dataset__dataset_id__scores_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: content: application/json: schema: anyOf: - $ref: '#/components/schemas/ContractScoreRequest' - type: 'null' title: Contract Request responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ContractScoreResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/scores/type: post: tags: - eDiscovery summary: Dataset Get Contract Scores Type description: Return the dataset scores collected by grades across all the criteria for a given contract type. operationId: dataset_get_contract_scores_type_discovery_dataset__dataset_id__scores_type_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: content: application/json: schema: anyOf: - $ref: '#/components/schemas/ContractTypeScoreRequest' - type: 'null' title: Contract Request responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ContractTypeScoreResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/score/criteria: get: tags: - eDiscovery summary: Dataset Get Contract Score Criteria description: Fetch all scoring records for a given dataset and return them structured by category and revenue/non-revenue. operationId: dataset_get_contract_score_criteria_discovery_dataset__dataset_id__score_criteria_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetScoringCriteriaResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Dataset Contract Score Criteria description: We want to build scoring records for all our categories. operationId: dataset_contract_score_criteria_discovery_dataset__dataset_id__score_criteria_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetScoringCriteriaRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/criteria: post: tags: - eDiscovery summary: Dataset Contract Dataset Criteria description: We want to build scoring records for all our categories. operationId: dataset_contract_dataset_criteria_discovery_dataset__dataset_id__criteria_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: type: array items: type: integer title: Criteria Request responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - eDiscovery summary: Contract Dataset Criteria Get description: 'This is a slightly non-dataset "scoring" route to send back all the optional scoring criteria to the user, this may include custom scoring criteria in the future. For now, it will just dump all the scoring criteria in the database.' operationId: contract_dataset_criteria_get_discovery_dataset__dataset_id__criteria_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/ScoringCriteriaResponse' title: Response Contract Dataset Criteria Get Discovery Dataset Dataset Id Criteria Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/contract/categories: get: tags: - eDiscovery summary: Contract Contract Categories description: 'Returns the string enumeration of the contract categories so the user can select the ones to use when assigning scoring criteria to the categories.' operationId: contract_contract_categories_discovery_dataset_contract_categories_get responses: '200': description: Successful Response content: application/json: schema: items: type: string type: array title: Response Contract Contract Categories Discovery Dataset Contract Categories Get /discovery/dataset/{dataset_id}/edit/timeline: post: tags: - eDiscovery summary: Dataset Edit Timeline description: 'Custom editing of the timeline that the LLM generated, that way customers can add/tweak/change times and dates. Supports both compressed and uncompressed request bodies. Response is automatically compressed by GZipMiddleware.' operationId: dataset_edit_timeline_discovery_dataset__dataset_id__edit_timeline_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TimelineResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/run/sof: post: tags: - eDiscovery summary: Dataset Run Statement Of Fact description: Rerun our statement of facts against the current timeline using Temporal workflow (v2). operationId: dataset_run_statement_of_fact_discovery_dataset__dataset_id__run_sof_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: limit in: query required: false schema: anyOf: - type: integer minimum: 1 - type: 'null' description: 'Biggest Event Timeline: build the SoF from only the top-N events by relevance.' title: Limit description: 'Biggest Event Timeline: build the SoF from only the top-N events by relevance.' - name: focus_area in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Restrict + rank the SoF's events to those scored for any of these focus-area tags. title: Focus Area description: Restrict + rank the SoF's events to those scored for any of these focus-area tags. - name: relevance_levels in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Filter-driven SoF (ENG-15311): restrict to relevance bands (low/medium/high/critical).' title: Relevance Levels description: 'Filter-driven SoF (ENG-15311): restrict to relevance bands (low/medium/high/critical).' - name: favorability in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Filter-driven SoF (ENG-15311): restrict to favorability labels (favorable/neutral/unfavorable).' title: Favorability description: 'Filter-driven SoF (ENG-15311): restrict to favorability labels (favorable/neutral/unfavorable).' - name: start_date in: query required: false schema: anyOf: - type: string format: date - type: 'null' description: 'Filter-driven SoF: only include events on/after this ISO date.' title: Start Date description: 'Filter-driven SoF: only include events on/after this ISO date.' - name: end_date in: query required: false schema: anyOf: - type: string format: date - type: 'null' description: 'Filter-driven SoF: only include events on/before this ISO date.' title: End Date description: 'Filter-driven SoF: only include events on/before this ISO date.' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/StatementOfFactsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/statement_of_facts: get: tags: - eDiscovery summary: List Sof Versions description: List the dataset's Statement of Facts versions (default first, then newest). operationId: list_sof_versions_discovery_dataset__dataset_id__statement_of_facts_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/SoFVersionListItem' title: Response List Sof Versions Discovery Dataset Dataset Id Statement Of Facts Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Create Sof Version description: 'Create a SoF version (row + config) and kick off generation in the background. Returns the new (not-yet-generated) version immediately; the client polls it until ``generated_at`` is populated.' operationId: create_sof_version_discovery_dataset__dataset_id__statement_of_facts_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SoFVersionCreate' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SoFVersionDetail' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/statement_of_facts/{sof_id}: get: tags: - eDiscovery summary: Get Sof Version operationId: get_sof_version_discovery_dataset__dataset_id__statement_of_facts__sof_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: sof_id in: path required: true schema: type: integer title: Sof Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SoFVersionDetail' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - eDiscovery summary: Update Sof Version description: Rename a version or save manual edits to its prose / summary. operationId: update_sof_version_discovery_dataset__dataset_id__statement_of_facts__sof_id__patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: sof_id in: path required: true schema: type: integer title: Sof Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SoFVersionUpdate' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SoFVersionDetail' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - eDiscovery summary: Delete Sof Version operationId: delete_sof_version_discovery_dataset__dataset_id__statement_of_facts__sof_id__delete parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: sof_id in: path required: true schema: type: integer title: Sof Id responses: '204': description: Successful Response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/statement_of_facts/{sof_id}/regenerate: post: tags: - eDiscovery summary: Regenerate Sof Version description: 'Re-run a version against the current timeline using its saved config. Kicks off generation in the background and returns immediately with the row marked in-progress (``generated_at`` cleared); the client polls until it is re-populated. The existing content is left in place so it stays visible while the new version generates.' operationId: regenerate_sof_version_discovery_dataset__dataset_id__statement_of_facts__sof_id__regenerate_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: sof_id in: path required: true schema: type: integer title: Sof Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SoFVersionDetail' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/save/sof: post: tags: - eDiscovery summary: Dataset Save Statement Of Fact description: Save user-edited statement of facts. Triggers regeneration of the SoF DOCX export. operationId: dataset_save_statement_of_fact_discovery_dataset__dataset_id__save_sof_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetUpdateSoFRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/StatementOfFactsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/save/sof/summary: post: tags: - eDiscovery summary: Dataset Save Statement Of Fact Summary description: Save SoF summary. operationId: dataset_save_statement_of_fact_summary_discovery_dataset__dataset_id__save_sof_summary_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetUpdateSoFSummaryRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FactsSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/statement_of_facts/draft: get: tags: - eDiscovery summary: Statement Of Facts Draft description: 'Generates a statement of facts draft by retrieving relevant files from Gemini and streaming the response. Supports both discovery-backed datasets (Document.gemini_uri) and doc_hub-backed datasets (text from manifest). Transient "not ready" states return 200 + in-progress SSE (same prefix as STATEMENT_OF_FACTS_DRAFT_IN_PROGRESS_MESSAGE) so the frontend can poll. Terminal failures use 404/422 with stable detail (e.g. all hub docs FAILED_NO_RETRY).' operationId: statement_of_facts_draft_discovery_dataset__dataset_id__statement_of_facts_draft_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/statement_of_facts/draft/status: get: tags: - eDiscovery summary: Statement Of Facts Draft Status description: Read-only readiness for the lightning SoF draft (no Gemini, no push_documents side effects). operationId: statement_of_facts_draft_status_discovery_dataset__dataset_id__statement_of_facts_draft_status_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/StatementOfFactsDraftStatusResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/research: get: tags: - eDiscovery summary: Dataset Legal Research description: Get legal research data for a dataset. operationId: dataset_legal_research_discovery_dataset__dataset_id__research_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetLRResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/research/fill-form: post: tags: - eDiscovery summary: Dataset Fill Form description: 'Fill a caller-supplied form schema from this dataset''s Statement of Facts content. The dataset-sourced sibling of ``POST /form-filler/fill`` (matter-sourced). Powers the LR intake prefill when research starts from a completed Statement of Facts: the frontend sends its intake schema and the SoF narrative, summary, and preliminary legal analysis are the extraction source.' operationId: dataset_fill_form_discovery_dataset__dataset_id__research_fill_form_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetFillFormRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetFillFormResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/statement_of_facts/rewrite: post: tags: - eDiscovery summary: Sof Rewrite Statement description: Re-write the statement of facts for this dataset, we will either have a new statement of facts or an error, this will be based on what the user has requested. On success, triggers regeneration of the SoF DOCX export and records rewrite token usage on the dataset. operationId: sof_rewrite_statement_discovery_dataset__dataset_id__statement_of_facts_rewrite_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/FactsRewriteRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FactsRewriteResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/statement_of_facts/report: get: tags: - eDiscovery summary: Sof Generate Report description: 'Generate and return a Word document report for the statement of facts. `limit` + `focus_area` + date range mirror the timeline view''s filters so a downloaded report matches the on-screen "Biggest Event Timeline" selection (same top-N, same active ranking). With no view filter, the timeline section matches the cached export: ranks 10 and above, then lower ranks while the total stays under 1,000. Exhibits always sort like the cached export (label length, then label), so "Exhibit 2" comes before "Exhibit 10". `sof_id` (ENG-15255) selects which Statement of Facts version supplies the prose (statement + summary); when omitted the legacy dataset-level columns (the default SoF) are used. The Timeline of Events / exhibits sections are always dataset-level.' operationId: sof_generate_report_discovery_dataset__dataset_id__statement_of_facts_report_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: limit in: query required: false schema: anyOf: - type: integer minimum: 1 - type: 'null' description: Top-N timeline events by relevance (or by focus-area score when focus_area is set). Omit it, with no focus area or date range, to get the cached export's ranked selection. title: Limit description: Top-N timeline events by relevance (or by focus-area score when focus_area is set). Omit it, with no focus area or date range, to get the cached export's ranked selection. - name: focus_area in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Restrict + rank the report to events scored for any of these focus-area tags (repeatable). title: Focus Area description: Restrict + rank the report to events scored for any of these focus-area tags (repeatable). - name: start_date in: query required: false schema: anyOf: - type: string format: date - type: 'null' description: Only include events on/after this ISO date (YYYY-MM-DD). title: Start Date description: Only include events on/after this ISO date (YYYY-MM-DD). - name: end_date in: query required: false schema: anyOf: - type: string format: date - type: 'null' description: Only include events on/before this ISO date (YYYY-MM-DD). title: End Date description: Only include events on/before this ISO date (YYYY-MM-DD). - name: sof_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Export this Statement of Facts version's prose; omit for the dataset's default SoF. title: Sof Id description: Export this Statement of Facts version's prose; omit for the dataset's default SoF. responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/timeline: get: tags: - eDiscovery summary: Dataset Timeline description: 'Get the facts timeline for a dataset. Response is automatically compressed by GZipMiddleware. Reads from the timeline_event table and dataset columns (legal_analysis, facts_summary).' operationId: dataset_timeline_discovery_dataset__dataset_id__timeline_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TimelineResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/exhibits: get: tags: - eDiscovery summary: Dataset Exhibits description: 'Get exhibits that have letters assigned (exhibit_label IS NOT NULL). Returns one entry per distinct exhibit label (no duplicates), in the legacy JSONB shape used by the UI: { "Exhibit A": { "page": 1, "filename": "..." }, ... }.' operationId: dataset_exhibits_discovery_dataset__dataset_id__exhibits_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: type: object additionalProperties: true title: Response Dataset Exhibits Discovery Dataset Dataset Id Exhibits Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/chat_context: get: tags: - eDiscovery summary: Assistant Chat Context description: Route wrapper over :func:`build_dataset_assistant_context`. operationId: assistant_chat_context_discovery_dataset__dataset_id__chat_context_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AssistantContextResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/timeline/events: get: tags: - eDiscovery summary: List Timeline Events description: 'List timeline events for a dataset with pagination. Filters: min_relevance (overall), fact_search, focus_area (events scored for any of the given focus-area tags), and a start_date/end_date range. `limit` caps to the top-N most-relevant events (the "Biggest Event Timeline" view) while preserving chronological display.' operationId: list_timeline_events_discovery_dataset__dataset_id__timeline_events_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 100 minimum: 1 description: Items per page (max 100) default: 50 title: Page Size description: Items per page (max 100) - name: min_relevance in: query required: false schema: anyOf: - type: integer maximum: 10 minimum: 0 - type: 'null' description: Filter events with relevance >= this value (legacy; superseded by relevance_levels) title: Min Relevance description: Filter events with relevance >= this value (legacy; superseded by relevance_levels) - name: relevance_levels in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Filter to events in any of these relevance bands (repeatable): low (0-3), medium (4-6), high (7-10), critical (>=11). Supersedes min_relevance when provided. ENG-15311.' title: Relevance Levels description: 'Filter to events in any of these relevance bands (repeatable): low (0-3), medium (4-6), high (7-10), critical (>=11). Supersedes min_relevance when provided. ENG-15311.' - name: favorability in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Filter to events with any of these favorability labels: favorable, neutral, unfavorable. ENG-15311.' title: Favorability description: 'Filter to events with any of these favorability labels: favorable, neutral, unfavorable. ENG-15311.' - name: fact_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Case-insensitive substring search against the fact text title: Fact Search description: Case-insensitive substring search against the fact text - name: focus_area in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Filter to events scored for any of these focus-area tags (repeatable). Results sort by the best score across the selected areas (desc). title: Focus Area description: Filter to events scored for any of these focus-area tags (repeatable). Results sort by the best score across the selected areas (desc). - name: start_date in: query required: false schema: anyOf: - type: string format: date - type: 'null' description: Filter to events on/after this ISO date (YYYY-MM-DD); excludes undated events title: Start Date description: Filter to events on/after this ISO date (YYYY-MM-DD); excludes undated events - name: end_date in: query required: false schema: anyOf: - type: string format: date - type: 'null' description: Filter to events on/before this ISO date (YYYY-MM-DD); excludes undated events title: End Date description: Filter to events on/before this ISO date (YYYY-MM-DD); excludes undated events - name: limit in: query required: false schema: anyOf: - type: integer minimum: 1 - type: 'null' description: 'Biggest Event Timeline: cap to the top-N events by the active ranking (focus-area score when focus_area is set, else overall relevance). Pinned events are always included beyond the cap; the selected set is returned chronologically.' title: Limit description: 'Biggest Event Timeline: cap to the top-N events by the active ranking (focus-area score when focus_area is set, else overall relevance). Pinned events are always included beyond the cap; the selected set is returned chronologically.' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PaginatedTimelineResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Create Timeline Event description: Create a single timeline event. Sets dataset.timeline_sync = False. operationId: create_timeline_event_discovery_dataset__dataset_id__timeline_events_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TimelineEventCreate' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/datamodels__discovery__facts__TimelineEventResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/timeline/events/{event_id}: get: tags: - eDiscovery summary: Get Timeline Event description: Get a single timeline event by id (must belong to this dataset). operationId: get_timeline_event_discovery_dataset__dataset_id__timeline_events__event_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: event_id in: path required: true schema: type: integer title: Event Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/datamodels__discovery__facts__TimelineEventResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' put: tags: - eDiscovery summary: Update Timeline Event description: Update a single timeline event (partial). Sets dataset.timeline_sync = False. operationId: update_timeline_event_discovery_dataset__dataset_id__timeline_events__event_id__put parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: event_id in: path required: true schema: type: integer title: Event Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TimelineEventUpdate' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/datamodels__discovery__facts__TimelineEventResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - eDiscovery summary: Delete Timeline Event description: Delete a single timeline event. Sets dataset.timeline_sync = False. operationId: delete_timeline_event_discovery_dataset__dataset_id__timeline_events__event_id__delete parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: event_id in: path required: true schema: type: integer title: Event Id responses: '204': description: Successful Response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/timeline/events/{event_id}/focus-area: patch: tags: - eDiscovery summary: Update Event Focus Area Tag description: 'Add or remove a focus-area tag on a single event (ENG-15314). Membership is binary in the UI; under the hood a manually-added tag is stored with the maximum score (10) so it always ranks/filters as top-relevance for that area. Adds are restricted to the dataset''s existing focus areas; removing simply drops that dimension. Does not change the event''s overall relevance or mark the SoF out of sync.' operationId: update_event_focus_area_tag_discovery_dataset__dataset_id__timeline_events__event_id__focus_area_patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: event_id in: path required: true schema: type: integer title: Event Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/EventFocusAreaTagRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/datamodels__discovery__facts__TimelineEventResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/timeline/focus-areas/rescore: post: tags: - eDiscovery summary: Rescore Focus Areas description: 'Incrementally (re)score events against newly-added focus areas (ENG-15313). Call after editing the dataset''s focus areas (add/edit). Starts a background workflow that tags any new focus area, then scores only the not-yet-scored tags across existing events, merging into ``focus_area_scores``. Returns immediately with the ``workflow_id`` so the caller can poll ``GET .../focus-areas/rescore/status`` to drive the transient "Scoring focus areas" indicator. No full timeline re-extraction; overall relevance is untouched.' operationId: rescore_focus_areas_discovery_dataset__dataset_id__timeline_focus_areas_rescore_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: type: string title: Response Rescore Focus Areas Discovery Dataset Dataset Id Timeline Focus Areas Rescore Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/timeline/focus-areas/rescore/status: get: tags: - eDiscovery summary: Rescore Focus Areas Status description: 'Report whether a focus-area rescore workflow is still running (ENG-15313). The rescore is fire-and-forget (no TemporalJob / analysis-run row), so the FE polls this with the ``workflow_id`` returned by the rescore POST to keep the "Scoring focus areas" indicator up until the scores land. Returns ``running=False`` for any unknown / terminal / unreachable workflow so the indicator always clears (fail-safe, never sticks).' operationId: rescore_focus_areas_status_discovery_dataset__dataset_id__timeline_focus_areas_rescore_status_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: workflow_id in: query required: true schema: type: string title: Workflow Id responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: type: boolean title: Response Rescore Focus Areas Status Discovery Dataset Dataset Id Timeline Focus Areas Rescore Status Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/timeline/events/bulk: put: tags: - eDiscovery summary: Bulk Replace Timeline Events description: Replace all timeline events for the dataset with the given list. Sets dataset.timeline_sync = False. operationId: bulk_replace_timeline_events_discovery_dataset__dataset_id__timeline_events_bulk_put parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TimelineEventBulkUpdate' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PaginatedTimelineResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/workflow/import: post: tags: - eDiscovery summary: Dataset Import V2 description: 'V2 dataset import endpoint that uses Temporal workflows instead of ARQ jobs. This endpoint starts a Temporal workflow for dataset processing and creates a TemporalJob tracking record in the database for status monitoring. Args: dataset_id: ID of the dataset to process dataset_import_request: Import request parameters temporal_client: Temporal client for workflow execution db: Database session user_id: User ID for access control email: User email for status tracking and notifications Returns: Dictionary containing temporal job information and workflow details Raises: HTTPException: For various error conditions (dataset not found, no files, etc.)' operationId: dataset_import_v2_discovery_dataset__dataset_id__workflow_import_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetImportRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetTemporalJobsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/relevance/rescore: post: tags: - eDiscovery summary: Rescore Document Relevance description: 'Re-run the full Doc Review relevance analysis over already-ingested documents (ENG-18543). Explicit, user-initiated rescore after focus-area edits: re-scores every document against the current focus areas with no re-ingestion. Fire-and-forget — returns the ``TemporalJob`` tracking handle so the caller polls the existing ``GET /{dataset_id}/workflow/status/{id}`` surface for progress. Owner-gated; only Doc Review (discovery) datasets are eligible. This must never be triggered automatically by a focus-area edit — the edit and the re-run are separate steps.' operationId: rescore_document_relevance_discovery_dataset__dataset_id__relevance_rescore_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetTemporalJobsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/workflow: get: tags: - eDiscovery summary: List Temporal Jobs description: 'List temporal jobs for a specific dataset, sorted by most recent first. Args: dataset_id: ID of the dataset db: Database session user_id: User ID for access control count: Number of jobs to return (default: 1, max: 100) Returns: List of temporal job information, most recent first' operationId: list_temporal_jobs_discovery_dataset__dataset_id__workflow_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: count in: query required: false schema: type: integer maximum: 100 minimum: 1 description: 'Number of jobs to return (default: 1, max: 100)' default: 1 title: Count description: 'Number of jobs to return (default: 1, max: 100)' responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/DatasetTemporalJobsResponse' title: Response List Temporal Jobs Discovery Dataset Dataset Id Workflow Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/workflow/{temporal_job_id}: get: tags: - eDiscovery summary: Get Temporal Job description: 'Get details for a specific temporal job. Args: dataset_id: ID of the dataset temporal_job_id: ID of the temporal job db: Database session user_id: User ID for access control Returns: Temporal job details' operationId: get_temporal_job_discovery_dataset__dataset_id__workflow__temporal_job_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: temporal_job_id in: path required: true schema: type: integer title: Temporal Job Id responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Get Temporal Job Discovery Dataset Dataset Id Workflow Temporal Job Id Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/workflow/status/{temporal_job_id}: get: tags: - eDiscovery summary: Get Temporal Job Status description: 'Get live status for a specific temporal job using Temporal API. This endpoint checks the cached status first, then falls back to live Temporal API queries for running workflows. For FactsTimeline workflows, it returns both the main workflow status and ingestion workflow status. Args: dataset_id: ID of the dataset temporal_job_id: ID of the temporal job temporal_client: Temporal client for live status queries db: Database session user_id: User ID for access control shared_authz: Permission service for shared access checks Returns: List of workflow statuses (ingestion first, then main workflow)' operationId: get_temporal_job_status_discovery_dataset__dataset_id__workflow_status__temporal_job_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: temporal_job_id in: path required: true schema: type: integer title: Temporal Job Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/JobStatus' title: Response Get Temporal Job Status Discovery Dataset Dataset Id Workflow Status Temporal Job Id Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/workflow/relevance/export: post: tags: - eDiscovery summary: Start Relevance Export Workflow description: 'Start a relevance export workflow for a discovery dataset. This endpoint allows manually triggering the relevance export workflow for datasets that have already completed relevance scanning. This is useful for datasets that had relevance jobs run before the export feature was added. Args: dataset_id: ID of the dataset to export relevance records from temporal_client: Temporal client for workflow execution db: Database session user_id: User ID for access control Returns: DatasetTemporalJobsResponse containing temporal job information Raises: HTTPException: If dataset not found, not authorized, or not a DISCOVERY dataset' operationId: start_relevance_export_workflow_discovery_dataset__dataset_id__workflow_relevance_export_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetTemporalJobsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/workflow/status/{temporal_job_id}/report: post: tags: - eDiscovery summary: Report Temporal Job Crash description: 'Send an email report about a temporal job crash or failure, including all related workflow statuses. This endpoint collects status information from the temporal job and any child workflows, then sends a detailed email report to support. Args: dataset_id: ID of the dataset temporal_job_id: ID of the temporal job to report temporal_client: Temporal client for workflow queries db: Database session user_id: User ID for access control Returns: JSONResponse with success message' operationId: report_temporal_job_crash_discovery_dataset__dataset_id__workflow_status__temporal_job_id__report_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: temporal_job_id in: path required: true schema: type: integer title: Temporal Job Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/relevance: get: tags: - eDiscovery summary: Dataset Document Relevance description: 'Find all documents with at least 1 piece of relevance, filtered/sorted/paginated SERVER-SIDE (across the whole dataset, so filters and smoking-guns-first ordering work across pages). Supports both discovery-backed (Document) and doc-hub-backed (doc_hub_doc_id) relevance. ``document_id`` narrows the listing to a single document. Deep links carry only a bare id, so this resolves one to its full row regardless of which page it would otherwise land on. The backing source is resolved from the dataset, so callers never have to name it; an id that isn''t in this dataset simply yields an empty page. Every match is listed, including documents the listing check judged a reviewer usually does not need (``listing_needed`` False, with ``listing_reason``). ``include_hidden`` is accepted and ignored, and ``hidden_count`` is always 0; both remain only so existing clients keep working.' operationId: dataset_document_relevance_discovery_dataset__dataset_id__relevance_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 100 minimum: 1 default: 10 title: Page Size - name: importance in: query required: false schema: type: array items: type: string default: [] title: Importance - name: smoking_gun_only in: query required: false schema: type: boolean default: false title: Smoking Gun Only - name: findings_bucket in: query required: false schema: anyOf: - type: string - type: 'null' title: Findings Bucket - name: focus_tags in: query required: false schema: type: array items: type: string default: [] title: Focus Tags - name: file_types in: query required: false schema: type: array items: type: string default: [] title: File Types - name: search in: query required: false schema: anyOf: - type: string - type: 'null' title: Search - name: sort_by in: query required: false schema: anyOf: - type: string - type: 'null' title: Sort By - name: sort_dir in: query required: false schema: type: string default: desc title: Sort Dir - name: document_id in: query required: false schema: anyOf: - type: string - type: 'null' title: Document Id - name: include_hidden in: query required: false schema: type: boolean default: false title: Include Hidden responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RelevanceDocumentPage' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/relevance/{document_id}: get: tags: - eDiscovery summary: Dataset Relevance By Document description: 'This route will find all documents that have at least 1 piece of relevance and return the results sorted by those scored the highest first.' operationId: dataset_relevance_by_document_discovery_dataset__dataset_id__relevance__document_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: document_id in: path required: true schema: type: string title: Document Id - name: document_source in: query required: false schema: anyOf: - $ref: '#/components/schemas/DatasetDocumentSource' - type: 'null' title: Document Source - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 100 minimum: 1 default: 10 title: Page Size responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PagedResponse_RelevanceDetailResponse_' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/relevance/{document_id}/{relevance_id}: get: tags: - eDiscovery summary: Dataset Relevance By Relevance description: Fetch the node ID for a specific relevance entry. operationId: dataset_relevance_by_relevance_discovery_dataset__dataset_id__relevance__document_id___relevance_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: document_id in: path required: true schema: type: string title: Document Id - name: relevance_id in: path required: true schema: type: integer title: Relevance Id - name: document_source in: query required: false schema: anyOf: - $ref: '#/components/schemas/DatasetDocumentSource' - type: 'null' title: Document Source responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RelevanceDataResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/summary: get: tags: - eDiscovery summary: Get Banking Summary description: Get overall banking summary for a dataset. operationId: get_banking_summary_discovery_forensic__dataset_id__banking_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetBankingSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/institutions: get: tags: - eDiscovery summary: Get Institutions description: Get all financial institutions for a dataset. operationId: get_institutions_discovery_forensic__dataset_id__banking_institutions_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FinancialInstitutionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/accounts: get: tags: - eDiscovery summary: Get Accounts description: Get all financial accounts for a dataset with optional filtering. operationId: get_accounts_discovery_forensic__dataset_id__banking_accounts_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: institution_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by institution ID title: Institution Id description: Filter by institution ID - name: business_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter to accounts linked to a specific business entity. Use the businesses list endpoint to enumerate available business IDs for a dataset. title: Business Id description: Filter to accounts linked to a specific business entity. Use the businesses list endpoint to enumerate available business IDs for a dataset. - name: holder_kind in: query required: false schema: anyOf: - type: string pattern: ^(personal|business)$ - type: 'null' description: 'Filter by account holder kind: ''personal'' (titled to an individual / joint individuals) or ''business'' (titled to a legal entity). Omit for both.' title: Holder Kind description: 'Filter by account holder kind: ''personal'' (titled to an individual / joint individuals) or ''business'' (titled to a legal entity). Omit for both.' - name: active_only in: query required: false schema: type: boolean description: Only return active accounts default: false title: Active Only description: Only return active accounts - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_institution in: query required: false schema: type: boolean description: Include institution details default: true title: Include Institution description: Include institution details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FinancialAccountListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/accounts/{account_id}: get: tags: - eDiscovery summary: Get Account description: Get a specific financial account. operationId: get_account_discovery_forensic__dataset_id__banking_accounts__account_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: include_institution in: query required: false schema: type: boolean description: Include institution details default: true title: Include Institution description: Include institution details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FinancialAccountResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/accounts/{account_id}/transactions: get: tags: - eDiscovery summary: Get Account Transactions description: Get transactions for a specific account with filtering options. operationId: get_account_transactions_discovery_forensic__dataset_id__banking_accounts__account_id__transactions_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum transaction amount title: Min Amount description: Minimum transaction amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum transaction amount title: Max Amount description: Maximum transaction amount - name: transaction_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by transaction type title: Transaction Type description: Filter by transaction type - name: category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) title: Category description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) - name: sub_category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category title: Sub Category description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category - name: sort_order in: query required: false schema: type: string description: 'Sort order: ''asc'' for earliest to latest, ''desc'' for latest to earliest' default: asc title: Sort Order description: 'Sort order: ''asc'' for earliest to latest, ''desc'' for latest to earliest' - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TransactionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/accounts/{account_id}/balances: get: tags: - eDiscovery summary: Get Account Balances description: Get balance history for a specific account. operationId: get_account_balances_discovery_forensic__dataset_id__banking_accounts__account_id__balances_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AccountBalanceListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/spending-summary/{account_type}: get: tags: - eDiscovery summary: Get Banking Category Spending Summary description: Get daily spending summary for a specific banking category (e.g., checking, savings) or all accounts (use 'all') operationId: get_banking_category_spending_summary_discovery_forensic__dataset_id__banking_spending_summary__account_type__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_type in: path required: true schema: type: string title: Account Type - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date in YYYY-MM-DD format (optional) title: Start Date description: Start date in YYYY-MM-DD format (optional) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date in YYYY-MM-DD format (optional) title: End Date description: End date in YYYY-MM-DD format (optional) - name: category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) title: Category description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) - name: sub_category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category title: Sub Category description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BankingCategoryDailySpendingSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/transactions: get: tags: - eDiscovery summary: Get All Transactions description: Get all transactions across all accounts in a dataset, ordered by date to create a unified timeline. operationId: get_all_transactions_discovery_forensic__dataset_id__banking_transactions_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum transaction amount title: Min Amount description: Minimum transaction amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum transaction amount title: Max Amount description: Maximum transaction amount - name: transaction_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by transaction type title: Transaction Type description: Filter by transaction type - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by account type (e.g., 'checking', 'savings') title: Account Type description: Filter by account type (e.g., 'checking', 'savings') - name: category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) title: Category description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) - name: sub_category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category title: Sub Category description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category - name: institution_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by institution ID title: Institution Id description: Filter by institution ID - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details - name: sort_order in: query required: false schema: type: string description: Sort order for transactions (asc or desc) default: asc title: Sort Order description: Sort order for transactions (asc or desc) responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TransactionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/transactions/accounts: get: tags: - eDiscovery summary: Get Transaction Accounts description: Get account information for transactions in the timeline. Use this to build a lookup table for account IDs. operationId: get_transaction_accounts_discovery_forensic__dataset_id__banking_transactions_accounts_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by account type (e.g., 'checking', 'savings') title: Account Type description: Filter by account type (e.g., 'checking', 'savings') - name: institution_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by institution ID title: Institution Id description: Filter by institution ID responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Get Transaction Accounts Discovery Forensic Dataset Id Banking Transactions Accounts Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/transactions/timeline-summary: get: tags: - eDiscovery summary: Get Transactions Timeline Summary description: Get a summary of the unified transaction timeline across all accounts. operationId: get_transactions_timeline_summary_discovery_forensic__dataset_id__banking_transactions_timeline_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by account type (e.g., 'checking', 'savings') title: Account Type description: Filter by account type (e.g., 'checking', 'savings') - name: institution_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by institution ID title: Institution Id description: Filter by institution ID responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Get Transactions Timeline Summary Discovery Forensic Dataset Id Banking Transactions Timeline Summary Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/checks: get: tags: - eDiscovery summary: List Checks description: Paginated list of discovered check images for a dataset. operationId: list_checks_discovery_forensic__dataset_id__banking_checks_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter to one account title: Account Id description: Filter to one account - name: is_cleared in: query required: false schema: anyOf: - type: boolean - type: 'null' description: Filter by cleared status title: Is Cleared description: Filter by cleared status - name: matched in: query required: false schema: anyOf: - type: boolean - type: 'null' description: Only checks with (true) / without (false) a matched transaction title: Matched description: Only checks with (true) / without (false) a matched transaction - name: unlinked in: query required: false schema: anyOf: - type: boolean - type: 'null' description: true = checks we couldn't tie to an account (needs review); false = linked title: Unlinked description: true = checks we couldn't tie to an account (needs review); false = linked - name: payee in: query required: false schema: anyOf: - type: string - type: 'null' description: Case-insensitive payee substring match title: Payee description: Case-insensitive payee substring match - name: check_number in: query required: false schema: anyOf: - type: string - type: 'null' description: Exact check number title: Check Number description: Exact check number - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Min Amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Max Amount - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Earliest check_date (YYYY-MM-DD) title: Start Date description: Earliest check_date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Latest check_date (YYYY-MM-DD) title: End Date description: Latest check_date (YYYY-MM-DD) - name: sort_order in: query required: false schema: type: string description: '''asc'' or ''desc'' by check_date' default: desc title: Sort Order description: '''asc'' or ''desc'' by check_date' - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size - name: include_account in: query required: false schema: type: boolean description: Include the resolved account default: false title: Include Account description: Include the resolved account - name: include_transaction in: query required: false schema: type: boolean description: Include the matched transaction default: false title: Include Transaction description: Include the matched transaction responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BankCheckListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/checks/{check_id}: get: tags: - eDiscovery summary: Get Check description: Full detail for one check, including its account and matched transaction. operationId: get_check_discovery_forensic__dataset_id__banking_checks__check_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: check_id in: path required: true schema: type: integer title: Check Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BankCheckResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/deposit-slips: get: tags: - eDiscovery summary: List Deposit Slips description: Paginated list of discovered deposit slips for a dataset (items always included). operationId: list_deposit_slips_discovery_forensic__dataset_id__banking_deposit_slips_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter to one account title: Account Id description: Filter to one account - name: matched in: query required: false schema: anyOf: - type: boolean - type: 'null' description: Only slips with (true) / without (false) a matched transaction title: Matched description: Only slips with (true) / without (false) a matched transaction - name: unlinked in: query required: false schema: anyOf: - type: boolean - type: 'null' description: true = slips we couldn't tie to an account (needs review); false = linked title: Unlinked description: true = slips we couldn't tie to an account (needs review); false = linked - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Min Amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Max Amount - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Earliest deposit_date (YYYY-MM-DD) title: Start Date description: Earliest deposit_date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Latest deposit_date (YYYY-MM-DD) title: End Date description: Latest deposit_date (YYYY-MM-DD) - name: sort_order in: query required: false schema: type: string description: '''asc'' or ''desc'' by deposit_date' default: desc title: Sort Order description: '''asc'' or ''desc'' by deposit_date' - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size - name: include_account in: query required: false schema: type: boolean description: Include the resolved account default: false title: Include Account description: Include the resolved account - name: include_transaction in: query required: false schema: type: boolean description: Include the matched transaction default: false title: Include Transaction description: Include the matched transaction responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DepositSlipListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/banking/deposit-slips/{slip_id}: get: tags: - eDiscovery summary: Get Deposit Slip description: Full detail for one deposit slip, including its items, account, and matched transaction. operationId: get_deposit_slip_discovery_forensic__dataset_id__banking_deposit_slips__slip_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: slip_id in: path required: true schema: type: integer title: Slip Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DepositSlipResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expense-taxonomy: get: tags: - eDiscovery summary: Get Expense Taxonomy description: 'Return the expense taxonomy structure: groups → categories → sub_category examples. No dataset or DB data; use this to know group names, how many categories each group has, and the example sub-categories per category (e.g. for dropdowns or filters).' operationId: get_expense_taxonomy_discovery_forensic__dataset_id__expense_taxonomy_get responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExpenseTaxonomyResponse' /discovery/forensic/{dataset_id}/sub-categories: get: tags: - eDiscovery summary: Get Sub Categories description: 'Return distinct (category, sub_category) pairs that appear in this dataset''s transactions. Includes both banking and liability transactions. Use this to build filter dropdowns for category/sub-category (only values that exist in the data).' operationId: get_sub_categories_discovery_forensic__dataset_id__sub_categories_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SubCategoriesListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/spend-by-category: get: tags: - eDiscovery summary: Get Spend By Category description: 'Get spend and transaction counts by group → category → sub_category with % and annualized breakdown. Groups are organizational (Living Expenses, Lifestyle Expenses, etc.). Categories are the stored tier (e.g. Transportation, Housing). Sub-categories are the granular tier (e.g. Fuel, Car Payment under Transportation). Aggregates banking (debits) and liability (charges); returns totals, percentages, and annualized spend at each level. Annualized spend = total_spend_in_window * 365.25 / days_in_window.' operationId: get_spend_by_category_discovery_forensic__dataset_id__spend_by_category_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: annualized_method in: query required: false schema: enum: - last_30_days - last_90_days - last_6_months - last_12_months - ytd - custom type: string description: 'Time window for the annualized view. ''last_30_days'': trailing 30 days. ''last_90_days'': trailing 90 days. ''last_6_months'': trailing 6 calendar months. ''last_12_months'': trailing 12 calendar months (default). ''ytd'': January 1 of the latest transaction year through the latest transaction. ''custom'': use start_date and end_date (both required).' default: last_12_months title: Annualized Method description: 'Time window for the annualized view. ''last_30_days'': trailing 30 days. ''last_90_days'': trailing 90 days. ''last_6_months'': trailing 6 calendar months. ''last_12_months'': trailing 12 calendar months (default). ''ytd'': January 1 of the latest transaction year through the latest transaction. ''custom'': use start_date and end_date (both required).' - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) — required when annualized_method=custom title: Start Date description: Start date (YYYY-MM-DD) — required when annualized_method=custom - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) — required when annualized_method=custom title: End Date description: End date (YYYY-MM-DD) — required when annualized_method=custom responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SpendByCategoryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/agent/ask: post: tags: - eDiscovery summary: Agent Ask description: 'Ask a free-form question over forensic financial data (banking and liabilities). Note: Returns response via streaming connection but content arrives complete (not token-by-token) as the workflow-based ReActAgent doesn''t support token streaming in current version.' operationId: agent_ask_discovery_forensic__dataset_id__agent_ask_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AgentAskRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expenses/summary: get: tags: - eDiscovery summary: Get Expense Summary description: Get overall expense summary for a dataset. operationId: get_expense_summary_discovery_forensic__dataset_id__expenses_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetExpenseSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expenses/categories: get: tags: - eDiscovery summary: Get Expense Categories description: Get all expense categories for a dataset. operationId: get_expense_categories_discovery_forensic__dataset_id__expenses_categories_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: category_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by category type title: Category Type description: Filter by category type - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExpenseCategoryListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expenses/merchants: get: tags: - eDiscovery summary: Get Merchants description: Get all merchants for a dataset with optional filtering. operationId: get_merchants_discovery_forensic__dataset_id__expenses_merchants_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: merchant_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by merchant type title: Merchant Type description: Filter by merchant type - name: city in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by city title: City description: Filter by city - name: state in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by state title: State description: Filter by state - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MerchantListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expenses/records: get: tags: - eDiscovery summary: Get Expense Records description: Get expense records with extensive filtering options. operationId: get_expense_records_discovery_forensic__dataset_id__expenses_records_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: expense_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense type title: Expense Type description: Filter by expense type - name: merchant_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by merchant ID title: Merchant Id description: Filter by merchant ID - name: category_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by category ID title: Category Id description: Filter by category ID - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum expense amount title: Min Amount description: Minimum expense amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum expense amount title: Max Amount description: Maximum expense amount - name: business_only in: query required: false schema: type: boolean description: Only business expenses default: false title: Business Only description: Only business expenses - name: include_line_items in: query required: false schema: type: boolean description: Include line item details default: false title: Include Line Items description: Include line item details - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExpenseRecordListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expenses/records/{record_id}: get: tags: - eDiscovery summary: Get Expense Record description: Get a specific expense record with full details. operationId: get_expense_record_discovery_forensic__dataset_id__expenses_records__record_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: record_id in: path required: true schema: type: integer title: Record Id - name: include_line_items in: query required: false schema: type: boolean description: Include line item details default: true title: Include Line Items description: Include line item details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExpenseRecordResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expenses/records/{record_id}/line-items: get: tags: - eDiscovery summary: Get Expense Line Items description: Get line items for a specific expense record. operationId: get_expense_line_items_discovery_forensic__dataset_id__expenses_records__record_id__line_items_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: record_id in: path required: true schema: type: integer title: Record Id - name: item_category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by item category title: Item Category description: Filter by item category - name: essential_only in: query required: false schema: type: boolean description: Only essential items default: false title: Essential Only description: Only essential items - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExpenseLineItemListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expenses/analysis/by-type: get: tags: - eDiscovery summary: Get Expenses By Type description: Get expense analysis grouped by expense type. operationId: get_expenses_by_type_discovery_forensic__dataset_id__expenses_analysis_by_type_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/ExpenseTypeSummary' title: Response Get Expenses By Type Discovery Forensic Dataset Id Expenses Analysis By Type Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/expenses/analysis/top-merchants: get: tags: - eDiscovery summary: Get Top Merchants description: Get top merchants by spending amount. operationId: get_top_merchants_discovery_forensic__dataset_id__expenses_analysis_top_merchants_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: limit in: query required: false schema: type: integer maximum: 100 minimum: 1 description: Number of top merchants to return default: 10 title: Limit description: Number of top merchants to return - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/MerchantSpendingSummary' title: Response Get Top Merchants Discovery Forensic Dataset Id Expenses Analysis Top Merchants Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/summary: get: tags: - eDiscovery summary: Get Income Summary description: Get overall income summary for a dataset. operationId: get_income_summary_discovery_forensic__dataset_id__income_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetIncomeSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/documents: get: tags: - eDiscovery summary: Get Tax Documents description: Get tax documents with optional filtering. operationId: get_tax_documents_discovery_forensic__dataset_id__income_documents_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: document_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by document type title: Document Type description: Filter by document type - name: tax_year in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by tax year title: Tax Year description: Filter by tax year - name: include_details in: query required: false schema: type: boolean description: Include related records default: false title: Include Details description: Include related records - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TaxDocumentListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/documents/{document_id}: get: tags: - eDiscovery summary: Get Tax Document description: Get a specific tax document with full details. operationId: get_tax_document_discovery_forensic__dataset_id__income_documents__document_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: document_id in: path required: true schema: type: integer title: Document Id - name: include_details in: query required: false schema: type: boolean description: Include related records default: true title: Include Details description: Include related records responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TaxDocumentResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/records: get: tags: - eDiscovery summary: Get Income Records description: Get income records with extensive filtering options. operationId: get_income_records_discovery_forensic__dataset_id__income_records_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: income_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by income type title: Income Type description: Filter by income type - name: employer_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by employer ID title: Employer Id description: Filter by employer ID - name: tax_year in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by tax year title: Tax Year description: Filter by tax year - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum income amount title: Min Amount description: Minimum income amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum income amount title: Max Amount description: Maximum income amount - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/IncomeRecordListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/employers: get: tags: - eDiscovery summary: Get Employers description: Get all employers for a dataset. operationId: get_employers_discovery_forensic__dataset_id__income_employers_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/EmployerListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/deductions: get: tags: - eDiscovery summary: Get Tax Deductions description: Get tax deductions with optional filtering. operationId: get_tax_deductions_discovery_forensic__dataset_id__income_deductions_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: deduction_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by deduction type title: Deduction Type description: Filter by deduction type - name: tax_year in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by tax year title: Tax Year description: Filter by tax year - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TaxDeductionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/credits: get: tags: - eDiscovery summary: Get Tax Credits description: Get tax credits with optional filtering. operationId: get_tax_credits_discovery_forensic__dataset_id__income_credits_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: credit_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by credit type title: Credit Type description: Filter by credit type - name: tax_year in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by tax year title: Tax Year description: Filter by tax year - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TaxCreditListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/analysis/by-year: get: tags: - eDiscovery summary: Get Income By Year description: Get income analysis grouped by tax year. operationId: get_income_by_year_discovery_forensic__dataset_id__income_analysis_by_year_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/TaxYearSummary' title: Response Get Income By Year Discovery Forensic Dataset Id Income Analysis By Year Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/analysis/by-type: get: tags: - eDiscovery summary: Get Income By Type description: Get income analysis grouped by income type. operationId: get_income_by_type_discovery_forensic__dataset_id__income_analysis_by_type_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: tax_year in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by tax year title: Tax Year description: Filter by tax year responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/IncomeTypeSummary' title: Response Get Income By Type Discovery Forensic Dataset Id Income Analysis By Type Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/analysis/top-employers: get: tags: - eDiscovery summary: Get Top Employers description: Get top employers by income amount. operationId: get_top_employers_discovery_forensic__dataset_id__income_analysis_top_employers_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: limit in: query required: false schema: type: integer maximum: 100 minimum: 1 description: Number of top employers to return default: 10 title: Limit description: Number of top employers to return - name: tax_year in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by tax year title: Tax Year description: Filter by tax year responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/EmployerIncomeSummary' title: Response Get Top Employers Discovery Forensic Dataset Id Income Analysis Top Employers Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/income/validation: get: tags: - eDiscovery summary: Validate Income Documents description: 'Validate tax documents against 1040 returns and schedules. Validates that all supporting documents (W-2s, 1099s, schedules) match what''s reported on the 1040 and identifies missing or mismatched documents. Includes validation for Schedule 1, 2, B, C, SE, and cross-validation between related schedules and source documents. Args: dataset_id: The dataset ID to validate documents for. tax_year: Optional tax year filter. If None, validates all years. page: Page number for pagination. page_size: Number of items per page. db: Database session dependency. user_id: User ID from authentication. Returns: ValidationReportListResponse containing validation reports for each tax year.' operationId: validate_income_documents_discovery_forensic__dataset_id__income_validation_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: tax_year in: query required: false schema: anyOf: - type: integer - type: 'null' description: 'Filter by tax year (default: all years)' title: Tax Year description: 'Filter by tax year (default: all years)' - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ValidationReportListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investigations: post: tags: - eDiscovery summary: Start Investigation Workflow description: 'Start an LLM-driven investigation Temporal workflow. This kicks off a long-running background investigation that uses GPT-5 to analyze financial transactions for suspicious patterns. The workflow: 1. Loads dataset and case context 2. Runs LLM investigation with pre-programmed questions 3. Returns comprehensive findings Use the status endpoint to check progress and retrieve results.' operationId: start_investigation_workflow_discovery_forensic__dataset_id__investigations_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/StartInvestigationRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/StartInvestigationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - eDiscovery summary: List Investigations description: List all investigations for a dataset with optional filtering. operationId: list_investigations_discovery_forensic__dataset_id__investigations_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: investigation_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by investigation type title: Investigation Type description: Filter by investigation type - name: evidence_strength in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by evidence strength title: Evidence Strength description: Filter by evidence strength - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestigationListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investigations/workflows/running: get: tags: - eDiscovery summary: Check Running Investigation description: 'Check if there is a currently running investigation workflow for this dataset. Returns information about any running investigation workflows, including workflow_id and status. This is useful for preventing duplicate investigations or showing progress.' operationId: check_running_investigation_discovery_forensic__dataset_id__investigations_workflows_running_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RunningInvestigationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investigations/workflows/{workflow_id}: get: tags: - eDiscovery summary: Get Investigation Status description: Get the status and results of an investigation workflow. operationId: get_investigation_status_discovery_forensic__dataset_id__investigations_workflows__workflow_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: workflow_id in: path required: true schema: type: string title: Workflow Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestigationWorkflowStatusResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investigations/types: get: tags: - eDiscovery summary: List Investigation Types description: 'List available investigation types. Returns all investigation types defined in the InvestigationType enum with their human-readable names and descriptions.' operationId: list_investigation_types_discovery_forensic__dataset_id__investigations_types_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestigationTypesResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investigations/{investigation_id}: get: tags: - eDiscovery summary: Get Investigation description: Get a specific investigation with paginated flagged transactions. operationId: get_investigation_discovery_forensic__dataset_id__investigations__investigation_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: investigation_id in: path required: true schema: type: integer title: Investigation Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number for flagged transactions default: 1 title: Page description: Page number for flagged transactions - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of transactions per page default: 100 title: Page Size description: Number of transactions per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestigationWithTransactionsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - eDiscovery summary: Delete Investigation description: 'Delete an investigation and clean up associated flags from transactions and documents. This will: 1. Remove investigation flags from transaction metadata_ex fields 2. Delete the investigation record (which cascades to delete investigation_flagged_transactions and investigation_flagged_documents)' operationId: delete_investigation_discovery_forensic__dataset_id__investigations__investigation_id__delete parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: investigation_id in: path required: true schema: type: integer title: Investigation Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DeleteInvestigationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/interview-questions/generate: post: tags: - eDiscovery summary: Generate Interview Questions description: 'Generate interview questions for a dataset. Questions are generated based on: - Case background - Key legal issues - Available financial data New questions are appended to existing questions in case_anchors. Args: dataset_id: ID of the dataset max_questions: Maximum number of questions to generate (1-50) db: Database session user_id: User ID from auth temporal_client: Temporal client Returns: Dictionary with workflow ID and status' operationId: generate_interview_questions_discovery_forensic__dataset_id__interview_questions_generate_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: max_questions in: query required: false schema: type: integer maximum: 50 minimum: 1 description: Maximum number of questions to generate default: 10 title: Max Questions description: Maximum number of questions to generate responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Generate Interview Questions Discovery Forensic Dataset Id Interview Questions Generate Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/interview-questions: put: tags: - eDiscovery summary: Update Interview Questions description: 'Update interview questions in case_anchors. Accepts a request body with a "questions" array and updates the dataset''s case_anchors field. Automatically calculates count and new_questions based on questions that are not skipped and not answered. Request body format: { "questions": [ { "id": "...", "type": "Q_AND_A", "question": "...", "answer": "...", ... }, ... ] } Args: dataset_id: ID of the dataset request_body: Request body containing "questions" array db: Database session user_id: User ID from auth Returns: Updated dataset with case_anchors' operationId: update_interview_questions_discovery_forensic__dataset_id__interview_questions_put parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: type: object additionalProperties: true title: Request Body responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Update Interview Questions Discovery Forensic Dataset Id Interview Questions Put '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/interview-questions/{question_id}: delete: tags: - eDiscovery summary: Delete Interview Question description: 'Delete an interview question by UUID from case_anchors. Args: dataset_id: ID of the dataset question_id: UUID of the question to delete db: Database session user_id: User ID from auth Returns: Dictionary with success message' operationId: delete_interview_question_discovery_forensic__dataset_id__interview_questions__question_id__delete parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: question_id in: path required: true schema: type: string title: Question Id responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Delete Interview Question Discovery Forensic Dataset Id Interview Questions Question Id Delete '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/summary: get: tags: - eDiscovery summary: Get Investment Summary description: Get overall investment summary for a dataset. operationId: get_investment_summary_discovery_forensic__dataset_id__investments_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetInvestmentSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/accounts: get: tags: - eDiscovery summary: Get Investment Accounts description: Get investment accounts with optional filtering. operationId: get_investment_accounts_discovery_forensic__dataset_id__investments_accounts_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by account type title: Account Type description: Filter by account type - name: business_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter to accounts linked to a specific business entity. Use the businesses list endpoint to enumerate available business IDs for a dataset. title: Business Id description: Filter to accounts linked to a specific business entity. Use the businesses list endpoint to enumerate available business IDs for a dataset. - name: holder_kind in: query required: false schema: anyOf: - type: string pattern: ^(personal|business)$ - type: 'null' description: 'Filter by account holder kind: ''personal'' (titled to an individual / joint individuals) or ''business'' (titled to a legal entity). Omit for both.' title: Holder Kind description: 'Filter by account holder kind: ''personal'' (titled to an individual / joint individuals) or ''business'' (titled to a legal entity). Omit for both.' - name: active_only in: query required: false schema: type: boolean description: Only return active accounts default: false title: Active Only description: Only return active accounts - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_institution in: query required: false schema: type: boolean description: Include institution details default: true title: Include Institution description: Include institution details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestmentAccountListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/accounts/{account_id}: get: tags: - eDiscovery summary: Get Investment Account description: Get a specific investment account. operationId: get_investment_account_discovery_forensic__dataset_id__investments_accounts__account_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: include_institution in: query required: false schema: type: boolean description: Include institution details default: true title: Include Institution description: Include institution details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestmentAccountResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/accounts/{account_id}/values: get: tags: - eDiscovery summary: Get Account Values description: Get account values for a specific investment account. operationId: get_account_values_discovery_forensic__dataset_id__investments_accounts__account_id__values_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AccountValueListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/accounts/{account_id}/holdings: get: tags: - eDiscovery summary: Get Account Holdings description: Get holdings for a specific investment account. operationId: get_account_holdings_discovery_forensic__dataset_id__investments_accounts__account_id__holdings_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: symbol in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by symbol title: Symbol description: Filter by symbol - name: asset_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by asset type title: Asset Type description: Filter by asset type - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestmentHoldingListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/accounts/{account_id}/transactions: get: tags: - eDiscovery summary: Get Account Transactions description: Get transactions for a specific investment account with filtering options. operationId: get_account_transactions_discovery_forensic__dataset_id__investments_accounts__account_id__transactions_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: transaction_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by transaction type title: Transaction Type description: Filter by transaction type - name: symbol in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by symbol title: Symbol description: Filter by symbol - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum transaction amount title: Min Amount description: Minimum transaction amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum transaction amount title: Max Amount description: Maximum transaction amount - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestmentTransactionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/holdings: get: tags: - eDiscovery summary: Get All Holdings description: Get all holdings across all investment accounts. operationId: get_all_holdings_discovery_forensic__dataset_id__investments_holdings_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: symbol in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by symbol title: Symbol description: Filter by symbol - name: asset_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by asset type title: Asset Type description: Filter by asset type - name: account_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by account ID title: Account Id description: Filter by account ID - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestmentHoldingListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/analysis/by-symbol: get: tags: - eDiscovery summary: Get Holdings By Symbol description: Get holdings analysis grouped by symbol. operationId: get_holdings_by_symbol_discovery_forensic__dataset_id__investments_analysis_by_symbol_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/HoldingSummary' title: Response Get Holdings By Symbol Discovery Forensic Dataset Id Investments Analysis By Symbol Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/investments/income-reconciliation: get: tags: - eDiscovery summary: Get Investment Income Reconciliation description: 'Read the per-(taxpayer, institution, year, kind) reconciliation rows written by ``reconcile_investment_income_activity``. Tax forms (1099-DIV/INT/R) are the source of truth when present; investment-statement-derived dividend / interest / realized-gain / retirement-distribution totals fill the gap when no tax form covers the year. Discrepancies (both sides present + amounts diverge) are surfaced via ``has_discrepancy`` on each row so the audit pane can highlight them. The reconciliation table is refreshed by the forensic completion workflow on every batch finish (and on tax-doc uploads via the same workflow re-trigger).' operationId: get_investment_income_reconciliation_discovery_forensic__dataset_id__investments_income_reconciliation_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/InvestmentIncomeReconciliationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/summary: get: tags: - eDiscovery summary: Get Liability Summary description: Get overall liability summary for a dataset. operationId: get_liability_summary_discovery_forensic__dataset_id__liabilities_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetLiabilitySummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/accounts: get: tags: - eDiscovery summary: Get Liability Accounts description: Get liability accounts with optional filtering. operationId: get_liability_accounts_discovery_forensic__dataset_id__liabilities_accounts_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: liability_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by liability type title: Liability Type description: Filter by liability type - name: business_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter to accounts linked to a specific business entity. Use the businesses list endpoint to enumerate available business IDs for a dataset. title: Business Id description: Filter to accounts linked to a specific business entity. Use the businesses list endpoint to enumerate available business IDs for a dataset. - name: holder_kind in: query required: false schema: anyOf: - type: string pattern: ^(personal|business)$ - type: 'null' description: 'Filter by account holder kind: ''personal'' (titled to an individual / joint individuals) or ''business'' (titled to a legal entity). Omit for both.' title: Holder Kind description: 'Filter by account holder kind: ''personal'' (titled to an individual / joint individuals) or ''business'' (titled to a legal entity). Omit for both.' - name: active_only in: query required: false schema: type: boolean description: Only return active accounts default: false title: Active Only description: Only return active accounts - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_institution in: query required: false schema: type: boolean description: Include institution details default: true title: Include Institution description: Include institution details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiabilityAccountListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/accounts/{account_id}: get: tags: - eDiscovery summary: Get Liability Account description: Get a specific liability account. operationId: get_liability_account_discovery_forensic__dataset_id__liabilities_accounts__account_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: include_institution in: query required: false schema: type: boolean description: Include institution details default: true title: Include Institution description: Include institution details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiabilityAccountResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/accounts/{account_id}/balances: get: tags: - eDiscovery summary: Get Account Balances description: Get balances for a specific liability account. operationId: get_account_balances_discovery_forensic__dataset_id__liabilities_accounts__account_id__balances_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiabilityBalanceListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/accounts/{account_id}/transactions: get: tags: - eDiscovery summary: Get Account Transactions description: Get transactions for a specific liability account with filtering options. operationId: get_account_transactions_discovery_forensic__dataset_id__liabilities_accounts__account_id__transactions_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: payment_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by payment type title: Payment Type description: Filter by payment type - name: category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) title: Category description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) - name: sub_category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category title: Sub Category description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum transaction amount (absolute value) title: Min Amount description: Minimum transaction amount (absolute value) - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum transaction amount (absolute value) title: Max Amount description: Maximum transaction amount (absolute value) - name: include_disputed in: query required: false schema: type: boolean description: Include disputed transactions default: true title: Include Disputed description: Include disputed transactions - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details - name: sort_order in: query required: false schema: type: string description: Sort order for transactions (asc or desc) default: asc title: Sort Order description: Sort order for transactions (asc or desc) responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiabilityTransactionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/analysis/by-type: get: tags: - eDiscovery summary: Get Liabilities By Type description: Get liability analysis grouped by liability type. operationId: get_liabilities_by_type_discovery_forensic__dataset_id__liabilities_analysis_by_type_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/LiabilityTypeSummary' title: Response Get Liabilities By Type Discovery Forensic Dataset Id Liabilities Analysis By Type Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/types: get: tags: - eDiscovery summary: Get Liability Types description: Get all liability types with user-friendly names and counts for the dataset. operationId: get_liability_types_discovery_forensic__dataset_id__liabilities_types_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiabilityTypeListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/accounts/{account_id}/spending-summary: get: tags: - eDiscovery summary: Get Account Spending Summary description: 'Get daily spending summary for a specific liability account. Returns aggregated spending data including: - Daily breakdown of charges and payments - Category-based spending analysis - Summary statistics (totals, averages, trends) - Peak spending days and spending trends Args: dataset_id: ID of the dataset containing the account account_id: ID of the liability account start_date: Optional start date filter (YYYY-MM-DD format) end_date: Optional end date filter (YYYY-MM-DD format) Returns: LiabilityDailySpendingSummaryResponse: Complete spending analysis for the account Raises: HTTPException: 404 if account not found or not owned by user HTTPException: 400 if date format is invalid' operationId: get_account_spending_summary_discovery_forensic__dataset_id__liabilities_accounts__account_id__spending_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: account_id in: path required: true schema: type: integer title: Account Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiabilityDailySpendingSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/category/{liability_type}/spending-summary: get: tags: - eDiscovery summary: Get Category Spending Summary description: 'Get daily spending summary for a liability category (e.g., all credit cards). Returns aggregated spending data across all accounts of a specific liability type: - Daily breakdown aggregated across all accounts in the category - Summary statistics for the entire category - Account count and average spending per account - Peak spending days and spending trends across all accounts Args: dataset_id: ID of the dataset containing the accounts liability_type: Type of liability (e.g., ''credit_card'', ''auto_loan'') start_date: Optional start date filter (YYYY-MM-DD format) end_date: Optional end date filter (YYYY-MM-DD format) Returns: LiabilityCategoryDailySpendingSummaryResponse: Complete spending analysis for the category Raises: HTTPException: 404 if no accounts found for the liability type HTTPException: 400 if date format is invalid' operationId: get_category_spending_summary_discovery_forensic__dataset_id__liabilities_category__liability_type__spending_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: liability_type in: path required: true schema: type: string title: Liability Type - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) title: Category description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) - name: sub_category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category title: Sub Category description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiabilityCategoryDailySpendingSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/transactions: get: tags: - eDiscovery summary: Get All Liability Transactions description: Unified list of all liability transactions across all accounts in a dataset, ordered by payment_date. operationId: get_all_liability_transactions_discovery_forensic__dataset_id__liabilities_transactions_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: payment_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by payment type title: Payment Type description: Filter by payment type - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum transaction amount (absolute value) title: Min Amount description: Minimum transaction amount (absolute value) - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum transaction amount (absolute value) title: Max Amount description: Maximum transaction amount (absolute value) - name: include_disputed in: query required: false schema: type: boolean description: Include disputed transactions default: true title: Include Disputed description: Include disputed transactions - name: liability_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by liability type (e.g., 'credit_card') title: Liability Type description: Filter by liability type (e.g., 'credit_card') - name: category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) title: Category description: Filter by expense category (e.g. Transportation, Transfers & Internal Movements) - name: sub_category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category title: Sub Category description: Filter by expense sub-category (e.g. Gas, Rideshare); often used with category - name: institution_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by institution ID title: Institution Id description: Filter by institution ID - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 100 title: Page Size description: Number of items per page - name: include_account in: query required: false schema: type: boolean description: Include account details default: false title: Include Account description: Include account details - name: sort_order in: query required: false schema: type: string description: Sort order for transactions (asc or desc) default: asc title: Sort Order description: Sort order for transactions (asc or desc) responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/LiabilityTransactionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/liabilities/transactions/accounts: get: tags: - eDiscovery summary: Get Liability Transaction Accounts description: Return account lookup for accounts that have transactions in the filtered range. operationId: get_liability_transaction_accounts_discovery_forensic__dataset_id__liabilities_transactions_accounts_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: liability_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by liability type title: Liability Type description: Filter by liability type - name: institution_id in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter by institution ID title: Institution Id description: Filter by institution ID responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Get Liability Transaction Accounts Discovery Forensic Dataset Id Liabilities Transactions Accounts Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/profiles/: get: tags: - eDiscovery summary: Get Profile description: Get the forensic profile for a dataset. operationId: get_profile_discovery_forensic__dataset_id__profiles__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ProfileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Update Profile description: Update the forensic profile for a dataset. operationId: update_profile_discovery_forensic__dataset_id__profiles__post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProfileUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ProfileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/profiles/taxpayers: get: tags: - eDiscovery summary: Get Taxpayers description: 'Get party-candidate taxpayers for a dataset. The post-batch prune sweep flags incidental names as non-candidates; this surfaces only the grounded ones (``is_party_candidate`` True or not-yet- scored NULL), strongest evidence first, so the Family-Profile party dropdown shows the likely spouses rather than every discovered name.' operationId: get_taxpayers_discovery_forensic__dataset_id__profiles_taxpayers_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/TaxPayerListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Create Or Update Taxpayers description: Create or update multiple taxpayers for a dataset. operationId: create_or_update_taxpayers_discovery_forensic__dataset_id__profiles_taxpayers_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TaxPayerListUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/datamodels__discovery__forensic__profiles__TaxPayerResponse' title: Response Create Or Update Taxpayers Discovery Forensic Dataset Id Profiles Taxpayers Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/profiles/taxpayers/{taxpayer_id}: delete: tags: - eDiscovery summary: Delete Taxpayer description: 'Delete a taxpayer from a dataset. Cascading behavior: - Clears petitioner_taxpayer_id/respondent_taxpayer_id in ForensicProfile if set - Deletes associated dependents (via cascade="all, delete-orphan") - Sets dependent.taxpayer_id to NULL for any dependents linked via foreign key Raises: HTTPException: 404 if taxpayer not found or doesn''t belong to dataset' operationId: delete_taxpayer_discovery_forensic__dataset_id__profiles_taxpayers__taxpayer_id__delete parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: taxpayer_id in: path required: true schema: type: integer title: Taxpayer Id responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: type: string title: Response Delete Taxpayer Discovery Forensic Dataset Id Profiles Taxpayers Taxpayer Id Delete '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/profiles/taxpayers/{taxpayer_id}/rename: patch: tags: - eDiscovery summary: Rename Taxpayer description: 'Rename a taxpayer''s primary_name. Checks for unique constraint conflicts — two taxpayers in the same dataset cannot share the same primary_name.' operationId: rename_taxpayer_discovery_forensic__dataset_id__profiles_taxpayers__taxpayer_id__rename_patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: taxpayer_id in: path required: true schema: type: integer title: Taxpayer Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TaxPayerRenameRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/datamodels__discovery__forensic__profiles__TaxPayerResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/profiles/dependents: get: tags: - eDiscovery summary: Get Dependents description: Get list of all dependents for a dataset. operationId: get_dependents_discovery_forensic__dataset_id__profiles_dependents_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DependentListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Create Or Update Dependents description: Create or update multiple dependents for a dataset. operationId: create_or_update_dependents_discovery_forensic__dataset_id__profiles_dependents_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DependentListUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DependentListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/allocation/config: get: tags: - eDiscovery summary: Get Allocation Config description: Return the current allocation config for this dataset (empty if not set). operationId: get_allocation_config_discovery_forensic__dataset_id__allocation_config_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AllocationConfigResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' put: tags: - eDiscovery summary: Set Allocation Config description: Save allocation config. Validates member IDs against the database. operationId: set_allocation_config_discovery_forensic__dataset_id__allocation_config_put parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AllocationConfigRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AllocationConfigResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/allocation/computed: get: tags: - eDiscovery summary: Get Expense Allocation description: 'Dynamically compute expense allocation across family members. Groups all OUTFLOW/non-CLEARING transactions in the annualized window by beneficiary, then distributes each pool to family members based on configured share percentages. Pass the same annualized_method as spend-by-category to keep both panels in sync.' operationId: get_expense_allocation_discovery_forensic__dataset_id__allocation_computed_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: annualized_method in: query required: false schema: enum: - last_30_days - last_90_days - last_6_months - last_12_months - ytd - custom type: string description: 'Time window for the allocation view — must match the spend-by-category method so both panels display the same data. ''last_30_days'': trailing 30 days. ''last_90_days'': trailing 90 days. ''last_6_months'': trailing 6 calendar months. ''last_12_months'': trailing 12 calendar months (default). ''ytd'': January 1 of the latest transaction year through the latest transaction. ''custom'': use start_date and end_date (both required).' default: last_12_months title: Annualized Method description: 'Time window for the allocation view — must match the spend-by-category method so both panels display the same data. ''last_30_days'': trailing 30 days. ''last_90_days'': trailing 90 days. ''last_6_months'': trailing 6 calendar months. ''last_12_months'': trailing 12 calendar months (default). ''ytd'': January 1 of the latest transaction year through the latest transaction. ''custom'': use start_date and end_date (both required).' - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) — required when annualized_method=custom title: Start Date description: Start date (YYYY-MM-DD) — required when annualized_method=custom - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) — required when annualized_method=custom title: End Date description: End date (YYYY-MM-DD) — required when annualized_method=custom responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExpenseAllocationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/businesses: get: tags: - eDiscovery summary: List Businesses description: 'List business entities identified in this dataset. Each row aggregates the K-1s issued by the business and flags whether a parent return (Schedule C / 1120 / 1120-S / 1065) has been processed.' operationId: list_businesses_discovery_forensic__dataset_id__businesses_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Items per page default: 100 title: Page Size description: Items per page responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BusinessListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/businesses/{business_id}: get: tags: - eDiscovery summary: Get Business description: 'Single business with all linked tax documents and rental properties. Returns the business row, every K-1 issued by it, the most recent parent return (Schedule C / 1120 / 1120-S / 1065) when one exists in the dataset, and every ``rental_properties`` row owned by the business.' operationId: get_business_discovery_forensic__dataset_id__businesses__business_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: business_id in: path required: true schema: type: integer title: Business Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BusinessDetailResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/businesses/{business_id}/valuation: get: tags: - eDiscovery summary: Get Business Valuation description: 'Merged GET: extracted statements + tax-doc signals + lawyer overrides. Auto-fill priority ladders for ``ownership_pct``, ``salary``, ``distributions`` are documented in :mod:`app.modules.familylaw.routes._business_valuation`.' operationId: get_business_valuation_discovery_forensic__dataset_id__businesses__business_id__valuation_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: business_id in: path required: true schema: type: integer title: Business Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BusinessValuationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' put: tags: - eDiscovery summary: Put Business Valuation description: 'Write only the override-bearing fields; auto-fill values stay derived. Field-presence semantics: a field absent from the request is left unchanged; a field explicitly sent as null is CLEARED (override removed, auto-fill resumes). Detected via Pydantic''s ``model_fields_set``. Validates that per-party ownership_pct sums don''t exceed 100 (warn, don''t reject — the lawyer may be intentionally over-allocating during discovery), and that marital is one of the documented enum values (Pydantic enforces this at request validation time). The override writes themselves live in ``services.business_valuation`` — the same code path the Task Assistant''s ``set_business_valuation`` tool writes through.' operationId: put_business_valuation_discovery_forensic__dataset_id__businesses__business_id__valuation_put parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: business_id in: path required: true schema: type: integer title: Business Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BusinessValuationUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BusinessValuationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/businesses/{business_id}/valuation/estimate: delete: tags: - eDiscovery summary: Discard Business Valuation Estimate description: 'Discard the cached LLM estimate (the "Discard" action). Clears ``llm_estimated_valuation`` / ``llm_valuation_basis`` / ``llm_valuation_generated_at`` so a dismissed estimate stops being listed and won''t re-prompt. Leaves ``manual_valuation`` and party overrides untouched — discarding the AI suggestion never disturbs a committed value. No-op if no inputs row exists yet.' operationId: discard_business_valuation_estimate_discovery_forensic__dataset_id__businesses__business_id__valuation_estimate_delete parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: business_id in: path required: true schema: type: integer title: Business Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BusinessValuationResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' post: tags: - eDiscovery summary: Post Business Valuation Estimate description: 'Generate (and cache) an LLM-driven valuation estimate. Pulls the linked financial statements + business profile, calls the valuation model via ``llm_client_v2``, stores the result on ``business_valuation_inputs``, and charges the centralized credit cost. Always returns 200. When none of the core financial statements (income statement, balance sheet, cash flow) exist, returns the envelope with ``status="insufficient_documents"`` and no ``estimate`` (no LLM call, no charge); a partial set proceeds and the model caveats the result.' operationId: post_business_valuation_estimate_discovery_forensic__dataset_id__businesses__business_id__valuation_estimate_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: business_id in: path required: true schema: type: integer title: Business Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BusinessValuationEstimateResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/real-estate/properties: get: tags: - eDiscovery summary: List Rental Properties description: 'List rental properties in this dataset. Each row''s ``ownership_type`` summarizes who owns the property — critical family-law signal: ``"individual"`` is typically a direct marital asset, ``"entity"`` is held inside a pass-through / corporation.' operationId: list_rental_properties_discovery_forensic__dataset_id__real_estate_properties_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Items per page default: 100 title: Page Size description: Items per page - name: ownership_type in: query required: false schema: anyOf: - type: string - type: 'null' description: 'Filter by ownership: ''individual'', ''entity'', ''both'', or ''unknown''.' title: Ownership Type description: 'Filter by ownership: ''individual'', ''entity'', ''both'', or ''unknown''.' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RentalPropertyListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/real-estate/properties/{property_id}: get: tags: - eDiscovery summary: Get Rental Property description: 'Single property with all per-year financials and the source tax documents that contributed them. Year data is ordered most-recent-year-first. ``source_documents`` is the de-duplicated set of ``tax_documents`` rows that produced any year_data snapshot for this property — typically a Form 8825 today, with Schedule E / 1098 / 1099-S / deed scans joining as future PRs land.' operationId: get_rental_property_discovery_forensic__dataset_id__real_estate_properties__property_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: property_id in: path required: true schema: type: integer title: Property Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RentalPropertyDetailResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - eDiscovery summary: Update Rental Property description: 'Attorney-facing partial update of a rental property. Mirrors the residence PATCH: ``estimated_value`` is stamped ``owner_estimate``, appended to ``metadata_ex.valuations``, and propagated to the rental''s balance-sheet row unless locked. Does not lock the property. The row-write itself lives in ``services.asset_details`` — the same code path the Task Assistant''s ``update_asset_details`` tool writes through.' operationId: update_rental_property_discovery_forensic__dataset_id__real_estate_properties__property_id__patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: property_id in: path required: true schema: type: integer title: Property Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RentalPropertyUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RentalPropertyDetailResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/real-estate/residences: get: tags: - eDiscovery summary: List Real Properties description: 'List residences owned by the family in this dataset. Default order: primary residence first (by ``is_primary_residence DESC``), then alphabetically by city + street. The primary residence is unique per dataset (partial unique index on ``is_primary_residence = TRUE``).' operationId: list_real_properties_discovery_forensic__dataset_id__real_estate_residences_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Items per page default: 100 title: Page Size description: Items per page - name: residence_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by 'primary' | 'secondary' | 'vacation' | 'investment' | 'land'. title: Residence Type description: Filter by 'primary' | 'secondary' | 'vacation' | 'investment' | 'land'. - name: ownership_type in: query required: false schema: anyOf: - type: string - type: 'null' description: 'Filter by ownership: ''individual'', ''entity'', ''both'', or ''unknown''.' title: Ownership Type description: 'Filter by ownership: ''individual'', ''entity'', ''both'', or ''unknown''.' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RealPropertyListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/real-estate/residences/{property_id}: get: tags: - eDiscovery summary: Get Real Property description: Single residence with owner relationships eager-loaded. operationId: get_real_property_discovery_forensic__dataset_id__real_estate_residences__property_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: property_id in: path required: true schema: type: integer title: Property Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RealPropertyDetailResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - eDiscovery summary: Update Real Property description: 'Attorney-facing partial update of a residence. Primary use case: filling in ``estimated_value`` for a property the pipeline created from a deed / 1098 with no current value. Also covers identity / classification corrections. Mirrors the vehicle update endpoint (``source="owner_estimate"`` valuations history + balance-sheet sync) and does not lock the property — lock the balance-sheet row to pin a value. The row-write itself lives in ``services.asset_details`` — the same code path the Task Assistant''s ``update_asset_details`` tool writes through.' operationId: update_real_property_discovery_forensic__dataset_id__real_estate_residences__property_id__patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: property_id in: path required: true schema: type: integer title: Property Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RealPropertyUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RealPropertyDetailResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/vehicles: get: tags: - eDiscovery summary: List Vehicles description: 'List vehicles discovered in this dataset. Default order: year DESC (newest first), then make / model alphabetical. The ownership filter joins via EXISTS on ``vehicle_owners`` to keep the semantics aligned with ``ownership_type`` on the response model.' operationId: list_vehicles_discovery_forensic__dataset_id__vehicles_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Items per page default: 100 title: Page Size description: Items per page - name: ownership_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by 'individual', 'entity', 'both', or 'unknown'. title: Ownership Type description: Filter by 'individual', 'entity', 'both', or 'unknown'. - name: has_lien in: query required: false schema: anyOf: - type: boolean - type: 'null' description: Filter by lien state. ``true`` → only financed vehicles; ``false`` → only paid-off (free-and-clear) vehicles. title: Has Lien description: Filter by lien state. ``true`` → only financed vehicles; ``false`` → only paid-off (free-and-clear) vehicles. responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VehicleListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/vehicles/{vehicle_id}: get: tags: - eDiscovery summary: Get Vehicle description: 'Single vehicle with owners + corporate entity eager-loaded. 404s when the vehicle exists in another dataset (cross-dataset access boundary — same ownership check semantics as the real-estate detail endpoint).' operationId: get_vehicle_discovery_forensic__dataset_id__vehicles__vehicle_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: vehicle_id in: path required: true schema: type: integer title: Vehicle Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VehicleDetailResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - eDiscovery summary: Update Vehicle description: 'Attorney-facing partial update of a Vehicle row. Primary use case: filling in ``estimated_value`` for a vehicle the pipeline created from a title only (no KBB / BeenVerified uploaded). The endpoint also covers identity-field corrections (the extractor put ``"MC"`` in ``model`` instead of ``body_type``, the title''s OCR transcribed the VIN wrong, etc.). Per ENG-12939: this endpoint does **not** lock the Vehicle. A later auto-extracted KBB / title with a fresher ``as_of_date`` will run through the standard merge policy and may overwrite the attorney''s entry. Locking is a BSI-level operation only; when the BSI row is locked, this endpoint preserves ``current_amount`` rather than propagating the new valuation. Returns the updated Vehicle row with owners + corporate entity eager-loaded so the UI can re-render without a follow-up GET. The row-write itself lives in ``services.asset_details`` — the same code path the Task Assistant''s ``update_asset_details`` tool writes through.' operationId: update_vehicle_discovery_forensic__dataset_id__vehicles__vehicle_id__patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: vehicle_id in: path required: true schema: type: integer title: Vehicle Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/VehicleUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VehicleDetailResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/balance-sheet/: get: tags: - eDiscovery summary: List Balance Sheet Items description: 'List balance-sheet items in the dataset. Default order: assets first, then by category, then by name. Liabilities follow the same secondary ordering. Soft-deleted rows are excluded unless ``include_inactive=true``.' operationId: list_balance_sheet_items_discovery_forensic__dataset_id__balance_sheet__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Items per page default: 100 title: Page Size description: Items per page - name: kind in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by 'asset' or 'liability' title: Kind description: Filter by 'asset' or 'liability' - name: category in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by category (e.g. 'credit_card') title: Category description: Filter by category (e.g. 'credit_card') - name: owner in: query required: false schema: anyOf: - type: string - type: 'null' description: 'Filter by owner: petitioner / respondent / joint / unknown' title: Owner description: 'Filter by owner: petitioner / respondent / joint / unknown' - name: marital_character in: query required: false schema: anyOf: - type: string - type: 'null' description: 'Filter by marital character: marital / separate / mixed / unknown' title: Marital Character description: 'Filter by marital character: marital / separate / mixed / unknown' - name: include_inactive in: query required: false schema: type: boolean description: Include soft-deleted items default: false title: Include Inactive description: Include soft-deleted items responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BalanceSheetListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/balance-sheet/summary: get: tags: - eDiscovery summary: Get Balance Sheet Summary description: 'Roll-up totals for the dataset''s balance sheet. Soft-deleted rows are excluded. Liability values are returned as positive balances owed; ``net_worth`` is computed as ``total_assets - total_liabilities`` by the response model.' operationId: get_balance_sheet_summary_discovery_forensic__dataset_id__balance_sheet_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BalanceSheetSummaryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/balance-sheet/items/{item_id}: get: tags: - eDiscovery summary: Get Balance Sheet Item description: 'Single balance-sheet item with the secured-by / securing pairing eager-loaded so the UI can render "Mortgage — secures: 12 Ocean View Rd" or "House at 48 Willow Bend (mortgage + HELOC)" inline. Soft-deleted rows return 404 by default — matching the list endpoint''s behaviour — unless ``include_inactive=true`` is passed.' operationId: get_balance_sheet_item_discovery_forensic__dataset_id__balance_sheet_items__item_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: item_id in: path required: true schema: type: integer title: Item Id - name: include_inactive in: query required: false schema: type: boolean description: Return the item even if soft-deleted default: false title: Include Inactive description: Return the item even if soft-deleted responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BalanceSheetItemDetailResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' patch: tags: - eDiscovery summary: Update Balance Sheet Item description: 'Patch a balance-sheet item. Any successful PATCH locks the row (``is_locked=True``) so the AI auto-population activity skips it on subsequent re-ingests. The lock can''t be cleared via this endpoint — soft-delete + re-create is the intended escape hatch for "let the AI take this row back." ``kind`` and ``dataset_id`` are not in the request schema and therefore cannot be changed. ``category`` is allowed to change for misclassification fixes but must remain on the same side as ``kind``.' operationId: update_balance_sheet_item_discovery_forensic__dataset_id__balance_sheet_items__item_id__patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: item_id in: path required: true schema: type: integer title: Item Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BalanceSheetItemUpdateRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BalanceSheetItemResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - eDiscovery summary: Delete Balance Sheet Item description: 'Soft-delete a balance-sheet item. Sets ``is_active=false`` and keeps the row in the DB for audit. The row drops out of list / summary responses by default; ``?include_inactive=true`` surfaces it. Also locks the row so the AI activity doesn''t resurrect it on re-ingest by re-promoting the same upstream entity. Hard delete is intentionally not exposed — restore is a follow-up.' operationId: delete_balance_sheet_item_discovery_forensic__dataset_id__balance_sheet_items__item_id__delete parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: item_id in: path required: true schema: type: integer title: Item Id responses: '204': description: Successful Response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/balance-sheet/items: post: tags: - eDiscovery summary: Create Balance Sheet Item description: 'Create a manual balance-sheet item. Server-set provenance: ``source=''human_entered''``, ``is_locked=True``, ``is_active=True``, ``normalized_dedup_key=NULL`` — manual entries don''t dedup against AI-inferred rows so the attorney can intentionally record a separate row for the same account if needed (e.g. a closed account at the same bank as an active one).' operationId: create_balance_sheet_item_discovery_forensic__dataset_id__balance_sheet_items_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BalanceSheetItemCreateRequest' responses: '201': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BalanceSheetItemResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/balance-sheet/items/{item_id}/restore: post: tags: - eDiscovery summary: Restore Balance Sheet Item description: 'Restore a soft-deleted balance-sheet item. Flips ``is_active=True`` and leaves ``is_locked=True`` — the row keeps its human-in-the-loop lock so the AI activity doesn''t try to overwrite or re-promote it on the next re-ingest. The attorney can re-edit or re-delete from there. Idempotent: restoring an already-active row is a 200 no-op so the UI can hit this endpoint without first checking the row''s state. Returns 404 only when the item doesn''t exist in the dataset at all.' operationId: restore_balance_sheet_item_discovery_forensic__dataset_id__balance_sheet_items__item_id__restore_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: item_id in: path required: true schema: type: integer title: Item Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BalanceSheetItemResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/balance-sheet/schemas: get: tags: - eDiscovery summary: Get Balance Sheet Schemas description: 'Schema-discovery endpoint for the balance-sheet UI. Returns closed-set vocabularies + JSON Schema for the create / update request bodies + per-category typed metadata schemas. Lets the UI build forms generically from the contract instead of hand-coding the field list per category. Auth-gated but otherwise dataset-independent — call once at app startup and reuse.' operationId: get_balance_sheet_schemas_discovery_forensic_balance_sheet_schemas_get responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Get Balance Sheet Schemas Discovery Forensic Balance Sheet Schemas Get /discovery/forensic/{dataset_id}/transactions: patch: tags: - eDiscovery summary: Bulk Update Transactions description: 'Update multiple banking and/or liability transactions in one call. Request body has two lists: `banking` (transactions table) and `liabilities` (liability_transactions table). Each item must include `id`; only provided fields (category, sub_category, beneficiary, merchant_name, notes, is_disputed, dispute_reason) are updated. Transactions are updated only if they belong to the given dataset. On success, a TransactionExportWorkflow is started in the background to regenerate the dataset''s transaction export XLSX.' operationId: bulk_update_transactions_discovery_forensic__dataset_id__transactions_patch parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BulkUpdateTransactionsRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/BulkUpdateTransactionsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/combined: get: tags: - eDiscovery summary: List Combined Transactions description: Filtered, sorted, paginated blend of all banking + liability transactions. operationId: list_combined_transactions_discovery_forensic__dataset_id__transactions_list_combined_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: source in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Restrict to sources: source=banking&source=liabilities (default: both)' title: Source description: 'Restrict to sources: source=banking&source=liabilities (default: both)' - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UnifiedTransactionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/combined/facets: get: tags: - eDiscovery summary: List Combined Facets description: Excel-style facets for the blend (category, beneficiary, type, source). operationId: list_combined_facets_discovery_forensic__dataset_id__transactions_list_combined_facets_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: source in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Restrict to sources: source=banking&source=liabilities (default: both)' title: Source description: 'Restrict to sources: source=banking&source=liabilities (default: both)' - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: type: array items: type: object additionalProperties: true title: Response List Combined Facets Discovery Forensic Dataset Id Transactions List Combined Facets Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/combined/summary: get: tags: - eDiscovery summary: Combined Summary description: Header chip aggregates (total / charges / payments) across the blend. operationId: combined_summary_discovery_forensic__dataset_id__transactions_list_combined_summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: source in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Restrict to sources: source=banking&source=liabilities (default: both)' title: Source description: 'Restrict to sources: source=banking&source=liabilities (default: both)' - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Combined Summary Discovery Forensic Dataset Id Transactions List Combined Summary Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/combined/export.xlsx: get: tags: - eDiscovery summary: Export Combined Xlsx description: Blended ledger as an .xlsx download, mirroring the on-screen grid (+ Source column). operationId: export_combined_xlsx_discovery_forensic__dataset_id__transactions_list_combined_export_xlsx_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: source in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Restrict to sources: source=banking&source=liabilities (default: both)' title: Source description: 'Restrict to sources: source=banking&source=liabilities (default: both)' - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/combined/export.pdf: get: tags: - eDiscovery summary: Export Combined Pdf description: Blended ledger as a formatted PDF report (+ Source column, charge/payment totals). operationId: export_combined_pdf_discovery_forensic__dataset_id__transactions_list_combined_export_pdf_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: source in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: 'Restrict to sources: source=banking&source=liabilities (default: both)' title: Source description: 'Restrict to sources: source=banking&source=liabilities (default: both)' - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/{domain}: get: tags: - eDiscovery summary: List Transactions description: 'Filtered, sorted, paginated transactions for one domain across all accounts (or scoped by account_type / account_id).' operationId: list_transactions_discovery_forensic__dataset_id__transactions_list__domain__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: domain in: path required: true schema: type: string title: Domain - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Scope to one account_type tab (e.g. 'credit_card') title: Account Type description: Scope to one account_type tab (e.g. 'credit_card') - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UnifiedTransactionListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/{domain}/facets: get: tags: - eDiscovery summary: List Transaction Facets description: 'Excel-style facet options (distinct values + counts) for the bounded columns. Each facet is computed excluding its own selection.' operationId: list_transaction_facets_discovery_forensic__dataset_id__transactions_list__domain__facets_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: domain in: path required: true schema: type: string title: Domain - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' title: Account Type - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: type: array items: type: object additionalProperties: true title: Response List Transaction Facets Discovery Forensic Dataset Id Transactions List Domain Facets Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/{domain}/summary: get: tags: - eDiscovery summary: Transaction Summary description: 'Header chip aggregates under the full active filter set (cashflow: charges/payments; investments: fees/symbols/by-type).' operationId: transaction_summary_discovery_forensic__dataset_id__transactions_list__domain__summary_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: domain in: path required: true schema: type: string title: Domain - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' title: Account Type - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Transaction Summary Discovery Forensic Dataset Id Transactions List Domain Summary Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/{domain}/export.xlsx: get: tags: - eDiscovery summary: Export Transactions description: 'Stream every transaction matching the active filters as an .xlsx download. Same filter/sort vocabulary as the list endpoint (so the file mirrors the on-screen grid) but unpaginated. Generated synchronously and streamed — the working set is bounded by ``dataset_id`` (case-size), so it completes well inside the LB idle window without a background job. Nothing is persisted.' operationId: export_transactions_discovery_forensic__dataset_id__transactions_list__domain__export_xlsx_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: domain in: path required: true schema: type: string title: Domain - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' title: Account Type - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/forensic/{dataset_id}/transactions-list/{domain}/export.pdf: get: tags: - eDiscovery summary: Export Transactions Pdf description: 'Stream every transaction matching the active filters as a formatted PDF report. Same filter/sort vocabulary and synchronous, no-persistence model as the xlsx export; adds a header band with the filter-aware summary totals (charges/payments or fees/symbols) for filing/sharing.' operationId: export_transactions_pdf_discovery_forensic__dataset_id__transactions_list__domain__export_pdf_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: domain in: path required: true schema: type: string title: Domain - name: account_type in: query required: false schema: anyOf: - type: string - type: 'null' title: Account Type - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date (YYYY-MM-DD) title: Start Date description: Start date (YYYY-MM-DD) - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date (YYYY-MM-DD) title: End Date description: End date (YYYY-MM-DD) - name: min_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Minimum signed amount title: Min Amount description: Minimum signed amount - name: max_amount in: query required: false schema: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' description: Maximum signed amount title: Max Amount description: Maximum signed amount - name: type in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable, e.g. type=charge&type=payment title: Type description: Repeatable, e.g. type=charge&type=payment - name: category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable category filter title: Category description: Repeatable category filter - name: sub_category in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable sub-category filter title: Sub Category description: Repeatable sub-category filter - name: beneficiary in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Repeatable beneficiary filter title: Beneficiary description: Repeatable beneficiary filter - name: account_id in: query required: false schema: anyOf: - type: array items: type: integer - type: 'null' description: Repeatable account filter (all-accounts views) title: Account Id description: Repeatable account filter (all-accounts views) - name: description_search in: query required: false schema: anyOf: - type: string - type: 'null' description: Keyword search over description + merchant title: Description Search description: Keyword search over description + merchant - name: sort_by in: query required: false schema: type: string description: date | amount | description | category | beneficiary | type | symbol default: date title: Sort By description: date | amount | description | category | beneficiary | type | symbol - name: sort_order in: query required: false schema: type: string description: asc | desc default: desc title: Sort Order description: asc | desc - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 default: 100 title: Page Size responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/upload-url/{dataset_id}: get: tags: - eDiscovery summary: Upload Url description: 'Fetch a presigned URL for uploading files, the UI will take this and upload files directly to the bucket without having to involve us in the process. We will return when the customer tells us they want to import whatever they have uploaded using our import route. The SAS token expires after SAS_EXPIRATION_HOURS. For long-running bulk uploads, the UI can call this endpoint again to get a fresh token before the current one expires.' operationId: upload_url_discovery_upload_url__dataset_id__get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UploadResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/download: get: tags: - eDiscovery summary: Download File description: 'Allow the customer to download the original file that they uploaded. For doc-hub backed timeline events, pass doc_hub_doc_id to route the download through DocHub storage instead of the dataset''s ediscovery container. HEAD requests return a simple JSON response indicating if the file exists. GET requests stream the file for download.' operationId: download_file_discovery_download_get parameters: - name: filename in: query required: true schema: type: string title: Filename - name: doc_hub_doc_id in: query required: false schema: anyOf: - type: string - type: 'null' title: Doc Hub Doc Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' head: tags: - eDiscovery summary: Download File description: 'Allow the customer to download the original file that they uploaded. For doc-hub backed timeline events, pass doc_hub_doc_id to route the download through DocHub storage instead of the dataset''s ediscovery container. HEAD requests return a simple JSON response indicating if the file exists. GET requests stream the file for download.' operationId: download_file_discovery_download_head parameters: - name: filename in: query required: true schema: type: string title: Filename - name: doc_hub_doc_id in: query required: false schema: anyOf: - type: string - type: 'null' title: Doc Hub Doc Id responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/exports: get: tags: - eDiscovery summary: List Dataset Exports description: 'List the downloadable exports for a dataset, newest first. Hybrid lookup: 1. **DocHub-tagged exports** — query ``DocMetadata`` rows whose ``additional_info`` contains ``{"dataset_id": , "export_type": ...}``. Returned with a populated ``doc_hub_doc_id`` and a ``download_url`` wired to the existing ``/discovery/download?doc_hub_doc_id=...`` route. That route resolves the blob via ``DocMetadata.location``, which is the blob path *at upload time* — so dataset renames don''t break the link. 2. **Legacy fallback** — if no DocMetadata rows match, list Azure blobs under ``{dataset_id}/.export/`` in the dataset''s container. Each blob becomes an entry with ``doc_hub_doc_id=None`` and a ``download_url`` pointing at ``/discovery/download?filename=...`` (the original keyed-by-filename path). Pre-DocHub datasets stay discoverable without backfill. The FE doesn''t have to branch on which variant it got — it hits the pre-built ``download_url`` either way.' operationId: list_dataset_exports_discovery_dataset__dataset_id__exports_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: export_type in: query required: false schema: anyOf: - type: string - type: 'null' description: Optional discriminator filter — e.g. 'master_transaction_export'. When omitted, returns every tagged export for the dataset. title: Export Type description: Optional discriminator filter — e.g. 'master_transaction_export'. When omitted, returns every tagged export for the dataset. responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/DatasetExportEntry' title: Response List Dataset Exports Discovery Dataset Dataset Id Exports Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/document/browser: get: tags: - eDiscovery summary: Dataset File View description: 'Build a paged response view object that contains the Document records that are part of the given dataset and its parent dataset (if one exists) so that the user can browse what files they''ve uploaded. Supports optional filename search.' operationId: dataset_file_view_discovery_dataset__dataset_id__document_browser_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: page in: query required: false schema: type: integer minimum: 1 default: 1 title: Page - name: page_size in: query required: false schema: type: integer maximum: 100 minimum: 1 default: 50 title: Page Size - name: search in: query required: false schema: anyOf: - type: string - type: 'null' description: Search by filename (partial match) title: Search description: Search by filename (partial match) responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PagedResponse_DocumentResponse_' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/document/delete: post: tags: - eDiscovery summary: Dataset File Delete description: Delete documents from a dataset. operationId: dataset_file_delete_discovery_dataset__dataset_id__document_delete_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DocumentDeleteRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/alert/unsupported: post: tags: - eDiscovery summary: Dataset Alert Unsupported Files description: Log when users attempt to upload unsupported file types. operationId: dataset_alert_unsupported_files_discovery_dataset__dataset_id__alert_unsupported_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DatasetUnsupportedFiles' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/dataset/{dataset_id}/file/attachments: post: tags: - eDiscovery summary: Dataset File Attach description: 'Attach a file to a dataset by uploading it to Azure Blob Storage and creating an attachment record. Files are stored in the path: {dataset_id}/attachments/{filename}' operationId: dataset_file_attach_discovery_dataset__dataset_id__file_attachments_post parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id requestBody: required: true content: multipart/form-data: schema: $ref: '#/components/schemas/Body_dataset_file_attach_discovery_dataset__dataset_id__file_attachments_post' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DatasetAttachFileResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - eDiscovery summary: Dataset File Attachments description: 'Get all file attachments for a given dataset. Returns a list of attachment records with their IDs and filenames.' operationId: dataset_file_attachments_discovery_dataset__dataset_id__file_attachments_get parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/DatasetAttachFileResponse' title: Response Dataset File Attachments Discovery Dataset Dataset Id File Attachments Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /discovery/settings/criteria: get: tags: - eDiscovery summary: Contract Dataset Criteria description: 'This is a slightly non-dataset "scoring" route to send back all the optional scoring criteria to the user, this may include custom scoring criteria in the future. For now, it will just dump all the scoring criteria in the database.' operationId: contract_dataset_criteria_discovery_settings_criteria_get responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/DatasetCriteriaResponse' type: array title: Response Contract Dataset Criteria Discovery Settings Criteria Get components: schemas: TimelineMetadata: properties: original_size_bytes: type: integer title: Original Size Bytes description: Original uncompressed size in bytes compressed_size_bytes: type: integer title: Compressed Size Bytes description: Compressed size in bytes compression_ratio: type: number title: Compression Ratio description: Compression ratio (compressed/original) type: object required: - original_size_bytes - compressed_size_bytes - compression_ratio title: TimelineMetadata description: Metadata about the timeline response. BalanceSheetItemCreateRequest: properties: kind: type: string enum: - asset - liability title: Kind category: anyOf: - type: string enum: - bank_account - investment - retirement - real_property - vehicle - business_interest - life_insurance - crypto - other_asset - type: string enum: - mortgage - heloc - credit_card - personal_loan - vehicle_loan - student_loan - tax_liability - medical_debt - other_liability title: Category name: type: string maxLength: 255 minLength: 1 title: Name institution_name: anyOf: - type: string maxLength: 255 - type: 'null' title: Institution Name account_last4: anyOf: - type: string maxLength: 8 - type: 'null' title: Account Last4 description: anyOf: - type: string - type: 'null' title: Description current_amount: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Current Amount as_of_date: anyOf: - type: string format: date - type: 'null' title: As Of Date acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_amount: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Amount owner: type: string enum: - petitioner - respondent - joint - unknown title: Owner default: unknown marital_character: type: string enum: - marital - separate - mixed - unknown title: Marital Character default: unknown secured_by_item_id: anyOf: - type: integer - type: 'null' title: Secured By Item Id is_disputed: type: boolean title: Is Disputed default: false dispute_notes: anyOf: - type: string - type: 'null' title: Dispute Notes notes: anyOf: - type: string - type: 'null' title: Notes metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex additionalProperties: false type: object required: - kind - category - name title: BalanceSheetItemCreateRequest description: 'Body for ``POST /balance-sheet/items`` — manual entry from the UI. Server-set fields (``source=''human_entered''``, ``is_locked=True``, ``is_active=True``, ``normalized_dedup_key=NULL``) are intentionally not part of this schema so a client cannot spoof an AI-inferred row or pin a dedup key that would collide with future auto-population. Back-link fields (``rental_property_id``, ``real_property_id``, etc.) are also omitted — those are only set by the AI activity. The UI can still record a free-form association via ``description`` / ``metadata_ex``.' AccountSummaryResponse: properties: account_id: type: integer title: Account Id account_name: anyOf: - type: string - type: 'null' title: Account Name account_number_masked: anyOf: - type: string - type: 'null' title: Account Number Masked current_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Current Balance available_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Available Balance transaction_count: type: integer title: Transaction Count default: 0 total_credits: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Credits default: '0.00' total_debits: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Debits default: '0.00' net_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Amount default: '0.00' first_transaction_date: anyOf: - type: string format: date-time - type: 'null' title: First Transaction Date last_transaction_date: anyOf: - type: string format: date-time - type: 'null' title: Last Transaction Date activity_period_days: anyOf: - type: integer - type: 'null' title: Activity Period Days readOnly: true type: object required: - account_id - activity_period_days title: AccountSummaryResponse description: Summary statistics for an account SoFVersionDetail: properties: id: type: integer title: Id title: type: string title: Title is_default: type: boolean title: Is Default writing_style: type: string title: Writing Style focus_area_tags: items: type: string type: array title: Focus Area Tags deep_analysis: type: boolean title: Deep Analysis analyze_for: items: type: string type: array title: Analyze For num_events: type: integer title: Num Events num_exhibits: type: integer title: Num Exhibits date_start: anyOf: - type: string format: date - type: 'null' title: Date Start date_end: anyOf: - type: string format: date - type: 'null' title: Date End timeline_sync: type: boolean title: Timeline Sync generated_at: anyOf: - type: string format: date-time - type: 'null' title: Generated At content: anyOf: - type: string - type: 'null' title: Content legal_analysis: anyOf: - type: string - type: 'null' title: Legal Analysis facts_summary: anyOf: - type: string - type: 'null' title: Facts Summary report_path: anyOf: - type: string - type: 'null' title: Report Path exhibits: additionalProperties: true type: object title: Exhibits relevance_levels: items: type: string type: array title: Relevance Levels favorability: items: type: string type: array title: Favorability filter_start_date: anyOf: - type: string format: date - type: 'null' title: Filter Start Date filter_end_date: anyOf: - type: string format: date - type: 'null' title: Filter End Date event_limit: anyOf: - type: integer - type: 'null' title: Event Limit type: object required: - id - title - is_default - writing_style - focus_area_tags - deep_analysis - analyze_for - num_events - num_exhibits - date_start - date_end - timeline_sync - generated_at - content - legal_analysis - facts_summary - report_path title: SoFVersionDetail description: Full version incl. generated content (detail/preview). InvestigationTypeInfo: properties: type: type: string title: Type description: Investigation type identifier name: type: string title: Name description: Human-readable name description: type: string title: Description description: Description of what this investigation type searches for type: object required: - type - name - description title: InvestigationTypeInfo description: Information about an investigation type. DatasetTemporalJobsResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id workflow_id: type: string title: Workflow Id run_id: type: string title: Run Id workflow_name: type: string title: Workflow Name started_at: type: string format: date-time title: Started At finished_at: anyOf: - type: string format: date-time - type: 'null' title: Finished At status: type: string title: Status cached_status: anyOf: - items: additionalProperties: true type: object type: array - type: 'null' title: Cached Status error_message: anyOf: - type: string - type: 'null' title: Error Message type: object required: - id - dataset_id - workflow_id - run_id - workflow_name - started_at - finished_at - status title: DatasetTemporalJobsResponse description: Response model for Temporal workflow jobs associated with datasets. TransactionResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id account_id: type: integer title: Account Id document_id: type: integer title: Document Id transaction_date: type: string format: date-time title: Transaction Date posted_date: anyOf: - type: string format: date-time - type: 'null' title: Posted Date amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Amount running_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Running Balance description_raw: type: string title: Description Raw description_cleaned: anyOf: - type: string - type: 'null' title: Description Cleaned merchant_name: anyOf: - type: string - type: 'null' title: Merchant Name category: anyOf: - type: string - type: 'null' title: Category sub_category: anyOf: - type: string - type: 'null' title: Sub Category beneficiary: anyOf: - type: string - type: 'null' title: Beneficiary transaction_type: anyOf: - type: string - type: 'null' title: Transaction Type transaction_status: anyOf: - type: string - type: 'null' title: Transaction Status transaction_id: anyOf: - type: string - type: 'null' title: Transaction Id confirmation_number: anyOf: - type: string - type: 'null' title: Confirmation Number reference_number: anyOf: - type: string - type: 'null' title: Reference Number location: anyOf: - type: string - type: 'null' title: Location channel: anyOf: - type: string - type: 'null' title: Channel source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id notes: anyOf: - type: string - type: 'null' title: Notes is_disputed: type: boolean title: Is Disputed default: false dispute_reason: anyOf: - type: string - type: 'null' title: Dispute Reason metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex account: anyOf: - $ref: '#/components/schemas/FinancialAccountResponse' - type: 'null' display_description: type: string title: Display Description readOnly: true is_debit: type: boolean title: Is Debit readOnly: true is_credit: type: boolean title: Is Credit readOnly: true amount_abs: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Amount Abs readOnly: true formatted_amount: type: string title: Formatted Amount readOnly: true transaction_direction: type: string title: Transaction Direction readOnly: true has_investigation_flags: type: boolean title: Has Investigation Flags description: Check if transaction has investigation flags in metadata_ex readOnly: true matched_check_id: anyOf: - type: integer - type: 'null' title: Matched Check Id description: ID of the check image reconciled to this transaction (click-through), if any. readOnly: true matched_deposit_slip_id: anyOf: - type: integer - type: 'null' title: Matched Deposit Slip Id description: ID of the deposit slip reconciled to this transaction (click-through), if any. readOnly: true has_check_image: type: boolean title: Has Check Image description: True when a check or deposit-slip image is linked to this transaction. readOnly: true type: object required: - id - dataset_id - account_id - document_id - transaction_date - amount - description_raw - display_description - is_debit - is_credit - amount_abs - formatted_amount - transaction_direction - has_investigation_flags - matched_check_id - matched_deposit_slip_id - has_check_image title: TransactionResponse description: Response model for transactions TaxPayerUpdateRequest: properties: id: anyOf: - type: integer - type: 'null' title: Id primary_name: type: string title: Primary Name address: anyOf: - type: string - type: 'null' title: Address phone: anyOf: - type: string - type: 'null' title: Phone spouse_role: anyOf: - type: string - type: 'null' title: Spouse Role type: object required: - primary_name title: TaxPayerUpdateRequest description: 'Request model for creating or updating a taxpayer via API. Note: Fields like tax_document_id, primary_ssn_status, spouse_name, spouse_ssn_status, filing_status, and exemptions are only populated from scanned documents (W-2s, 1040s, etc.) and cannot be set via API. They are automatically updated when documents are processed. ``spouse_role`` IS user-settable (unlike the document-only fields above): send ''husband''/''wife'' to designate a party''s column on a gendered affidavit form, or null to clear it back to blank. Omit the field to leave the stored value unchanged.' RunningWorkflowInfo: properties: workflow_id: type: string title: Workflow Id description: Temporal workflow ID investigation_type: type: string title: Investigation Type description: Type of investigation status: type: string title: Status description: Current workflow status start_time: anyOf: - type: string - type: 'null' title: Start Time description: ISO format timestamp when workflow started elapsed_seconds: anyOf: - type: number - type: 'null' title: Elapsed Seconds description: Number of seconds the workflow has been running type: object required: - workflow_id - investigation_type - status title: RunningWorkflowInfo description: Information about a running investigation workflow. LiabilityTransactionResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id account_id: type: integer title: Account Id description: ID of the liability account document_id: type: integer title: Document Id description: ID of the source document payment_date: type: string format: date-time title: Payment Date description: Date of the transaction payment_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Payment Amount description: Transaction amount (negative for payments/credits, positive for charges) payment_type: anyOf: - type: string - type: 'null' title: Payment Type description: Type of transaction (payment, charge, refund, fee, interest, etc.) principal_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Principal Amount description: Principal portion of payment for loans interest_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Interest Amount description: Interest portion of payment for loans fees_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Fees Amount description: Fees portion of the transaction escrow_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Escrow Amount description: Escrow portion for mortgage payments description_raw: anyOf: - type: string - type: 'null' title: Description Raw description: Raw transaction description as it appears on statement description_cleaned: anyOf: - type: string - type: 'null' title: Description Cleaned description: Cleaned and normalized transaction description merchant_name: anyOf: - type: string - type: 'null' title: Merchant Name description: Name of the merchant or payee category: anyOf: - type: string - type: 'null' title: Category description: Transaction category (groceries, gas, utilities, etc.) sub_category: anyOf: - type: string - type: 'null' title: Sub Category description: Transaction sub-category within the category beneficiary: anyOf: - type: string - type: 'null' title: Beneficiary description: Beneficiary (CHILD, ADULT, HOUSEHOLD, GENERAL, or account holder name) remaining_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Remaining Balance description: Remaining balance after this transaction confirmation_number: anyOf: - type: string - type: 'null' title: Confirmation Number description: Transaction confirmation or reference number reference_number: anyOf: - type: string - type: 'null' title: Reference Number description: Internal reference number location: anyOf: - type: string - type: 'null' title: Location description: Transaction location or address payment_method: anyOf: - type: string - type: 'null' title: Payment Method description: Payment method used (online, check, auto-pay, etc.) payment_status: anyOf: - type: string - type: 'null' title: Payment Status description: Payment status (completed, pending, failed, etc.) late_fee: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Late Fee description: Late fee amount if applicable source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id description: Source node ID from document processing notes: anyOf: - type: string - type: 'null' title: Notes description: Additional notes or comments is_disputed: type: boolean title: Is Disputed description: Whether the transaction is disputed default: false dispute_reason: anyOf: - type: string - type: 'null' title: Dispute Reason description: Reason for the dispute metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex description: Extended metadata (e.g., investigation flags) account: anyOf: - $ref: '#/components/schemas/LiabilityAccountResponse' - type: 'null' display_description: type: string title: Display Description readOnly: true formatted_payment_amount: type: string title: Formatted Payment Amount readOnly: true is_payment: type: boolean title: Is Payment readOnly: true is_charge: type: boolean title: Is Charge readOnly: true is_fee: type: boolean title: Is Fee readOnly: true principal_percent: anyOf: - type: number - type: 'null' title: Principal Percent readOnly: true interest_percent: anyOf: - type: number - type: 'null' title: Interest Percent readOnly: true total_breakdown_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Breakdown Amount description: Sum of all breakdown components readOnly: true breakdown_matches_total: type: boolean title: Breakdown Matches Total description: Check if breakdown components add up to total payment amount readOnly: true has_late_fee: type: boolean title: Has Late Fee readOnly: true transaction_direction: type: string title: Transaction Direction description: Human-readable direction of the transaction readOnly: true has_investigation_flags: type: boolean title: Has Investigation Flags description: Check if transaction has investigation flags in metadata_ex readOnly: true type: object required: - id - dataset_id - account_id - document_id - payment_date - payment_amount - display_description - formatted_payment_amount - is_payment - is_charge - is_fee - principal_percent - interest_percent - total_breakdown_amount - breakdown_matches_total - has_late_fee - transaction_direction - has_investigation_flags title: LiabilityTransactionResponse description: Response model for liability transactions TaxCreditListResponse: properties: credits: items: $ref: '#/components/schemas/TaxCreditResponse' type: array title: Credits total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_credit_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Credit Amount readOnly: true type: object required: - credits - total - total_pages - total_credit_amount title: TaxCreditListResponse description: List response for tax credits ValidationReportListResponse: properties: reports: items: $ref: '#/components/schemas/TaxYearValidationReport' type: array title: Reports total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true years_validated: items: type: integer type: array title: Years Validated readOnly: true total_audit_issues: type: integer title: Total Audit Issues readOnly: true type: object required: - reports - total - total_pages - years_validated - total_audit_issues title: ValidationReportListResponse description: List response for validation reports RealPropertyResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id business_id: anyOf: - type: integer - type: 'null' title: Business Id business: anyOf: - $ref: '#/components/schemas/BusinessResponse' - type: 'null' owners: items: $ref: '#/components/schemas/RealPropertyOwnerResponse' type: array title: Owners default: [] description: anyOf: - type: string - type: 'null' title: Description address_full: anyOf: - type: string - type: 'null' title: Address Full street_number: anyOf: - type: integer - type: 'null' title: Street Number street_name: anyOf: - type: string - type: 'null' title: Street Name city: anyOf: - type: string - type: 'null' title: City state: anyOf: - type: string - type: 'null' title: State zip: anyOf: - type: string - type: 'null' title: Zip normalized_address_key: anyOf: - type: string - type: 'null' title: Normalized Address Key is_primary_residence: type: boolean title: Is Primary Residence default: false residence_type: anyOf: - type: string enum: - primary - secondary - vacation - investment - land - type: 'null' title: Residence Type acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price sold_date: anyOf: - type: string format: date - type: 'null' title: Sold Date sale_proceeds: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Sale Proceeds estimated_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of estimated_value_source: anyOf: - type: string - type: 'null' title: Estimated Value Source mortgage_holder: anyOf: - type: string - type: 'null' title: Mortgage Holder mortgage_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Mortgage Balance source_description: anyOf: - type: string - type: 'null' title: Source Description metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At ownership_type: type: string enum: - individual - entity - both - unknown title: Ownership Type description: 'Single-field summary of who owns this property. ``individual`` = at least one natural-person owner; ``entity`` = held inside a business (trust / LLC / S-Corp); ``both`` = a mix (a person plus a trust/entity on the deed, etc.); ``unknown`` = no owners attached yet. Entity-role owners (``corporate`` / ``trust``) are the business itself and don''t count as individuals — otherwise a deed naming only the company would read as ``both``. A ``corporate`` / ``trust`` owner row counts as entity ownership even when the property hasn''t been linked to a ``businesses`` row yet (deed-scan-only state).' readOnly: true primary_owner_name: anyOf: - type: string - type: 'null' title: Primary Owner Name description: 'Convenience: the single name the UI shows when it can''t fit the full owners list. Prefers the borrower (mortgage co-signor = strongest ownership signal), then primary_filer, then highest ownership_percentage, then first owner by id. The UI should still render the full ``owners`` list when space allows — this is the compact-cell fallback only.' readOnly: true type: object required: - id - dataset_id - created_at - updated_at - ownership_type - primary_owner_name title: RealPropertyResponse description: 'A residence / parcel the family owns — primary, secondary, vacation, or land. The ownership-driven counterpart to ``RentalPropertyResponse``. Same identity fields so the UI can render both in a unified real-estate list, but the rental-specific year_data isn''t carried here. ``is_primary_residence`` is true for at most one property per dataset (enforced by a partial unique index in the migration). ``residence_type`` is a closed-set classification. ``owners`` carries the many-to-many ownership relation — multiple rows for joint spouses, trusts, etc.' MerchantSpendingSummary: properties: merchant_id: type: integer title: Merchant Id merchant_name: type: string title: Merchant Name merchant_type: anyOf: - type: string - type: 'null' title: Merchant Type transaction_count: type: integer title: Transaction Count default: 0 total_spending: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Spending default: '0.00' average_transaction: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Transaction default: '0.00' first_transaction: anyOf: - type: string format: date-time - type: 'null' title: First Transaction last_transaction: anyOf: - type: string format: date-time - type: 'null' title: Last Transaction spending_frequency_days: anyOf: - type: number - type: 'null' title: Spending Frequency Days readOnly: true type: object required: - merchant_id - merchant_name - spending_frequency_days title: MerchantSpendingSummary description: Summary statistics for merchant spending ExpenseTypeSummary: properties: expense_type: type: string title: Expense Type transaction_count: type: integer title: Transaction Count default: 0 total_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Amount default: '0.00' average_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Amount default: '0.00' min_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Min Amount default: '0.00' max_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Max Amount default: '0.00' unique_merchants: type: integer title: Unique Merchants default: 0 date_range_start: anyOf: - type: string format: date-time - type: 'null' title: Date Range Start date_range_end: anyOf: - type: string format: date-time - type: 'null' title: Date Range End monthly_average: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Monthly Average readOnly: true type: object required: - expense_type - monthly_average title: ExpenseTypeSummary description: Summary statistics for a specific expense type IncomeRecordResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id tax_document_id: type: integer title: Tax Document Id taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id employer_id: anyOf: - type: integer - type: 'null' title: Employer Id income_type: type: string title: Income Type gross_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Gross Amount net_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Net Amount income_period_start: anyOf: - type: string format: date-time - type: 'null' title: Income Period Start income_period_end: anyOf: - type: string format: date-time - type: 'null' title: Income Period End pay_frequency: anyOf: - type: string - type: 'null' title: Pay Frequency payer_name: anyOf: - type: string - type: 'null' title: Payer Name payer_ein_last4: anyOf: - type: string - type: 'null' title: Payer Ein Last4 payer_address: anyOf: - type: string - type: 'null' title: Payer Address federal_tax_withheld: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Federal Tax Withheld state_tax_withheld: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: State Tax Withheld social_security_tax: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Social Security Tax medicare_tax: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Medicare Tax other_withholdings: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Other Withholdings description: anyOf: - type: string - type: 'null' title: Description box_numbers: anyOf: - additionalProperties: anyOf: - type: string - type: integer - type: number - type: 'null' type: object - type: string - type: integer - type: number - type: 'null' title: Box Numbers information_only: type: boolean title: Information Only default: false taxpayer: anyOf: - $ref: '#/components/schemas/datamodels__discovery__forensic__income__TaxPayerResponse' - type: 'null' employer: anyOf: - $ref: '#/components/schemas/EmployerResponse' - type: 'null' display_payer: type: string title: Display Payer readOnly: true formatted_gross_amount: type: string title: Formatted Gross Amount readOnly: true formatted_net_amount: anyOf: - type: string - type: 'null' title: Formatted Net Amount readOnly: true total_tax_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Withheld readOnly: true total_payroll_taxes: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Payroll Taxes readOnly: true total_withholdings: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Withholdings readOnly: true estimated_annual_income: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Annual Income description: Calculate estimated annual income based on pay frequency readOnly: true effective_tax_rate: anyOf: - type: number - type: 'null' title: Effective Tax Rate description: Calculate effective tax rate from withholdings readOnly: true period_length_days: anyOf: - type: integer - type: 'null' title: Period Length Days readOnly: true type: object required: - id - dataset_id - tax_document_id - income_type - gross_amount - display_payer - formatted_gross_amount - formatted_net_amount - total_tax_withheld - total_payroll_taxes - total_withholdings - estimated_annual_income - effective_tax_rate - period_length_days title: IncomeRecordResponse description: Response model for income records PagedResponse_DocumentResponse_: properties: items: items: $ref: '#/components/schemas/DocumentResponse' type: array title: Items pagination: $ref: '#/components/schemas/PaginationMeta' type: object required: - items - pagination title: PagedResponse[DocumentResponse] DailyBankingDataPoint: properties: date: type: string title: Date deposits: type: string title: Deposits withdrawals: type: string title: Withdrawals net_change: type: string title: Net Change transaction_count: type: integer title: Transaction Count type: object required: - date - deposits - withdrawals - net_change - transaction_count title: DailyBankingDataPoint description: Daily banking activity data point BalanceSheetItemResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id kind: type: string enum: - asset - liability title: Kind category: anyOf: - type: string enum: - bank_account - investment - retirement - real_property - vehicle - business_interest - life_insurance - crypto - other_asset - type: string enum: - mortgage - heloc - credit_card - personal_loan - vehicle_loan - student_loan - tax_liability - medical_debt - other_liability title: Category name: type: string title: Name institution_name: anyOf: - type: string - type: 'null' title: Institution Name account_last4: anyOf: - type: string - type: 'null' title: Account Last4 description: anyOf: - type: string - type: 'null' title: Description current_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Current Amount as_of_date: anyOf: - type: string format: date - type: 'null' title: As Of Date acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Amount owner: type: string enum: - petitioner - respondent - joint - unknown title: Owner marital_character: type: string enum: - marital - separate - mixed - unknown title: Marital Character source: type: string enum: - ai_inferred - human_entered title: Source source_tax_document_id: anyOf: - type: integer - type: 'null' title: Source Tax Document Id source_description: anyOf: - type: string - type: 'null' title: Source Description is_locked: type: boolean title: Is Locked normalized_dedup_key: anyOf: - type: string - type: 'null' title: Normalized Dedup Key secured_by_item_id: anyOf: - type: integer - type: 'null' title: Secured By Item Id rental_property_id: anyOf: - type: integer - type: 'null' title: Rental Property Id business_id: anyOf: - type: integer - type: 'null' title: Business Id financial_account_id: anyOf: - type: integer - type: 'null' title: Financial Account Id investment_account_id: anyOf: - type: integer - type: 'null' title: Investment Account Id liability_account_id: anyOf: - type: integer - type: 'null' title: Liability Account Id is_disputed: type: boolean title: Is Disputed dispute_notes: anyOf: - type: string - type: 'null' title: Dispute Notes is_active: type: boolean title: Is Active notes: anyOf: - type: string - type: 'null' title: Notes metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At type: object required: - id - dataset_id - kind - category - name - owner - marital_character - source - is_locked - is_disputed - is_active - created_at - updated_at title: BalanceSheetItemResponse description: 'A single balance-sheet item — the row shape returned by list + detail. All money lives on ``current_amount``; the ``kind`` discriminator picks the sign at the consumer (assets count positive, liabilities count negative toward net worth). The dollar value itself is always stored as a positive amount.' BeneficiarySpendRow: properties: beneficiary: type: string title: Beneficiary description: Beneficiary (CHILD, ADULT, HOUSEHOLD, GENERAL) transaction_count: type: integer title: Transaction Count description: Number of transactions total_spend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Spend description: Total spend percent_transactions: type: number title: Percent Transactions description: Percentage of all transactions percent_spend: anyOf: - type: number - type: 'null' title: Percent Spend description: Percentage of total spend; null for Non-Expense/Clearing categories type: object required: - beneficiary - transaction_count - total_spend - percent_transactions title: BeneficiarySpendRow description: Spend and count for one beneficiary within a category. EmployerIncomeSummary: properties: employer_id: type: integer title: Employer Id employer_name: type: string title: Employer Name total_gross_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Gross Income default: '0.00' total_net_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Net Income default: '0.00' total_tax_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Withheld default: '0.00' income_record_count: type: integer title: Income Record Count default: 0 first_payment_date: anyOf: - type: string format: date-time - type: 'null' title: First Payment Date last_payment_date: anyOf: - type: string format: date-time - type: 'null' title: Last Payment Date average_payment: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Payment readOnly: true type: object required: - employer_id - employer_name - average_payment title: EmployerIncomeSummary description: Summary statistics for employer income AccountValueListResponse: properties: values: items: $ref: '#/components/schemas/AccountValueResponse' type: array title: Values total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_ending_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Ending Value readOnly: true total_contributions: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Contributions readOnly: true total_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Income readOnly: true type: object required: - values - total - total_pages - total_ending_value - total_contributions - total_income title: AccountValueListResponse description: List response for account values ExpenseLineItemListResponse: properties: line_items: items: $ref: '#/components/schemas/ExpenseLineItemResponse' type: array title: Line Items total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Value readOnly: true type: object required: - line_items - total - total_pages - total_value title: ExpenseLineItemListResponse description: List response for expense line items DependentResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id tax_document_id: anyOf: - type: integer - type: 'null' title: Tax Document Id full_name: type: string title: Full Name date_of_birth: anyOf: - type: string format: date-time - type: 'null' title: Date Of Birth relationship_type: anyOf: - type: string - type: 'null' title: Relationship Type months_lived_with_taxpayer: anyOf: - type: integer - type: 'null' title: Months Lived With Taxpayer childcare_expenses: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Childcare Expenses childcare_provider_name: anyOf: - type: string - type: 'null' title: Childcare Provider Name educational_expenses: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Educational Expenses is_case_dependent: type: boolean title: Is Case Dependent default: true belongs_to_party: anyOf: - type: string - type: 'null' title: Belongs To Party petitioner_relationship: anyOf: - type: string - type: 'null' title: Petitioner Relationship respondent_relationship: anyOf: - type: string - type: 'null' title: Respondent Relationship parenting_time_percent: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Parenting Time Percent monthly_childcare_costs: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Monthly Childcare Costs monthly_child_support_payment: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Monthly Child Support Payment special_needs: type: boolean title: Special Needs default: false sex: anyOf: - type: string - type: 'null' title: Sex type: object required: - id - dataset_id - full_name title: DependentResponse description: Response model for dependents datamodels__discovery__forensic__investments__AccountSummary: properties: account_id: type: integer title: Account Id account_name: anyOf: - type: string - type: 'null' title: Account Name account_type: anyOf: - type: string - type: 'null' title: Account Type account_number_masked: anyOf: - type: string - type: 'null' title: Account Number Masked current_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Current Value default: '0.00' cash_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Cash Balance default: '0.00' closed_at: anyOf: - type: string format: date-time - type: 'null' title: Closed At total_contributions: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Contributions default: '0.00' total_withdrawals: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Withdrawals default: '0.00' total_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Income default: '0.00' unrealized_gains_losses: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Unrealized Gains Losses default: '0.00' holdings_count: type: integer title: Holdings Count default: 0 transactions_count: type: integer title: Transactions Count default: 0 net_contributions: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Contributions readOnly: true total_return: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Return readOnly: true type: object required: - account_id - net_contributions - total_return title: AccountSummary description: Summary statistics for an investment account ContractTypeScores: properties: criteria: type: integer title: Criteria grades: $ref: '#/components/schemas/ContractGrade' type: object required: - criteria - grades title: ContractTypeScores description: Return grades based on the specific critiria. datamodels__discovery__forensic__investigation__TimelineEventResponse: properties: date: type: string title: Date description: Date or date range (YYYY-MM-DD) event_type: type: string title: Event Type description: 'Type of event: pattern_start, cluster, escalation, etc.' description: type: string title: Description description: What happened on this date transaction_count: type: integer title: Transaction Count description: Number of transactions involved default: 0 total_amount: type: number title: Total Amount description: Total amount involved default: 0.0 type: object required: - date - event_type - description title: TimelineEventResponse description: Response model for timeline events. DatasetUnsupportedFiles: properties: extensions: items: type: string type: array title: Extensions type: object title: DatasetUnsupportedFiles BankingTransactionUpdate: properties: id: type: integer title: Id description: Transaction ID (from transactions table) category: anyOf: - type: string - type: 'null' title: Category description: Expense category (e.g. Transportation) sub_category: anyOf: - type: string - type: 'null' title: Sub Category description: Expense sub-category (e.g. Gas) beneficiary: anyOf: - type: string - type: 'null' title: Beneficiary description: Beneficiary (e.g. CHILD, ADULT, or full name) merchant_name: anyOf: - type: string - type: 'null' title: Merchant Name description: Merchant or payee name notes: anyOf: - type: string - type: 'null' title: Notes description: Investigator notes is_disputed: anyOf: - type: boolean - type: 'null' title: Is Disputed description: Whether the transaction is disputed dispute_reason: anyOf: - type: string - type: 'null' title: Dispute Reason description: Reason for dispute if disputed type: object required: - id title: BankingTransactionUpdate description: Payload to update a single banking transaction. Only provided fields are updated. LiabilityAccountListResponse: properties: accounts: items: $ref: '#/components/schemas/LiabilityAccountResponse' type: array title: Accounts total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true active_accounts: type: integer title: Active Accounts readOnly: true loan_accounts: type: integer title: Loan Accounts readOnly: true credit_card_accounts: type: integer title: Credit Card Accounts readOnly: true mortgage_accounts: type: integer title: Mortgage Accounts readOnly: true type: object required: - accounts - total - total_pages - active_accounts - loan_accounts - credit_card_accounts - mortgage_accounts title: LiabilityAccountListResponse description: List response for liability accounts HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError DatasetFillFormResponse: properties: filled_form: additionalProperties: true type: object title: Filled Form validation_issues: items: type: string type: array title: Validation Issues type: object required: - filled_form title: DatasetFillFormResponse ContractScoreResponse: properties: filters: $ref: '#/components/schemas/ContractFilters' revenue: items: $ref: '#/components/schemas/CategoryScores' type: array title: Revenue non_revenue: items: $ref: '#/components/schemas/CategoryScores' type: array title: Non Revenue type: object required: - filters - revenue - non_revenue title: ContractScoreResponse description: The aggregate scores of all non-revenue and revenue contracts in a nice big list for the UI. DependentListUpdateRequest: properties: dependents: items: $ref: '#/components/schemas/DependentUpdateRequest' type: array title: Dependents type: object required: - dependents title: DependentListUpdateRequest description: Request model for creating or updating multiple dependents TaxPayerListItem: properties: id: type: integer title: Id primary_name: type: string title: Primary Name address: anyOf: - type: string - type: 'null' title: Address verified: type: boolean title: Verified description: True if the taxpayer is linked to a tax document (e.g. from a scanned 1040/W-2). default: false party_evidence_score: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Party Evidence Score description: Financial-evidence grounding score; higher = stronger party candidate. spouse_role: anyOf: - type: string - type: 'null' title: Spouse Role description: 'Inferred role on gendered affidavit forms: ''husband'', ''wife'', or null (unknown/blank).' type: object required: - id - primary_name title: TaxPayerListItem description: Simplified taxpayer information for selection lists TimelineEventCreate: properties: fact: type: string title: Fact known_date: anyOf: - type: string - type: 'null' title: Known Date known_end_date: anyOf: - type: string - type: 'null' title: Known End Date known_time: anyOf: - type: string - type: 'null' title: Known Time date_precision: anyOf: - type: string - type: 'null' title: Date Precision relevance: type: integer maximum: 11.0 minimum: 0.0 title: Relevance default: 0 relevance_reason: type: string title: Relevance Reason default: '' filename: anyOf: - type: string - type: 'null' title: Filename page: anyOf: - type: integer - type: 'null' title: Page attachment_id: anyOf: - type: integer - type: 'null' title: Attachment Id considered_important: type: boolean title: Considered Important default: false type: object required: - fact title: TimelineEventCreate description: Request model for creating a timeline event. DatasetDocumentStatusResponse: properties: id: type: integer title: Id file_count: type: integer title: File Count import_count: type: integer title: Import Count token_count: type: integer title: Token Count total_size: type: integer title: Total Size unprocessed_count: type: integer title: Unprocessed Count default: 0 type: object required: - id - file_count - import_count - token_count - total_size title: DatasetDocumentStatusResponse TaxClassification: type: string enum: - sole_proprietorship - disregarded_entity - s_corp - c_corp - partnership - qualified_joint_venture - unknown title: TaxClassification description: 'How the business files with the IRS (federal substance). Drives extraction routing and downstream income-flow analysis.' InvestmentHoldingListResponse: properties: holdings: items: $ref: '#/components/schemas/InvestmentHoldingResponse' type: array title: Holdings total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_market_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Market Value readOnly: true total_unrealized_gain_loss: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Unrealized Gain Loss readOnly: true unique_symbols: items: type: string type: array title: Unique Symbols readOnly: true profitable_holdings: type: integer title: Profitable Holdings readOnly: true type: object required: - holdings - total - total_pages - total_market_value - total_unrealized_gain_loss - unique_symbols - profitable_holdings title: InvestmentHoldingListResponse description: List response for investment holdings TaxCreditResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id tax_document_id: type: integer title: Tax Document Id credit_type: type: string title: Credit Type amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Amount description: anyOf: - type: string - type: 'null' title: Description formatted_amount: anyOf: - type: string - type: 'null' title: Formatted Amount readOnly: true display_description: type: string title: Display Description readOnly: true type: object required: - id - dataset_id - tax_document_id - credit_type - formatted_amount - display_description title: TaxCreditResponse description: Response model for tax credits DailySpendingDataPoint: properties: date: type: string format: date-time title: Date description: Date of the spending charges: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Charges description: Total charges for this day default: '0.00' payments: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Payments description: Total payments for this day default: '0.00' transaction_count: type: integer title: Transaction Count description: Number of transactions on this day default: 0 net_change: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Change description: Net change for the day (charges - payments) readOnly: true type: object required: - date - net_change title: DailySpendingDataPoint description: Single day's aggregated spending data JobStatus: properties: title: type: string title: Title start_time: type: string title: Start Time id: type: integer title: Id default: 0 state: $ref: '#/components/schemas/JobState' default: Idle next_job: anyOf: - type: integer - type: 'null' title: Next Job finish_time: anyOf: - type: string - type: 'null' title: Finish Time total_files: anyOf: - type: integer - type: 'null' title: Total Files user_id: anyOf: - type: string - type: 'null' title: User Id user_email: anyOf: - type: string - type: 'null' title: User Email dataset_id: anyOf: - type: integer - type: 'null' title: Dataset Id status: items: $ref: '#/components/schemas/StatusEntry' type: array title: Status tasks: additionalProperties: $ref: '#/components/schemas/TaskStatus' type: object title: Tasks job_state: anyOf: - type: string - type: 'null' title: Job State type: object required: - title - start_time title: JobStatus description: 'Job status that matches ARQ format exactly. For Temporal workflows, this represents the overall workflow status with individual batches represented as "tasks" to maintain compatibility with existing ARQ-based monitoring and UI systems. Uses mutable dataclass for performance - mutations are in-place, avoiding expensive copy operations. This is safe because workflow state is only modified within the workflow deterministically.' LiabilityTypeListResponse: properties: liability_types: items: $ref: '#/components/schemas/LiabilityTypeInfo' type: array title: Liability Types total_types: type: integer title: Total Types total_accounts: type: integer title: Total Accounts active_types: type: integer title: Active Types description: Number of liability types that have accounts in the dataset readOnly: true type: object required: - liability_types - total_types - total_accounts - active_types title: LiabilityTypeListResponse description: List response for liability types with counts CategoryScores: properties: name: type: string title: Name scores: $ref: '#/components/schemas/ContractGrade' types: additionalProperties: $ref: '#/components/schemas/ContractGrade' type: object title: Types type: object required: - name - scores title: CategoryScores description: 'Aggregate scores across a given category, we''ll keep the category name, the aggregate grades as well as all the contract types and their aggregate values.' DatasetDocumentSource: type: string enum: - discovery - doc_hub title: DatasetDocumentSource description: Canonical backing-source enum for discovery vs doc-hub datasets. InvestmentTransactionResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id account_id: type: integer title: Account Id document_id: type: integer title: Document Id transaction_date: type: string format: date-time title: Transaction Date settlement_date: anyOf: - type: string format: date-time - type: 'null' title: Settlement Date transaction_type: type: string title: Transaction Type symbol: anyOf: - type: string - type: 'null' title: Symbol security_name: anyOf: - type: string - type: 'null' title: Security Name asset_type: anyOf: - type: string - type: 'null' title: Asset Type quantity: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Quantity price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Price amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Amount fees: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Fees description_raw: type: string title: Description Raw description_cleaned: anyOf: - type: string - type: 'null' title: Description Cleaned transaction_id: anyOf: - type: string - type: 'null' title: Transaction Id confirmation_number: anyOf: - type: string - type: 'null' title: Confirmation Number source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id notes: anyOf: - type: string - type: 'null' title: Notes is_disputed: type: boolean title: Is Disputed default: false dispute_reason: anyOf: - type: string - type: 'null' title: Dispute Reason metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex account: anyOf: - $ref: '#/components/schemas/InvestmentAccountResponse' - type: 'null' display_description: type: string title: Display Description readOnly: true display_security: anyOf: - type: string - type: 'null' title: Display Security readOnly: true formatted_amount: type: string title: Formatted Amount readOnly: true formatted_quantity: anyOf: - type: string - type: 'null' title: Formatted Quantity readOnly: true formatted_price: anyOf: - type: string - type: 'null' title: Formatted Price readOnly: true is_buy_transaction: type: boolean title: Is Buy Transaction readOnly: true is_sell_transaction: type: boolean title: Is Sell Transaction readOnly: true is_income_transaction: type: boolean title: Is Income Transaction readOnly: true net_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Amount description: Amount after fees readOnly: true settlement_delay_days: anyOf: - type: integer - type: 'null' title: Settlement Delay Days readOnly: true has_investigation_flags: type: boolean title: Has Investigation Flags description: Check if transaction has investigation flags in metadata_ex readOnly: true type: object required: - id - dataset_id - account_id - document_id - transaction_date - transaction_type - amount - description_raw - display_description - display_security - formatted_amount - formatted_quantity - formatted_price - is_buy_transaction - is_sell_transaction - is_income_transaction - net_amount - settlement_delay_days - has_investigation_flags title: InvestmentTransactionResponse description: Response model for investment transactions CategorySubCategoryRow: properties: category: type: string title: Category description: Expense category (e.g. Transportation) sub_category: type: string title: Sub Category description: Sub-category (e.g. Gas); empty string if none type: object required: - category - sub_category title: CategorySubCategoryRow description: A (category, sub_category) pair that appears in the dataset's transactions. BankCheckResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id document_id: type: integer title: Document Id account_id: anyOf: - type: integer - type: 'null' title: Account Id check_number: anyOf: - type: string - type: 'null' title: Check Number check_date: anyOf: - type: string format: date-time - type: 'null' title: Check Date payee_name: anyOf: - type: string - type: 'null' title: Payee Name amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Amount memo: anyOf: - type: string - type: 'null' title: Memo drawer_name: anyOf: - type: string - type: 'null' title: Drawer Name micr_routing: anyOf: - type: string - type: 'null' title: Micr Routing micr_account: anyOf: - type: string - type: 'null' title: Micr Account endorsement: anyOf: - type: string - type: 'null' title: Endorsement is_cleared: type: boolean title: Is Cleared default: false matched_transaction_id: anyOf: - type: integer - type: 'null' title: Matched Transaction Id source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id account: anyOf: - $ref: '#/components/schemas/FinancialAccountResponse' - type: 'null' matched_transaction: anyOf: - $ref: '#/components/schemas/TransactionResponse' - type: 'null' has_matched_transaction: type: boolean title: Has Matched Transaction readOnly: true formatted_amount: anyOf: - type: string - type: 'null' title: Formatted Amount readOnly: true type: object required: - id - dataset_id - document_id - has_matched_transaction - formatted_amount title: BankCheckResponse description: Response model for a single check image / substitute check. JobState: type: string enum: - Idle - Initializing - Running - Done - Failed - Crashed - Retrying - Crash (Restart) - Pending title: JobState description: Job execution states - matches original ARQ JobState. HoldingSummary: properties: symbol: type: string title: Symbol security_name: anyOf: - type: string - type: 'null' title: Security Name asset_type: anyOf: - type: string - type: 'null' title: Asset Type total_quantity: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Quantity default: '0.00' total_market_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Market Value default: '0.00' total_cost_basis: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Cost Basis default: '0.00' total_unrealized_gain_loss: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Unrealized Gain Loss default: '0.00' account_count: type: integer title: Account Count default: 0 average_price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Average Price unrealized_gain_loss_percent: anyOf: - type: number - type: 'null' title: Unrealized Gain Loss Percent readOnly: true type: object required: - symbol - unrealized_gain_loss_percent title: HoldingSummary description: Summary statistics for a specific holding/symbol ContractTypeScoreRequest: properties: filters: $ref: '#/components/schemas/ContractFilters' default: parties_involved: [] contract_type: type: string title: Contract Type revenue: type: boolean title: Revenue type: object required: - contract_type - revenue title: ContractTypeScoreRequest description: Request all contracts by a given type, including all their scores for the criteria they're scored. BusinessMemberResponse: properties: id: type: integer title: Id taxpayer_id: type: integer title: Taxpayer Id taxpayer_name: anyOf: - type: string - type: 'null' title: Taxpayer Name role: type: string title: Role ownership_pct: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Ownership Pct verified_by: items: type: string type: array title: Verified By source_document_types: items: type: string type: array title: Source Document Types is_responsible_party: type: boolean title: Is Responsible Party default: false party_evidence_score: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Party Evidence Score is_party_candidate: anyOf: - type: boolean - type: 'null' title: Is Party Candidate type: object required: - id - taxpayer_id - role title: BusinessMemberResponse description: 'One Taxpayer associated with a Business — partner, shareholder, sole member, etc. ``role`` is what the source document called them; ``ownership_pct`` is the fractional share when disclosed (NULL when the source is silent, e.g. CP 575 names a responsible party but not the %); ``verified_by`` is the append-only set of authoritative ``source_document_type`` values that have attested this linkage (mirrors ``BusinessResponse.verified_by`` semantics — empty means self-reported only); ``source_document_types`` is every doc that has placed this person on this business; ``is_responsible_party`` flags the person named on any CP 575 for this entity.' RentalPropertyListResponse: properties: properties: items: $ref: '#/components/schemas/RentalPropertyResponse' type: array title: Properties total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true type: object required: - properties - total - total_pages title: RentalPropertyListResponse description: Paginated list of rental properties in a dataset. SoFVersionListItem: properties: id: type: integer title: Id title: type: string title: Title is_default: type: boolean title: Is Default writing_style: type: string title: Writing Style focus_area_tags: items: type: string type: array title: Focus Area Tags deep_analysis: type: boolean title: Deep Analysis analyze_for: items: type: string type: array title: Analyze For num_events: type: integer title: Num Events num_exhibits: type: integer title: Num Exhibits date_start: anyOf: - type: string format: date - type: 'null' title: Date Start date_end: anyOf: - type: string format: date - type: 'null' title: Date End timeline_sync: type: boolean title: Timeline Sync generated_at: anyOf: - type: string format: date-time - type: 'null' title: Generated At type: object required: - id - title - is_default - writing_style - focus_area_tags - deep_analysis - analyze_for - num_events - num_exhibits - date_start - date_end - timeline_sync - generated_at title: SoFVersionListItem description: Row shape for the SoF versions table (no generated prose). EmployerResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id tax_document_id: type: integer title: Tax Document Id name: type: string title: Name ein_last4: anyOf: - type: string - type: 'null' title: Ein Last4 address: anyOf: - type: string - type: 'null' title: Address employee_id: anyOf: - type: string - type: 'null' title: Employee Id department: anyOf: - type: string - type: 'null' title: Department job_title: anyOf: - type: string - type: 'null' title: Job Title contact_info: anyOf: - type: string - type: 'null' title: Contact Info display_name: type: string title: Display Name readOnly: true formatted_ein: anyOf: - type: string - type: 'null' title: Formatted Ein readOnly: true type: object required: - id - dataset_id - tax_document_id - name - display_name - formatted_ein title: EmployerResponse description: Response model for employers/income payers TaxYearValidationReport: properties: tax_year: type: integer title: Tax Year has_1040: type: boolean title: Has 1040 has_schedule_b: type: boolean title: Has Schedule B has_account_transcript: type: boolean title: Has Account Transcript default: false audit: items: type: string type: array title: Audit default: [] checklist: items: type: string type: array title: Checklist default: [] transcript_findings: items: type: string type: array title: Transcript Findings default: [] is_valid: type: boolean title: Is Valid description: Returns True if validation passed (no audit issues) readOnly: true type: object required: - tax_year - has_1040 - has_schedule_b - is_valid title: TaxYearValidationReport description: Validation report for a specific tax year DatasetListResponse: properties: id: type: integer title: Id name: type: string title: Name context: type: string title: Context created_on: type: string format: date-time title: Created On file_count: type: integer title: File Count import_count: type: integer title: Import Count total_size: type: integer title: Total Size token_count: type: integer title: Token Count contract_entities: items: type: string type: array title: Contract Entities import_failures: additionalProperties: true type: object title: Import Failures dataset_type: $ref: '#/components/schemas/DatasetType' document_source: anyOf: - $ref: '#/components/schemas/DatasetDocumentSource' - type: 'null' parent_id: anyOf: - type: integer - type: 'null' title: Parent Id parent: anyOf: - $ref: '#/components/schemas/LinkedDatasetInfo' - type: 'null' linked_datasets: items: $ref: '#/components/schemas/LinkedDatasetInfo' type: array title: Linked Datasets case_background: anyOf: - type: string - type: 'null' title: Case Background case_anchors: anyOf: - additionalProperties: true type: object - type: 'null' title: Case Anchors case_considerations: anyOf: - type: string - type: 'null' title: Case Considerations criteria: items: type: integer type: array title: Criteria reliance_files_list: anyOf: - items: type: string type: array - type: 'null' title: Reliance Files List description: List of generated reliance files names. metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex capabilities: items: type: string type: array title: Capabilities description: User's permissions on this dataset (e.g., can_view, can_edit, can_delete) type: object required: - id - name - context - created_on - file_count - import_count - total_size - token_count - contract_entities - import_failures - dataset_type - criteria title: DatasetListResponse description: Short Dataset response for lists. BusinessDetailResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id name: type: string title: Name ein: anyOf: - type: string - type: 'null' title: Ein ein_last4: anyOf: - type: string - type: 'null' title: Ein Last4 taxpayer_id_kind: anyOf: - $ref: '#/components/schemas/TaxpayerIdKind' - type: 'null' state_of_formation: anyOf: - type: string - type: 'null' title: State Of Formation tax_classification: $ref: '#/components/schemas/TaxClassification' default: unknown legal_entity_type: $ref: '#/components/schemas/LegalEntityType' default: unknown source_tax_document_id: anyOf: - type: integer - type: 'null' title: Source Tax Document Id source_document_type: anyOf: - type: string - type: 'null' title: Source Document Type verified_by: items: type: string type: array title: Verified By principal_business_activity: anyOf: - type: string - type: 'null' title: Principal Business Activity naics_code: anyOf: - type: string - type: 'null' title: Naics Code accounting_method: anyOf: - type: string - type: 'null' title: Accounting Method formation_year: anyOf: - type: integer - type: 'null' title: Formation Year is_active_this_year: type: boolean title: Is Active This Year default: true business_address: anyOf: - type: string - type: 'null' title: Business Address taxpayer_ownership_pct: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Taxpayer Ownership Pct created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At k1_documents: items: $ref: '#/components/schemas/TaxDocumentResponse' type: array title: K1 Documents parent_return: anyOf: - $ref: '#/components/schemas/TaxDocumentResponse' - type: 'null' rental_properties: items: $ref: '#/components/schemas/RentalPropertyResponse' type: array title: Rental Properties vehicles: items: $ref: '#/components/schemas/VehicleResponse' type: array title: Vehicles real_properties: items: $ref: '#/components/schemas/RealPropertyResponse' type: array title: Real Properties members: items: $ref: '#/components/schemas/BusinessMemberResponse' type: array title: Members received_1099s: items: $ref: '#/components/schemas/TaxDocumentResponse' type: array title: Received 1099S issued_1099s: items: $ref: '#/components/schemas/TaxDocumentResponse' type: array title: Issued 1099S type: object required: - id - dataset_id - name - created_at - updated_at title: BusinessDetailResponse description: 'Single business with all linked tax documents and rental properties. Mirrors the prior CorporateEntityDetailResponse shape but covers every tax classification, not just S-Corp / C-Corp / Partnership. NOTE: forward refs (``TaxDocumentResponse``, ``RentalPropertyResponse``) are resolved by ``income.py``''s bottom-of-module ``model_rebuild()`` call — income.py is the natural load-order tail (real_estate imports from income, income imports from this module) so that''s the right place to wire it.' BusinessValuationPartyUpdate: properties: taxpayer_id: type: integer title: Taxpayer Id ownership_pct: anyOf: - type: number maximum: 100.0 minimum: 0.0 - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Ownership Pct salary_override: anyOf: - type: number minimum: 0.0 - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Salary Override distributions_override: anyOf: - type: number minimum: 0.0 - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Distributions Override additionalProperties: false type: object required: - taxpayer_id title: BusinessValuationPartyUpdate description: Per-party override write payload. TaxpayerIdKind: type: string enum: - ein - ssn - none title: TaxpayerIdKind description: Which taxpayer identifier the business reports under. SourcedValue: properties: value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Value source: anyOf: - type: string - type: 'null' title: Source type: object title: SourcedValue description: 'Auto-filled scalar with its provenance label. ``source`` matches the auto-fill priority labels documented in the ticket (e.g. ``"w2_2024"``, ``"k1_distributions"``, ``"schedule_c_net_profit"``). NULL on both fields means no auto-fill signal was found and the lawyer must enter the value.' FactsRewriteResponse: properties: statement_of_facts: anyOf: - type: string - type: 'null' title: Statement Of Facts error_message: anyOf: - type: string - type: 'null' title: Error Message type: object title: FactsRewriteResponse description: Rewrite the statement of facts for this dataset, we will either have a new statement of facts or an error. EventFocusAreaTagRequest: properties: tag: type: string minLength: 1 title: Tag add: type: boolean title: Add default: true type: object required: - tag title: EventFocusAreaTagRequest description: Add/remove a single focus-area tag on one event (ENG-15314). LegalEntityType: type: string enum: - individual - smllc - mmllc - corporation - limited_partnership - general_partnership - professional_corp - professional_llc - unknown title: LegalEntityType description: 'What state law calls it (the wrapper). Drives asset-division logic — liability shield, separateness for property distribution, professional-practice handling.' BankingCategorySpendingDataPoint: properties: category: type: string title: Category amount: type: string title: Amount transaction_count: type: integer title: Transaction Count average_transaction: type: string title: Average Transaction type: object required: - category - amount - transaction_count - average_transaction title: BankingCategorySpendingDataPoint description: Spending by category for banking RentalPropertyUpdateRequest: properties: business_id: anyOf: - type: integer - type: 'null' title: Business Id taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id description: anyOf: - type: string maxLength: 2000 - type: 'null' title: Description property_type_code: anyOf: - type: integer maximum: 8.0 minimum: 1.0 - type: 'null' title: Property Type Code property_type_description: anyOf: - type: string maxLength: 100 - type: 'null' title: Property Type Description address_full: anyOf: - type: string - type: 'null' title: Address Full street_number: anyOf: - type: integer minimum: 0.0 - type: 'null' title: Street Number street_name: anyOf: - type: string maxLength: 255 - type: 'null' title: Street Name city: anyOf: - type: string maxLength: 100 - type: 'null' title: City state: anyOf: - type: string maxLength: 2 - type: 'null' title: State zip: anyOf: - type: string maxLength: 20 - type: 'null' title: Zip acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price sold_date: anyOf: - type: string format: date - type: 'null' title: Sold Date sale_proceeds: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Sale Proceeds estimated_value: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of mortgage_holder: anyOf: - type: string maxLength: 255 - type: 'null' title: Mortgage Holder mortgage_balance: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Mortgage Balance additionalProperties: false type: object title: RentalPropertyUpdateRequest description: 'Body for ``PATCH /forensic/{dataset_id}/real-estate/properties/{property_id}``. Rental counterpart of ``RealPropertyUpdateRequest`` — same semantics (all fields optional, only set fields written, ``estimated_value`` stamped ``owner_estimate`` + appended to ``metadata_ex.valuations`` + propagated to the rental''s balance-sheet row unless locked; address edits re-sync ``normalized_address_key``). Owner is a business OR a taxpayer; rental type replaces the residence''s primary-residence fields.' DatasetExpenseSummaryResponse: properties: dataset_id: type: integer title: Dataset Id total_expenses: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Expenses default: '0.00' total_transactions: type: integer title: Total Transactions default: 0 unique_merchants: type: integer title: Unique Merchants default: 0 unique_categories: type: integer title: Unique Categories default: 0 business_expenses: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Business Expenses default: '0.00' personal_expenses: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Personal Expenses default: '0.00' total_tax_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Paid default: '0.00' total_tips_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tips Paid default: '0.00' date_range_start: anyOf: - type: string format: date-time - type: 'null' title: Date Range Start date_range_end: anyOf: - type: string format: date-time - type: 'null' title: Date Range End expense_type_summaries: items: $ref: '#/components/schemas/ExpenseTypeSummary' type: array title: Expense Type Summaries default: [] top_merchants: items: $ref: '#/components/schemas/MerchantSpendingSummary' type: array title: Top Merchants default: [] average_transaction_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Transaction Amount readOnly: true business_expense_percentage: type: number title: Business Expense Percentage readOnly: true analysis_period_days: anyOf: - type: integer - type: 'null' title: Analysis Period Days readOnly: true monthly_spending_estimate: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Monthly Spending Estimate readOnly: true type: object required: - dataset_id - average_transaction_amount - business_expense_percentage - analysis_period_days - monthly_spending_estimate title: DatasetExpenseSummaryResponse description: Overall expense summary for a dataset CategorySpendRow: properties: category: type: string title: Category description: Expense category (e.g. Transportation, Housing) transaction_count: type: integer title: Transaction Count description: Number of transactions in this category total_spend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Spend description: Total spend in this category annualized_spend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Annualized Spend description: Annualized spend (total_spend * 12 / months_with_data) percent_transactions: type: number title: Percent Transactions description: Percentage of all transactions percent_spend: anyOf: - type: number - type: 'null' title: Percent Spend description: Percentage of total spend; null for Non-Expense/Clearing categories sub_categories: items: $ref: '#/components/schemas/SubCategorySpendRow' type: array title: Sub Categories description: Breakdown by sub-category within this category beneficiaries: items: $ref: '#/components/schemas/BeneficiarySpendRow' type: array title: Beneficiaries description: Breakdown by beneficiary (CHILD, ADULT, HOUSEHOLD, GENERAL) within this category type: object required: - category - transaction_count - total_spend - annualized_spend - percent_transactions title: CategorySpendRow description: Spend and count for one category, with sub_category and beneficiary breakdown. DatasetUpdateSoFRequest: properties: statement_of_facts: type: string title: Statement Of Facts type: object required: - statement_of_facts title: DatasetUpdateSoFRequest description: Update the statement of facts for this dataset. FinancialInstitutionResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id name: type: string title: Name primary_contact_info: anyOf: - additionalProperties: anyOf: - type: string - type: integer - type: number - type: boolean - type: 'null' type: object - type: 'null' title: Primary Contact Info display_name: type: string title: Display Name readOnly: true type: object required: - id - dataset_id - name - display_name title: FinancialInstitutionResponse description: Response model for financial institutions TimelineEventUpdate: properties: fact: anyOf: - type: string - type: 'null' title: Fact known_date: anyOf: - type: string - type: 'null' title: Known Date known_end_date: anyOf: - type: string - type: 'null' title: Known End Date known_time: anyOf: - type: string - type: 'null' title: Known Time date_precision: anyOf: - type: string - type: 'null' title: Date Precision relevance: anyOf: - type: integer maximum: 11.0 minimum: 0.0 - type: 'null' title: Relevance relevance_reason: anyOf: - type: string - type: 'null' title: Relevance Reason filename: anyOf: - type: string - type: 'null' title: Filename page: anyOf: - type: integer - type: 'null' title: Page attachment_id: anyOf: - type: integer - type: 'null' title: Attachment Id exhibit_label: anyOf: - type: string - type: 'null' title: Exhibit Label considered_important: anyOf: - type: boolean - type: 'null' title: Considered Important type: object title: TimelineEventUpdate description: Request model for updating a timeline event (partial updates). ProfileUpdateRequest: properties: petitioner_taxpayer_id: anyOf: - type: integer - type: 'null' title: Petitioner Taxpayer Id respondent_taxpayer_id: anyOf: - type: integer - type: 'null' title: Respondent Taxpayer Id jurisdiction: anyOf: - type: string - type: 'null' title: Jurisdiction party_role: anyOf: - type: string - type: 'null' title: Party Role marriage_date: anyOf: - type: string format: date-time - type: 'null' title: Marriage Date separation_date: anyOf: - type: string format: date-time - type: 'null' title: Separation Date date_of_filing: anyOf: - type: string format: date-time - type: 'null' title: Date Of Filing prior_separation_periods: anyOf: - items: $ref: '#/components/schemas/PriorSeparationPeriod' type: array - type: 'null' title: Prior Separation Periods addresses: anyOf: - items: type: string type: array - type: 'null' title: Addresses allocation_config: anyOf: - additionalProperties: true type: object - type: 'null' title: Allocation Config type: object title: ProfileUpdateRequest description: Request model for updating forensic profile BusinessValuationParty: properties: taxpayer_id: type: integer title: Taxpayer Id taxpayer_name: anyOf: - type: string - type: 'null' title: Taxpayer Name ownership_pct: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Ownership Pct ownership_pct_source: anyOf: - type: string - type: 'null' title: Ownership Pct Source salary: $ref: '#/components/schemas/SourcedValue' salary_override: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Salary Override distributions: $ref: '#/components/schemas/SourcedValue' distributions_override: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Distributions Override equity_share: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Equity Share type: object required: - taxpayer_id title: BusinessValuationParty description: 'One taxpayer''s ownership / salary / distributions on a business. Auto-filled values come from K-1 Section J, W-2 wages, business_members, sole-prop defaults, and 1099-DIVs depending on the entity type. The ``*_override`` fields are the lawyer-entered values from ``business_valuation_party_inputs`` — when set, they take precedence over the auto-filled value on UI displays and downstream computations.' SubCategoriesListResponse: properties: items: items: $ref: '#/components/schemas/CategorySubCategoryRow' type: array title: Items description: Distinct (category, sub_category) pairs that appear in transactions type: object required: - items title: SubCategoriesListResponse description: Distinct category and sub-category pairs from the dataset's banking and liability transactions. TaxPayerRenameRequest: properties: primary_name: type: string maxLength: 200 minLength: 1 title: Primary Name description: New name for the taxpayer type: object required: - primary_name title: TaxPayerRenameRequest description: Request model for renaming a taxpayer's primary_name. Category: type: string enum: - Commercial Agreements - Corporate Governance - Financial Agreements - Employment and Human Resources - Mergers, Acquisitions, and Divestitures - Non-Disclosure Agreement - Other title: Category description: The Contract Categories that we will use for all the contract types that can exist. PaginationMetadata: properties: page: type: integer title: Page description: Current page number page_size: type: integer title: Page Size description: Number of items per page total_count: type: integer title: Total Count description: Total number of items total_pages: type: integer title: Total Pages description: Total number of pages has_next: type: boolean title: Has Next description: Whether there is a next page has_previous: type: boolean title: Has Previous description: Whether there is a previous page type: object required: - page - page_size - total_count - total_pages - has_next - has_previous title: PaginationMetadata description: Pagination metadata for list responses. BusinessWithCountsResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id name: type: string title: Name ein: anyOf: - type: string - type: 'null' title: Ein ein_last4: anyOf: - type: string - type: 'null' title: Ein Last4 taxpayer_id_kind: anyOf: - $ref: '#/components/schemas/TaxpayerIdKind' - type: 'null' state_of_formation: anyOf: - type: string - type: 'null' title: State Of Formation tax_classification: $ref: '#/components/schemas/TaxClassification' default: unknown legal_entity_type: $ref: '#/components/schemas/LegalEntityType' default: unknown source_tax_document_id: anyOf: - type: integer - type: 'null' title: Source Tax Document Id source_document_type: anyOf: - type: string - type: 'null' title: Source Document Type verified_by: items: type: string type: array title: Verified By principal_business_activity: anyOf: - type: string - type: 'null' title: Principal Business Activity naics_code: anyOf: - type: string - type: 'null' title: Naics Code accounting_method: anyOf: - type: string - type: 'null' title: Accounting Method formation_year: anyOf: - type: integer - type: 'null' title: Formation Year is_active_this_year: type: boolean title: Is Active This Year default: true business_address: anyOf: - type: string - type: 'null' title: Business Address taxpayer_ownership_pct: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Taxpayer Ownership Pct created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At k1_count: type: integer title: K1 Count default: 0 has_parent_return: type: boolean title: Has Parent Return default: false parent_return_year: anyOf: - type: integer - type: 'null' title: Parent Return Year parent_return_doc_type: anyOf: - type: string - type: 'null' title: Parent Return Doc Type member_count: type: integer title: Member Count default: 0 banking_account_count: type: integer title: Banking Account Count default: 0 liability_account_count: type: integer title: Liability Account Count default: 0 investment_account_count: type: integer title: Investment Account Count default: 0 type: object required: - id - dataset_id - name - created_at - updated_at title: BusinessWithCountsResponse description: 'Listing row — business plus aggregate K-1 / parent-return / member / account counts. ``k1_count`` is the number of Schedule K-1s issued by this entity (only meaningful for S-Corps / partnerships). ``has_parent_return`` flips true when the 1120 / 1120-S / 1065 itself has been extracted into the same dataset. ``member_count`` reflects how many distinct Taxpayers we''ve tied to this business (sole_member / member / shareholder / responsible_party). ``banking_account_count`` / ``liability_account_count`` / ``investment_account_count`` are the number of rows in ``financial_accounts`` / ``liability_accounts`` / ``investment_accounts`` whose ``business_id`` points at this entity. Each is independent — a business may have a checking account but no credit cards, or vice versa. The UI uses these to drive the per-section business picker (only show businesses that actually have accounts in the section being viewed).' SubCategorySpendRow: properties: sub_category: type: string title: Sub Category description: Sub-category label (or empty if none) transaction_count: type: integer title: Transaction Count description: Number of transactions total_spend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Spend description: Total spend percent_transactions: type: number title: Percent Transactions description: Percentage of all transactions percent_spend: anyOf: - type: number - type: 'null' title: Percent Spend description: Percentage of total spend; null for Non-Expense/Clearing categories type: object required: - sub_category - transaction_count - total_spend - percent_transactions title: SubCategorySpendRow description: Spend and count for one sub-category within a category. BusinessValuationUpdateRequest: properties: marital_character: anyOf: - type: string enum: - marital - non_marital - disputed - type: 'null' title: Marital Character manual_valuation: anyOf: - type: number minimum: 0.0 - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Manual Valuation parties: items: $ref: '#/components/schemas/BusinessValuationPartyUpdate' type: array title: Parties additionalProperties: false type: object title: BusinessValuationUpdateRequest description: 'PUT body — only override-bearing fields are writable. Auto-fill values (statement aggregates, K-1 section J, W-2 wages) are NOT editable through this endpoint; they reflect the underlying extracted documents.' PaginationMeta: properties: page: type: integer title: Page page_size: type: integer title: Page Size total_pages: type: integer title: Total Pages total_count: type: integer title: Total Count type: object required: - page - page_size - total_pages - total_count title: PaginationMeta description: Allow us to page through specific large sets of data LiabilityTypeInfo: properties: liability_type: type: string title: Liability Type display_name: type: string title: Display Name count: type: integer title: Count default: 0 type: object required: - liability_type - display_name title: LiabilityTypeInfo description: Information about a liability type with user-friendly name and count ContractDetailRequest: properties: filters: $ref: '#/components/schemas/ContractFilters' default: parties_involved: [] revenue: anyOf: - type: boolean - type: 'null' title: Revenue description: Revenue or non-revenue contracts? contract_type: anyOf: - type: string - type: 'null' title: Contract Type description: Contract type to filter by. type: object title: ContractDetailRequest description: Request contract scores, these filters will apply to the scores when we return them. DetailDatasetResponse: properties: id: type: integer title: Id name: type: string title: Name context: type: string title: Context created_on: type: string format: date-time title: Created On file_count: type: integer title: File Count import_count: type: integer title: Import Count total_size: type: integer title: Total Size token_count: type: integer title: Token Count contract_entities: items: type: string type: array title: Contract Entities import_failures: additionalProperties: true type: object title: Import Failures dataset_type: $ref: '#/components/schemas/DatasetType' document_source: anyOf: - $ref: '#/components/schemas/DatasetDocumentSource' - type: 'null' parent_id: anyOf: - type: integer - type: 'null' title: Parent Id parent: anyOf: - $ref: '#/components/schemas/LinkedDatasetInfo' - type: 'null' linked_datasets: items: $ref: '#/components/schemas/LinkedDatasetInfo' type: array title: Linked Datasets case_background: anyOf: - type: string - type: 'null' title: Case Background case_anchors: anyOf: - additionalProperties: true type: object - type: 'null' title: Case Anchors case_considerations: anyOf: - type: string - type: 'null' title: Case Considerations finding_highlights: anyOf: - type: string - type: 'null' title: Finding Highlights finding_summary: anyOf: - type: string - type: 'null' title: Finding Summary statement_of_facts: anyOf: - type: string - type: 'null' title: Statement Of Facts facts_summary: anyOf: - type: string - type: 'null' title: Facts Summary legal_analysis: anyOf: - type: string - type: 'null' title: Legal Analysis criteria: items: type: integer type: array title: Criteria timeline_sync: type: boolean title: Timeline Sync default: false summary_quotes: anyOf: - additionalProperties: true type: object - type: 'null' title: Summary Quotes form_questions: anyOf: - additionalProperties: true type: object - type: 'null' title: Form Questions expert_name: anyOf: - type: string - type: 'null' title: Expert Name description: Name of the expert associated with the reliance list. preferred_format: anyOf: - type: string - type: 'null' title: Preferred Format description: Preferred format for the reliance list (e.g., 'Excel', 'DOCX'). reliance_files_list: anyOf: - items: type: string type: array - type: 'null' title: Reliance Files List description: List of generated reliance files names. forensic_accounting: anyOf: - additionalProperties: true type: object - type: 'null' title: Forensic Accounting background_research: anyOf: - additionalProperties: true type: object - type: 'null' title: Background Research feedback: anyOf: - additionalProperties: true type: object - type: 'null' title: Feedback metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex needs_processing: anyOf: - type: boolean - type: 'null' title: Needs Processing description: Whether the dataset should show the Start Processing action. processing_reason: anyOf: - $ref: '#/components/schemas/ProcessingReason' - type: 'null' description: Why processing is needed for this dataset, when applicable. document_filenames: items: additionalProperties: true type: object type: array title: Document Filenames default: [] created_by: anyOf: - type: string - type: 'null' title: Created By description: Name or email of the user who created this dataset. shared_with: items: type: string type: array title: Shared With description: Names or emails of users this dataset is shared with. capabilities: items: type: string type: array title: Capabilities description: User's permissions on this dataset (e.g., can_view, can_edit, can_delete) type: object required: - id - name - context - created_on - file_count - import_count - total_size - token_count - contract_entities - import_failures - dataset_type - criteria title: DetailDatasetResponse description: Dataset response with additional details, such as document filenames for import benchmark InvestigationTypesResponse: properties: investigation_types: items: $ref: '#/components/schemas/InvestigationTypeInfo' type: array title: Investigation Types description: List of available investigation types type: object required: - investigation_types title: InvestigationTypesResponse description: Response when listing available investigation types. InvestmentAccountListResponse: properties: accounts: items: $ref: '#/components/schemas/InvestmentAccountResponse' type: array title: Accounts total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true active_accounts: type: integer title: Active Accounts readOnly: true retirement_accounts: type: integer title: Retirement Accounts readOnly: true type: object required: - accounts - total - total_pages - active_accounts - retirement_accounts title: InvestmentAccountListResponse description: List response for investment accounts DatasetScoringCriteria: properties: category: $ref: '#/components/schemas/Category' criteria: items: type: integer type: array title: Criteria type: object required: - category - criteria title: DatasetScoringCriteria description: This model represents one of our categories and all of the criteria assigned to it for a dataset. DependentAllocationMember: properties: dependent_id: type: integer title: Dependent Id description: FK to dependents.id label: type: string title: Label description: Display name (e.g. 'Billy Smith') child_share: type: integer maximum: 100.0 minimum: 0.0 title: Child Share description: '% of CHILD-beneficiary expenses (0-100)' default: 0 household_share: type: integer maximum: 100.0 minimum: 0.0 title: Household Share description: '% of HOUSEHOLD-beneficiary expenses (0-100)' default: 0 general_share: type: integer maximum: 100.0 minimum: 0.0 title: General Share description: '% of GENERAL-beneficiary expenses (0-100)' default: 0 type: object required: - dependent_id - label title: DependentAllocationMember description: Share percentages for one dependent (maps to dependents table). LinkedStatement: properties: id: type: integer title: Id statement_type: type: string title: Statement Type period_end: type: string format: date title: Period End type: object required: - id - statement_type - period_end title: LinkedStatement description: Reference to an extracted financial statement linked to this business. RealPropertyListResponse: properties: properties: items: $ref: '#/components/schemas/RealPropertyResponse' type: array title: Properties total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true type: object required: - properties - total - total_pages title: RealPropertyListResponse description: Paginated list of residences in a dataset. FlaggedDocumentDetailResponse: properties: table_name: type: string title: Table Name description: 'Source table: ''tax_documents'', ''tax_deductions'', ''tax_credits'', ''income_records'', etc.' record_id: type: integer title: Record Id description: Primary key of the record in the table specified by table_name document_id: type: integer title: Document Id description: Document/file ID that contains this record flag_reason: type: string title: Flag Reason description: Description of what was suspicious in the document/record pattern_type: anyOf: - type: string - type: 'null' title: Pattern Type description: 'Pattern category: gambling, asset_hiding, affair, etc.' document_path: anyOf: - type: string - type: 'null' title: Document Path description: Path to the document file type: object required: - table_name - record_id - document_id - flag_reason title: FlaggedDocumentDetailResponse description: Response model for a flagged document/record with details. DatasetCriteriaResponse: properties: id: type: integer title: Id name: type: string title: Name type: object required: - id - name title: DatasetCriteriaResponse description: One of our scoring criteria, we can have many of these associated with a contract category TaxPayerListUpdateRequest: properties: taxpayers: items: $ref: '#/components/schemas/TaxPayerUpdateRequest' type: array title: Taxpayers type: object required: - taxpayers title: TaxPayerListUpdateRequest description: Request model for creating or updating multiple taxpayers ContractScoreRequest: properties: filters: $ref: '#/components/schemas/ContractFilters' default: parties_involved: [] type: object title: ContractScoreRequest description: Request contract scores, these filters will apply to the scores when we return them. DatasetBankingSummaryResponse: properties: dataset_id: type: integer title: Dataset Id institution_count: type: integer title: Institution Count default: 0 account_count: type: integer title: Account Count default: 0 active_account_count: type: integer title: Active Account Count default: 0 transaction_count: type: integer title: Transaction Count default: 0 total_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Balance default: '0.00' date_range_start: anyOf: - type: string format: date-time - type: 'null' title: Date Range Start date_range_end: anyOf: - type: string format: date-time - type: 'null' title: Date Range End red_flags: type: integer title: Red Flags default: 0 account_summaries: items: $ref: '#/components/schemas/AccountSummaryResponse' type: array title: Account Summaries default: [] analysis_period_days: anyOf: - type: integer - type: 'null' title: Analysis Period Days readOnly: true type: object required: - dataset_id - analysis_period_days title: DatasetBankingSummaryResponse description: Overall banking summary for a dataset BulkUpdateTransactionsResponse: properties: banking_updated: type: integer title: Banking Updated description: Number of banking transactions updated liabilities_updated: type: integer title: Liabilities Updated description: Number of liability transactions updated type: object required: - banking_updated - liabilities_updated title: BulkUpdateTransactionsResponse description: 'Response: counts of updated rows per table.' VehicleResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id business_id: anyOf: - type: integer - type: 'null' title: Business Id business: anyOf: - $ref: '#/components/schemas/BusinessResponse' - type: 'null' owners: items: $ref: '#/components/schemas/VehicleOwnerResponse' type: array title: Owners default: [] vin: anyOf: - type: string - type: 'null' title: Vin normalized_vin: anyOf: - type: string - type: 'null' title: Normalized Vin year: anyOf: - type: integer - type: 'null' title: Year make: anyOf: - type: string - type: 'null' title: Make model: anyOf: - type: string - type: 'null' title: Model trim: anyOf: - type: string - type: 'null' title: Trim body_type: anyOf: - type: string - type: 'null' title: Body Type fuel_type: anyOf: - type: string - type: 'null' title: Fuel Type empty_weight_lb: anyOf: - type: integer - type: 'null' title: Empty Weight Lb color: anyOf: - type: string - type: 'null' title: Color title_number: anyOf: - type: string - type: 'null' title: Title Number title_issuing_state: anyOf: - type: string - type: 'null' title: Title Issuing State title_issue_date: anyOf: - type: string format: date - type: 'null' title: Title Issue Date title_brands: anyOf: - items: type: string type: array - type: 'null' title: Title Brands odometer_reading: anyOf: - type: integer - type: 'null' title: Odometer Reading odometer_brand: anyOf: - type: string enum: - actual - exempt - not_actual - over_100k - type: 'null' title: Odometer Brand odometer_as_of: anyOf: - type: string format: date - type: 'null' title: Odometer As Of has_lienholder: type: boolean title: Has Lienholder default: false lienholder_name: anyOf: - type: string - type: 'null' title: Lienholder Name lienholder_address: anyOf: - type: string - type: 'null' title: Lienholder Address acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price estimated_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of estimated_value_source: anyOf: - type: string - type: 'null' title: Estimated Value Source source_description: anyOf: - type: string - type: 'null' title: Source Description metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At ownership_type: type: string enum: - individual - entity - both - unknown title: Ownership Type description: 'Single-field summary of who owns this vehicle. ``individual`` = at least one personal owner; ``entity`` = held by a business (trust / LLC / S-Corp); ``both`` = mixed; ``unknown`` = no owners attached yet.' readOnly: true primary_owner_name: anyOf: - type: string - type: 'null' title: Primary Owner Name description: 'Single-name fallback when the UI can''t render the full owners list. Prefers ``title_holder`` > ``co_title_holder`` > ``trust`` > ``corporate``, then highest ownership_percentage, then first owner by id. Returns None when no owners exist.' readOnly: true display_label: type: string title: Display Label description: 'Human-readable label for table rows and matter-memory bullets. Fallback chain: ``year make model`` → ``make model`` → ``VIN xxx`` → ``Vehicle``. Mirrors ``_build_bsi_name`` in the persistence layer so the API label matches the BSI ``name`` column.' readOnly: true title_status_label: type: string enum: - clean - salvage - rebuilt - lien - unknown title: Title Status Label description: 'Map ``has_lienholder`` + ``title_brands`` to the ``VehicleTitleStatus`` contract — same logic as the persistence helper so the UI can show the title status without re-deriving it client-side. ``"clean"`` requires *positive title evidence* — at least one of ``title_number`` / ``title_issuing_state`` / ``title_issue_date`` / ``title_brands`` populated. Vehicles created from a KBB / BeenVerified valuation alone (no title uploaded yet) have all four nulled out and report ``"unknown"`` — absence of warning signals isn''t proof of a clean title.' readOnly: true type: object required: - id - dataset_id - created_at - updated_at - ownership_type - primary_owner_name - display_label - title_status_label title: VehicleResponse description: 'A titled motor vehicle — car / truck / motorcycle / trailer / RV. Same identity / lifecycle shape as ``RealPropertyResponse`` so the UI can render both in unified asset lists. ``has_lienholder=False`` is the conclusive paid-off signal — the only document that can prove a vehicle is owned free and clear. ``title_brands`` captures Salvage / Rebuilt / Flood / Lemon / etc. (empty list = clean title).' ExpenseRecordResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id document_id: type: integer title: Document Id category_id: anyOf: - type: integer - type: 'null' title: Category Id merchant_id: anyOf: - type: integer - type: 'null' title: Merchant Id expense_date: type: string format: date-time title: Expense Date total_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Amount tax_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Tax Amount tip_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Tip Amount subtotal_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Subtotal Amount receipt_number: anyOf: - type: string - type: 'null' title: Receipt Number transaction_id: anyOf: - type: string - type: 'null' title: Transaction Id payment_method: anyOf: - type: string - type: 'null' title: Payment Method currency: type: string title: Currency default: USD merchant_name: anyOf: - type: string - type: 'null' title: Merchant Name merchant_address: anyOf: - type: string - type: 'null' title: Merchant Address merchant_city: anyOf: - type: string - type: 'null' title: Merchant City merchant_state: anyOf: - type: string - type: 'null' title: Merchant State expense_type: type: string title: Expense Type expense_description: anyOf: - type: string - type: 'null' title: Expense Description is_business_expense: type: boolean title: Is Business Expense default: false is_recurring: type: boolean title: Is Recurring default: false family_members_present: anyOf: - items: type: string type: array - type: 'null' title: Family Members Present occasion: anyOf: - type: string - type: 'null' title: Occasion notes: anyOf: - type: string - type: 'null' title: Notes source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id raw_text_sample: anyOf: - type: string - type: 'null' title: Raw Text Sample extraction_confidence: anyOf: - type: number - type: 'null' title: Extraction Confidence processing_notes: anyOf: - type: string - type: 'null' title: Processing Notes metadata_ex: anyOf: - additionalProperties: anyOf: - type: string - type: integer - type: number - type: boolean - type: 'null' type: object - type: 'null' title: Metadata Ex category: anyOf: - $ref: '#/components/schemas/ExpenseCategoryResponse' - type: 'null' merchant: anyOf: - $ref: '#/components/schemas/MerchantResponse' - type: 'null' line_items: items: $ref: '#/components/schemas/ExpenseLineItemResponse' type: array title: Line Items default: [] display_merchant: type: string title: Display Merchant readOnly: true net_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Amount description: Calculate net expense amount (total - tax - tip) readOnly: true effective_tax_rate: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Effective Tax Rate description: Calculate effective tax rate as percentage readOnly: true formatted_amount: type: string title: Formatted Amount readOnly: true display_description: type: string title: Display Description readOnly: true merchant_location: anyOf: - type: string - type: 'null' title: Merchant Location readOnly: true line_item_count: type: integer title: Line Item Count readOnly: true has_detailed_breakdown: type: boolean title: Has Detailed Breakdown readOnly: true type: object required: - id - dataset_id - document_id - expense_date - total_amount - expense_type - display_merchant - net_amount - effective_tax_rate - formatted_amount - display_description - merchant_location - line_item_count - has_detailed_breakdown title: ExpenseRecordResponse description: Response model for expense records PagedResponse_RelevanceDetailResponse_: properties: items: items: $ref: '#/components/schemas/RelevanceDetailResponse' type: array title: Items pagination: $ref: '#/components/schemas/PaginationMeta' type: object required: - items - pagination title: PagedResponse[RelevanceDetailResponse] ContractTypeScoreResponse: properties: criteria: items: $ref: '#/components/schemas/ContractTypeScores' type: array title: Criteria type: object required: - criteria title: ContractTypeScoreResponse description: Return grades based on the critiria on the dataset. InvestmentIncomeReconciliationResponse: properties: dataset_id: type: integer title: Dataset Id rows: items: $ref: '#/components/schemas/InvestmentIncomeAttributionResponse' type: array title: Rows default: [] total_effective_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Effective Income readOnly: true discrepancy_count: type: integer title: Discrepancy Count readOnly: true by_year: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: By Year readOnly: true type: object required: - dataset_id - total_effective_income - discrepancy_count - by_year title: InvestmentIncomeReconciliationResponse description: Full reconciliation pane for a dataset, ready for the UI to render. InvestigationWorkflowStatusResponse: properties: workflow_id: type: string title: Workflow Id description: Temporal workflow ID dataset_id: type: integer title: Dataset Id description: Dataset ID status: type: string title: Status description: Current workflow status (running, completed, failed, etc.) start_time: anyOf: - type: string - type: 'null' title: Start Time description: ISO format timestamp when workflow started close_time: anyOf: - type: string - type: 'null' title: Close Time description: ISO format timestamp when workflow completed/failed result: anyOf: - $ref: '#/components/schemas/InvestigationWorkflowResult' - type: 'null' description: Result if workflow completed successfully result_error: anyOf: - type: string - type: 'null' title: Result Error description: Error message if result could not be retrieved error: anyOf: - type: string - type: 'null' title: Error description: Error message if workflow failed type: object required: - workflow_id - dataset_id - status title: InvestigationWorkflowStatusResponse description: Response when checking the status of an investigation workflow. RelevanceDocumentPage: properties: items: items: $ref: '#/components/schemas/RelevanceResponse' type: array title: Items pagination: $ref: '#/components/schemas/PaginationMeta' hidden_count: type: integer title: Hidden Count default: 0 type: object required: - items - pagination title: RelevanceDocumentPage description: 'The document list. Every scan match is listed, whatever the listing check said. ``hidden_count`` is always 0 and kept only so existing clients keep parsing the response; it will be removed in a later release.' DatasetResponse: properties: id: type: integer title: Id name: type: string title: Name context: type: string title: Context created_on: type: string format: date-time title: Created On file_count: type: integer title: File Count import_count: type: integer title: Import Count total_size: type: integer title: Total Size token_count: type: integer title: Token Count contract_entities: items: type: string type: array title: Contract Entities import_failures: additionalProperties: true type: object title: Import Failures dataset_type: $ref: '#/components/schemas/DatasetType' document_source: anyOf: - $ref: '#/components/schemas/DatasetDocumentSource' - type: 'null' parent_id: anyOf: - type: integer - type: 'null' title: Parent Id parent: anyOf: - $ref: '#/components/schemas/LinkedDatasetInfo' - type: 'null' linked_datasets: items: $ref: '#/components/schemas/LinkedDatasetInfo' type: array title: Linked Datasets case_background: anyOf: - type: string - type: 'null' title: Case Background case_anchors: anyOf: - additionalProperties: true type: object - type: 'null' title: Case Anchors case_considerations: anyOf: - type: string - type: 'null' title: Case Considerations finding_highlights: anyOf: - type: string - type: 'null' title: Finding Highlights finding_summary: anyOf: - type: string - type: 'null' title: Finding Summary statement_of_facts: anyOf: - type: string - type: 'null' title: Statement Of Facts facts_summary: anyOf: - type: string - type: 'null' title: Facts Summary legal_analysis: anyOf: - type: string - type: 'null' title: Legal Analysis criteria: items: type: integer type: array title: Criteria timeline_sync: type: boolean title: Timeline Sync default: false summary_quotes: anyOf: - additionalProperties: true type: object - type: 'null' title: Summary Quotes form_questions: anyOf: - additionalProperties: true type: object - type: 'null' title: Form Questions expert_name: anyOf: - type: string - type: 'null' title: Expert Name description: Name of the expert associated with the reliance list. preferred_format: anyOf: - type: string - type: 'null' title: Preferred Format description: Preferred format for the reliance list (e.g., 'Excel', 'DOCX'). reliance_files_list: anyOf: - items: type: string type: array - type: 'null' title: Reliance Files List description: List of generated reliance files names. forensic_accounting: anyOf: - additionalProperties: true type: object - type: 'null' title: Forensic Accounting background_research: anyOf: - additionalProperties: true type: object - type: 'null' title: Background Research feedback: anyOf: - additionalProperties: true type: object - type: 'null' title: Feedback metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex needs_processing: anyOf: - type: boolean - type: 'null' title: Needs Processing description: Whether the dataset should show the Start Processing action. processing_reason: anyOf: - $ref: '#/components/schemas/ProcessingReason' - type: 'null' description: Why processing is needed for this dataset, when applicable. type: object required: - id - name - context - created_on - file_count - import_count - total_size - token_count - contract_entities - import_failures - dataset_type - criteria title: DatasetResponse description: Standard Dataset response. DeleteInvestigationResponse: properties: message: type: string title: Message description: Success message transactions_updated: type: integer title: Transactions Updated description: Number of transactions that had flags removed type: object required: - message - transactions_updated title: DeleteInvestigationResponse description: Response when deleting an investigation. UploadResponse: properties: base_url: type: string title: Base Url sas_token: type: string title: Sas Token type: object required: - base_url - sas_token title: UploadResponse description: The Azure SAS token to use as well as the base URL to start uploading files to (in storage blob account) VehicleDetailResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id business_id: anyOf: - type: integer - type: 'null' title: Business Id business: anyOf: - $ref: '#/components/schemas/BusinessResponse' - type: 'null' owners: items: $ref: '#/components/schemas/VehicleOwnerResponse' type: array title: Owners default: [] vin: anyOf: - type: string - type: 'null' title: Vin normalized_vin: anyOf: - type: string - type: 'null' title: Normalized Vin year: anyOf: - type: integer - type: 'null' title: Year make: anyOf: - type: string - type: 'null' title: Make model: anyOf: - type: string - type: 'null' title: Model trim: anyOf: - type: string - type: 'null' title: Trim body_type: anyOf: - type: string - type: 'null' title: Body Type fuel_type: anyOf: - type: string - type: 'null' title: Fuel Type empty_weight_lb: anyOf: - type: integer - type: 'null' title: Empty Weight Lb color: anyOf: - type: string - type: 'null' title: Color title_number: anyOf: - type: string - type: 'null' title: Title Number title_issuing_state: anyOf: - type: string - type: 'null' title: Title Issuing State title_issue_date: anyOf: - type: string format: date - type: 'null' title: Title Issue Date title_brands: anyOf: - items: type: string type: array - type: 'null' title: Title Brands odometer_reading: anyOf: - type: integer - type: 'null' title: Odometer Reading odometer_brand: anyOf: - type: string enum: - actual - exempt - not_actual - over_100k - type: 'null' title: Odometer Brand odometer_as_of: anyOf: - type: string format: date - type: 'null' title: Odometer As Of has_lienholder: type: boolean title: Has Lienholder default: false lienholder_name: anyOf: - type: string - type: 'null' title: Lienholder Name lienholder_address: anyOf: - type: string - type: 'null' title: Lienholder Address acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price estimated_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of estimated_value_source: anyOf: - type: string - type: 'null' title: Estimated Value Source source_description: anyOf: - type: string - type: 'null' title: Source Description metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At ownership_type: type: string enum: - individual - entity - both - unknown title: Ownership Type description: 'Single-field summary of who owns this vehicle. ``individual`` = at least one personal owner; ``entity`` = held by a business (trust / LLC / S-Corp); ``both`` = mixed; ``unknown`` = no owners attached yet.' readOnly: true primary_owner_name: anyOf: - type: string - type: 'null' title: Primary Owner Name description: 'Single-name fallback when the UI can''t render the full owners list. Prefers ``title_holder`` > ``co_title_holder`` > ``trust`` > ``corporate``, then highest ownership_percentage, then first owner by id. Returns None when no owners exist.' readOnly: true display_label: type: string title: Display Label description: 'Human-readable label for table rows and matter-memory bullets. Fallback chain: ``year make model`` → ``make model`` → ``VIN xxx`` → ``Vehicle``. Mirrors ``_build_bsi_name`` in the persistence layer so the API label matches the BSI ``name`` column.' readOnly: true title_status_label: type: string enum: - clean - salvage - rebuilt - lien - unknown title: Title Status Label description: 'Map ``has_lienholder`` + ``title_brands`` to the ``VehicleTitleStatus`` contract — same logic as the persistence helper so the UI can show the title status without re-deriving it client-side. ``"clean"`` requires *positive title evidence* — at least one of ``title_number`` / ``title_issuing_state`` / ``title_issue_date`` / ``title_brands`` populated. Vehicles created from a KBB / BeenVerified valuation alone (no title uploaded yet) have all four nulled out and report ``"unknown"`` — absence of warning signals isn''t proof of a clean title.' readOnly: true type: object required: - id - dataset_id - created_at - updated_at - ownership_type - primary_owner_name - display_label - title_status_label title: VehicleDetailResponse description: 'Detail response — same shape as the list row today; reserved for future additions (e.g. associated auto loan statements, valuation history) without breaking the list response.' DatasetLiabilitySummaryResponse: properties: dataset_id: type: integer title: Dataset Id total_accounts: type: integer title: Total Accounts default: 0 active_accounts: type: integer title: Active Accounts default: 0 total_current_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Current Balance default: '0.00' total_credit_limits: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Credit Limits default: '0.00' total_minimum_payments: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Minimum Payments default: '0.00' total_payments_made: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Payments Made default: '0.00' total_charges: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Charges default: '0.00' total_interest_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Interest Paid default: '0.00' total_fees_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Fees Paid default: '0.00' total_transactions: type: integer title: Total Transactions default: 0 overdue_accounts: type: integer title: Overdue Accounts default: 0 disputed_transactions: type: integer title: Disputed Transactions default: 0 red_flags: type: integer title: Red Flags default: 0 date_range_start: anyOf: - type: string format: date-time - type: 'null' title: Date Range Start date_range_end: anyOf: - type: string format: date-time - type: 'null' title: Date Range End account_summaries: items: $ref: '#/components/schemas/datamodels__discovery__forensic__liabilities__AccountSummary' type: array title: Account Summaries default: [] liability_type_summaries: items: $ref: '#/components/schemas/LiabilityTypeSummary' type: array title: Liability Type Summaries default: [] net_activity: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Activity description: Net of charges minus payments readOnly: true total_costs: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Costs description: Total interest and fees paid readOnly: true overall_credit_utilization: anyOf: - type: number - type: 'null' title: Overall Credit Utilization readOnly: true analysis_period_days: anyOf: - type: integer - type: 'null' title: Analysis Period Days readOnly: true average_account_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Account Balance readOnly: true debt_to_available_credit_ratio: anyOf: - type: number - type: 'null' title: Debt To Available Credit Ratio description: Ratio of current debt to available credit readOnly: true type: object required: - dataset_id - net_activity - total_costs - overall_credit_utilization - analysis_period_days - average_account_balance - debt_to_available_credit_ratio title: DatasetLiabilitySummaryResponse description: Overall liability summary for a dataset RentalPropertyYearDataResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id rental_property_id: type: integer title: Rental Property Id tax_year: type: integer title: Tax Year source_tax_document_id: anyOf: - type: integer - type: 'null' title: Source Tax Document Id fair_rental_days: anyOf: - type: integer - type: 'null' title: Fair Rental Days personal_use_days: anyOf: - type: integer - type: 'null' title: Personal Use Days gross_rents: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Gross Rents advertising: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Advertising auto_and_travel: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Auto And Travel cleaning_and_maintenance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Cleaning And Maintenance commissions: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Commissions insurance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Insurance legal_and_professional: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Legal And Professional interest: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Interest repairs: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Repairs taxes: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Taxes utilities: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Utilities wages_and_salaries: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Wages And Salaries depreciation: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Depreciation other_expenses: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Other Expenses total_expenses: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Expenses net_income_loss: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Net Income Loss metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At type: object required: - id - dataset_id - rental_property_id - tax_year - created_at - updated_at title: RentalPropertyYearDataResponse description: 'One year''s financial snapshot for a rental property. Sourced from a Form 8825 or Schedule E Part I row in ``tax_documents``; ``source_tax_document_id`` links back so the UI can show "from Form 8825 attached to the 2022 1120-S".' DatasetLRResponse: properties: id: type: integer title: Id case_name: type: string title: Case Name statement_of_facts: type: string title: Statement Of Facts summary: type: string title: Summary preliminary_legal_analysis: type: string title: Preliminary Legal Analysis party_role: type: string title: Party Role writing_style: type: string title: Writing Style type: object required: - id - case_name - statement_of_facts - summary - preliminary_legal_analysis - party_role - writing_style title: DatasetLRResponse description: This response class is to bridge Legal Research (LR) with Timeline & Facts TaxPayerListResponse: properties: taxpayers: items: $ref: '#/components/schemas/TaxPayerListItem' type: array title: Taxpayers type: object required: - taxpayers title: TaxPayerListResponse description: Response model for list of taxpayers BusinessValuationEstimateResponse: properties: status: type: string enum: - ok - insufficient_documents title: Status estimate: anyOf: - $ref: '#/components/schemas/BusinessValuationEstimate' - type: 'null' message: anyOf: - type: string - type: 'null' title: Message missing_statement_types: items: type: string type: array title: Missing Statement Types type: object required: - status title: BusinessValuationEstimateResponse description: '200 envelope for the estimate endpoint. The endpoint always returns 200; callers branch on ``status`` rather than HTTP code (our API gateway doesn''t surface 4xx bodies to the frontend). ``estimate`` is populated only when ``status == "ok"``. ``insufficient_documents`` is an expected, user-actionable condition (no financial statements yet), not an error — ``missing_statement_types`` lists what''s still needed.' TaxonomyCategoryRow: properties: category: type: string title: Category sub_category_examples: items: type: string type: array title: Sub Category Examples type: object required: - category title: TaxonomyCategoryRow description: Category name and its example sub-categories (structure only, no spend). IncomeRecordListResponse: properties: income_records: items: $ref: '#/components/schemas/IncomeRecordResponse' type: array title: Income Records total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_gross_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Gross Income readOnly: true total_net_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Net Income readOnly: true total_tax_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Withheld readOnly: true income_types: items: type: string type: array title: Income Types readOnly: true unique_payers: items: type: string type: array title: Unique Payers readOnly: true type: object required: - income_records - total - total_pages - total_gross_income - total_net_income - total_tax_withheld - income_types - unique_payers title: IncomeRecordListResponse description: List response for income records SpendByCategoryResponse: properties: groups: items: $ref: '#/components/schemas/GroupSpendRow' type: array title: Groups description: Top-level groups with categories and sub_categories total_transactions: type: integer title: Total Transactions description: Total transaction count (spend-only) total_spend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Spend description: Total spend across all categories in the analysis window annualized_spend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Annualized Spend description: Annualized spend (total_spend * 12 / months_with_data) annualized_method: type: string enum: - last_30_days - last_90_days - last_6_months - last_12_months - ytd - custom title: Annualized Method description: Method used to compute the annualized window annualized_days: type: integer title: Annualized Days description: Number of days in the analysis window used as the annualization divisor annualized_period_start: type: string format: date-time title: Annualized Period Start description: Start of the analysis window annualized_period_end: type: string format: date-time title: Annualized Period End description: End of the analysis window type: object required: - groups - total_transactions - total_spend - annualized_spend - annualized_method - annualized_days - annualized_period_start - annualized_period_end title: SpendByCategoryResponse description: 'Spend-by-category report: groups → categories → sub_categories with % breakdown.' InvestmentTransactionListResponse: properties: transactions: items: $ref: '#/components/schemas/InvestmentTransactionResponse' type: array title: Transactions total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_buy_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Buy Amount readOnly: true total_sell_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Sell Amount readOnly: true total_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Income readOnly: true total_fees: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Fees readOnly: true unique_symbols: items: type: string type: array title: Unique Symbols readOnly: true type: object required: - transactions - total - total_pages - total_buy_amount - total_sell_amount - total_income - total_fees - unique_symbols title: InvestmentTransactionListResponse description: List response for investment transactions InvestigationWithTransactionsResponse: properties: investigation: $ref: '#/components/schemas/InvestigationResponse' flagged_transactions: items: $ref: '#/components/schemas/FlaggedTransactionDetailResponse' type: array title: Flagged Transactions flagged_documents: items: $ref: '#/components/schemas/FlaggedDocumentDetailResponse' type: array title: Flagged Documents total_transactions: type: integer title: Total Transactions total_documents: type: integer title: Total Documents default: 0 page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages description: Calculate total number of pages. readOnly: true type: object required: - investigation - flagged_transactions - total_transactions - total_pages title: InvestigationWithTransactionsResponse description: Response model for an investigation with paginated flagged transactions. ExpenseCategoryResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id category_name: type: string title: Category Name category_type: type: string title: Category Type description: anyOf: - type: string - type: 'null' title: Description is_recurring: type: boolean title: Is Recurring default: false average_monthly_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Average Monthly Amount display_name: type: string title: Display Name readOnly: true is_essential: type: boolean title: Is Essential readOnly: true type: object required: - id - dataset_id - category_name - category_type - display_name - is_essential title: ExpenseCategoryResponse description: Response model for expense categories TaxpayerIncomeBreakdown: properties: taxpayer_id: type: integer title: Taxpayer Id taxpayer_name: type: string title: Taxpayer Name net_monthly_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Monthly Income default: '0.00' other_individual_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Other Individual Income default: '0.00' joint_dividends: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Joint Dividends default: '0.00' joint_interest: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Joint Interest default: '0.00' over_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Over Withheld default: '0.00' under_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Under Withheld default: '0.00' total_monthly_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Monthly Income description: Total monthly income including W-2 net, other individual income, and joint income shares readOnly: true annual_net_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Annual Net Income description: Annual net income from W-2s (before joint income) readOnly: true type: object required: - taxpayer_id - taxpayer_name - total_monthly_income - annual_net_income title: TaxpayerIncomeBreakdown description: Individual taxpayer income breakdown for attorney view InvestigationWorkflowResult: properties: investigation_type: type: string title: Investigation Type description: Type of investigation that was conducted investigation_id: anyOf: - type: integer - type: 'null' title: Investigation Id description: ID of the investigation record in the database processing_time_seconds: anyOf: - type: number - type: 'null' title: Processing Time Seconds description: Total processing time in seconds summary: additionalProperties: true type: object title: Summary description: Summary of investigation findings type: object required: - investigation_type - summary title: InvestigationWorkflowResult description: Result information from a completed investigation workflow. AssistantContextResponse: properties: context_markdown: type: string title: Context Markdown title: type: string title: Title matter_id: anyOf: - type: string - type: 'null' title: Matter Id type: object required: - context_markdown - title title: AssistantContextResponse description: 'Seed context for the Task Assistant (ENG-15339 timelines / ENG-15338 doc review / ENG-15337 depositions). ``matter_id`` mirrors the deposition seed response; currently populated for Reliance List datasets only.' VehicleOwnerResponse: properties: id: type: integer title: Id vehicle_id: type: integer title: Vehicle Id taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id owner_name: type: string title: Owner Name role: anyOf: - type: string enum: - title_holder - co_title_holder - trust - corporate - other - type: 'null' title: Role ownership_percentage: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Ownership Percentage joint_designator: anyOf: - type: string enum: - and - or - and_or - type: 'null' title: Joint Designator source_description: anyOf: - type: string - type: 'null' title: Source Description type: object required: - id - vehicle_id - owner_name title: VehicleOwnerResponse description: 'One owner on a vehicle title. Multiple owners per vehicle are common — joint title (``Jane AND John Doe``), trustee + beneficiary, lessor + lessee. ``taxpayer_id`` is null until the post-extraction linking pass matches the owner name against a canonical taxpayer in the dataset (deterministic matcher — see ``link_vehicle_owners_to_taxpayers_activity``). Stays null when no confident match exists (ambiguity / no matching taxpayer yet). ``owner_name`` is always populated.' TaxDocumentListResponse: properties: documents: items: $ref: '#/components/schemas/TaxDocumentResponse' type: array title: Documents total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Income readOnly: true total_tax_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Withheld readOnly: true document_types: items: type: string type: array title: Document Types readOnly: true tax_years: items: type: integer type: array title: Tax Years readOnly: true type: object required: - documents - total - total_pages - total_income - total_tax_withheld - document_types - tax_years title: TaxDocumentListResponse description: List response for tax documents FactsRewriteRequest: properties: rewrite_instructions: type: string title: Rewrite Instructions target_sof_id: anyOf: - type: integer - type: 'null' title: Target Sof Id type: object required: - rewrite_instructions title: FactsRewriteRequest description: Rewrite the statement of facts for this dataset. AdultAllocationMember: properties: taxpayer_id: type: integer title: Taxpayer Id description: FK to taxpayers.id label: type: string title: Label description: Display name (e.g. 'John Smith') adult_share: type: integer maximum: 100.0 minimum: 0.0 title: Adult Share description: '% of ADULT-beneficiary expenses (0-100)' default: 0 household_share: type: integer maximum: 100.0 minimum: 0.0 title: Household Share description: '% of HOUSEHOLD-beneficiary expenses (0-100)' default: 0 general_share: type: integer maximum: 100.0 minimum: 0.0 title: General Share description: '% of GENERAL-beneficiary expenses (0-100)' default: 0 type: object required: - taxpayer_id - label title: AdultAllocationMember description: Share percentages for one adult (maps to taxpayers table). DatasetContractParty: properties: party_name: type: string title: Party Name frequency: type: integer title: Frequency type: object required: - party_name - frequency title: DatasetContractParty description: Contract Party such as 'CallidusAI, Inc' and how frequently it appears in contracts. ExpenseCategoryListResponse: properties: categories: items: $ref: '#/components/schemas/ExpenseCategoryResponse' type: array title: Categories total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_monthly_budget: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Monthly Budget readOnly: true type: object required: - categories - total - total_pages - total_monthly_budget title: ExpenseCategoryListResponse description: List response for expense categories EmployerListResponse: properties: employers: items: $ref: '#/components/schemas/EmployerResponse' type: array title: Employers total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true type: object required: - employers - total - total_pages title: EmployerListResponse description: List response for employers RelevanceResponse: properties: id: type: string title: Id document_source: $ref: '#/components/schemas/DatasetDocumentSource' filename: type: string title: Filename full_path: anyOf: - type: string - type: 'null' title: Full Path score: type: integer title: Score relevance_count: type: integer title: Relevance Count tags: items: type: string type: array title: Tags priority_score: anyOf: - type: number - type: 'null' title: Priority Score is_smoking_gun: type: boolean title: Is Smoking Gun default: false sg_thread: anyOf: - type: string - type: 'null' title: Sg Thread listing_needed: anyOf: - type: boolean - type: 'null' title: Listing Needed listing_reason: anyOf: - type: string - type: 'null' title: Listing Reason type: object required: - id - document_source - filename - score - relevance_count - tags title: RelevanceResponse description: A response record for a given document within our dataset InvestmentAccountResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id institution_id: type: integer title: Institution Id document_id: type: integer title: Document Id account_number_masked: anyOf: - type: string - type: 'null' title: Account Number Masked account_number_full: anyOf: - type: string - type: 'null' title: Account Number Full description: Full account number (use carefully) account_type: anyOf: - type: string - type: 'null' title: Account Type account_name: anyOf: - type: string - type: 'null' title: Account Name primary_holder_name: anyOf: - type: string - type: 'null' title: Primary Holder Name joint_holders: anyOf: - items: type: string type: array - type: 'null' title: Joint Holders beneficiaries: anyOf: - items: type: string type: array - type: 'null' title: Beneficiaries holder_kind: anyOf: - type: string - type: 'null' title: Holder Kind business_id: anyOf: - type: integer - type: 'null' title: Business Id opened_date: anyOf: - type: string format: date-time - type: 'null' title: Opened Date closed_date: anyOf: - type: string format: date-time - type: 'null' title: Closed Date is_active: type: boolean title: Is Active default: true contribution_limit: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Contribution Limit employer_match: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Employer Match vesting_percentage: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Vesting Percentage loan_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Loan Balance currency: type: string title: Currency default: USD metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex institution: anyOf: - additionalProperties: true type: object - type: 'null' title: Institution display_name: type: string title: Display Name readOnly: true is_retirement_account: type: boolean title: Is Retirement Account readOnly: true account_status: type: string title: Account Status readOnly: true has_loan: type: boolean title: Has Loan readOnly: true formatted_loan_balance: anyOf: - type: string - type: 'null' title: Formatted Loan Balance readOnly: true type: object required: - id - dataset_id - institution_id - document_id - display_name - is_retirement_account - account_status - has_loan - formatted_loan_balance title: InvestmentAccountResponse description: Response model for investment accounts AccountBalanceResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id account_id: type: integer title: Account Id document_id: type: integer title: Document Id balance_date: type: string format: date-time title: Balance Date beginning_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Beginning Balance ending_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Ending Balance available_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Available Balance total_credits: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Credits total_debits: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Debits source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id statement_period_start: anyOf: - type: string format: date-time - type: 'null' title: Statement Period Start statement_period_end: anyOf: - type: string format: date-time - type: 'null' title: Statement Period End account: anyOf: - $ref: '#/components/schemas/FinancialAccountResponse' - type: 'null' net_change: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Net Change readOnly: true period_length_days: anyOf: - type: integer - type: 'null' title: Period Length Days readOnly: true type: object required: - id - dataset_id - account_id - document_id - balance_date - ending_balance - net_change - period_length_days title: AccountBalanceResponse description: Response model for account balances CategorySpendingDataPoint: properties: category: type: string title: Category description: Category name (groceries, transport, etc.) amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Amount description: Total amount spent in this category transaction_count: type: integer title: Transaction Count description: Number of transactions in this category average_transaction: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Transaction description: Average transaction amount in this category readOnly: true type: object required: - category - amount - transaction_count - average_transaction title: CategorySpendingDataPoint description: Aggregated spending by category DatasetScoringCriteriaResponse: properties: revenue: items: $ref: '#/components/schemas/DatasetScoringCriteria' type: array title: Revenue non_revenue: items: $ref: '#/components/schemas/DatasetScoringCriteria' type: array title: Non Revenue type: object title: DatasetScoringCriteriaResponse description: Our dataset criteria response returns all contract categories and all the criteria set on them. DatasetRevenueResponse: properties: contract_count: type: integer title: Contract Count default: 0 type: object title: DatasetRevenueResponse description: 'Return the status of running our dataset revenue request (finding all contracts that generate revenue on behalf of the dataset ''entity_parties''). While we can simply return a number, we''re going to return a pydantic response object incase we want to add information to the response in the future.' ColumnsResponse: properties: standard_columns: items: type: string type: array title: Standard Columns extraction_columns: items: type: string type: array title: Extraction Columns type: object title: ColumnsResponse description: 'The response we shall give to the UI when it wants to know how many columns to prepare for this dataset when looking to display the data in a table like manner. By splitting them up we allow the UI to know which are the fixed columns that never change for a dataset and which are the variable ones based on criteria extraction; incase they want to color them different or whatnot.' AllocationConfigRequest: properties: adults: items: $ref: '#/components/schemas/AdultAllocationMember' type: array title: Adults dependents: items: $ref: '#/components/schemas/DependentAllocationMember' type: array title: Dependents type: object title: AllocationConfigRequest description: Request body for setting allocation config. Share groups must sum to 100. StartInvestigationRequest: properties: investigation_type: type: string title: Investigation Type description: 'Type of investigation: affair, asset_hiding, gambling, substance_abuse, general_suspicion' reasoning_effort: $ref: '#/components/schemas/ReasoningEffort' description: 'Reasoning effort level: minimal (Quick/fastest), medium (Balanced), high (Deep/slowest/most thorough)' default: medium account_id: anyOf: - type: integer - type: 'null' title: Account Id description: 'Optional: specific account to investigate' enable_pattern_analysis: type: boolean title: Enable Pattern Analysis description: Enable Phase 2 pattern analysis. Set to False for quick investigation without behavioral pattern detection. default: true type: object required: - investigation_type title: StartInvestigationRequest description: Request to start an investigation workflow. RealPropertyDetailResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id business_id: anyOf: - type: integer - type: 'null' title: Business Id business: anyOf: - $ref: '#/components/schemas/BusinessResponse' - type: 'null' owners: items: $ref: '#/components/schemas/RealPropertyOwnerResponse' type: array title: Owners default: [] description: anyOf: - type: string - type: 'null' title: Description address_full: anyOf: - type: string - type: 'null' title: Address Full street_number: anyOf: - type: integer - type: 'null' title: Street Number street_name: anyOf: - type: string - type: 'null' title: Street Name city: anyOf: - type: string - type: 'null' title: City state: anyOf: - type: string - type: 'null' title: State zip: anyOf: - type: string - type: 'null' title: Zip normalized_address_key: anyOf: - type: string - type: 'null' title: Normalized Address Key is_primary_residence: type: boolean title: Is Primary Residence default: false residence_type: anyOf: - type: string enum: - primary - secondary - vacation - investment - land - type: 'null' title: Residence Type acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price sold_date: anyOf: - type: string format: date - type: 'null' title: Sold Date sale_proceeds: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Sale Proceeds estimated_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of estimated_value_source: anyOf: - type: string - type: 'null' title: Estimated Value Source mortgage_holder: anyOf: - type: string - type: 'null' title: Mortgage Holder mortgage_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Mortgage Balance source_description: anyOf: - type: string - type: 'null' title: Source Description metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At ownership_type: type: string enum: - individual - entity - both - unknown title: Ownership Type description: 'Single-field summary of who owns this property. ``individual`` = at least one natural-person owner; ``entity`` = held inside a business (trust / LLC / S-Corp); ``both`` = a mix (a person plus a trust/entity on the deed, etc.); ``unknown`` = no owners attached yet. Entity-role owners (``corporate`` / ``trust``) are the business itself and don''t count as individuals — otherwise a deed naming only the company would read as ``both``. A ``corporate`` / ``trust`` owner row counts as entity ownership even when the property hasn''t been linked to a ``businesses`` row yet (deed-scan-only state).' readOnly: true primary_owner_name: anyOf: - type: string - type: 'null' title: Primary Owner Name description: 'Convenience: the single name the UI shows when it can''t fit the full owners list. Prefers the borrower (mortgage co-signor = strongest ownership signal), then primary_filer, then highest ownership_percentage, then first owner by id. The UI should still render the full ``owners`` list when space allows — this is the compact-cell fallback only.' readOnly: true type: object required: - id - dataset_id - created_at - updated_at - ownership_type - primary_owner_name title: RealPropertyDetailResponse description: 'Detail response — same shape as the list row today; reserved for future additions (e.g. embedded balance_sheet_items reference or mortgage history) without breaking the list response.' SoFVersionCreate: properties: title: type: string maxLength: 50 minLength: 1 title: Title focus_area_tags: items: type: string type: array title: Focus Area Tags writing_style: type: string pattern: ^(objective|persuasive)$ title: Writing Style default: objective deep_analysis: type: boolean title: Deep Analysis default: false analyze_for: items: type: string type: array title: Analyze For relevance_levels: items: type: string type: array title: Relevance Levels favorability: items: type: string type: array title: Favorability start_date: anyOf: - type: string - type: 'null' title: Start Date end_date: anyOf: - type: string - type: 'null' title: End Date event_limit: anyOf: - type: integer - type: 'null' title: Event Limit type: object required: - title title: SoFVersionCreate InvestmentIncomeAttributionResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id institution_id: anyOf: - type: integer - type: 'null' title: Institution Id year: type: integer title: Year income_kind: type: string title: Income Kind tax_form_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Tax Form Amount tax_form_document_ids: anyOf: - items: type: integer type: array - type: 'null' title: Tax Form Document Ids statement_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Statement Amount statement_account_value_ids: anyOf: - items: type: integer type: array - type: 'null' title: Statement Account Value Ids statement_transaction_ids: anyOf: - items: type: integer type: array - type: 'null' title: Statement Transaction Ids effective_source: anyOf: - type: string - type: 'null' title: Effective Source effective_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Effective Amount coverage_note: anyOf: - $ref: '#/components/schemas/IncomeReconciliationCoverageNote' - type: 'null' discrepancy: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Discrepancy last_reconciled_at: type: string format: date-time title: Last Reconciled At taxpayer_name: anyOf: - type: string - type: 'null' title: Taxpayer Name institution_name: anyOf: - type: string - type: 'null' title: Institution Name is_informational: type: boolean title: Is Informational description: 'True when this row has no usable income source — both the tax-form and statement-side aggregates are absent, so ``effective_source`` is NULL. Tax-form-backed rows (``effective_source == ''tax_form''``) are the active income source and are NOT informational, even though they may shadow a statement-side aggregate stored in ``statement_amount``.' readOnly: true has_discrepancy: type: boolean title: Has Discrepancy description: True when both sides have data and they disagree by more than $1. readOnly: true type: object required: - id - dataset_id - year - income_kind - last_reconciled_at - is_informational - has_discrepancy title: InvestmentIncomeAttributionResponse description: One reconciliation row — backs the income audit pane in the UI. RealPropertyUpdateRequest: properties: business_id: anyOf: - type: integer - type: 'null' title: Business Id description: anyOf: - type: string maxLength: 2000 - type: 'null' title: Description residence_type: anyOf: - type: string enum: - primary - secondary - vacation - investment - land - type: 'null' title: Residence Type is_primary_residence: anyOf: - type: boolean - type: 'null' title: Is Primary Residence address_full: anyOf: - type: string - type: 'null' title: Address Full street_number: anyOf: - type: integer minimum: 0.0 - type: 'null' title: Street Number street_name: anyOf: - type: string maxLength: 255 - type: 'null' title: Street Name city: anyOf: - type: string maxLength: 100 - type: 'null' title: City state: anyOf: - type: string maxLength: 2 - type: 'null' title: State zip: anyOf: - type: string maxLength: 20 - type: 'null' title: Zip acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price sold_date: anyOf: - type: string format: date - type: 'null' title: Sold Date sale_proceeds: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Sale Proceeds estimated_value: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of mortgage_holder: anyOf: - type: string maxLength: 255 - type: 'null' title: Mortgage Holder mortgage_balance: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Mortgage Balance additionalProperties: false type: object title: RealPropertyUpdateRequest description: "Body for ``PATCH /forensic/{dataset_id}/real-estate/residences/{property_id}``.\n\nAll fields optional — only those the attorney explicitly sets are written;\n``None`` means \"don't change\" (the schema can't clear a populated field).\nMirrors the vehicle update endpoint:\n\n- ``estimated_value`` is the primary use case — the pipeline creates a\n residence from a deed / 1098 with no current value. On any change it's\n stamped ``estimated_value_source=\"owner_estimate\"`` server-side and\n appended to ``metadata_ex.valuations`` history, and propagated to the\n property's balance-sheet item unless that row is locked.\n- Identity / classification / acquisition fields cover extractor\n corrections. Editing any address component re-syncs\n ``normalized_address_key`` so cross-document dedup stays consistent.\n\nThis endpoint does NOT lock the property — to pin a value against later\nauto-extracted appraisals, lock the balance-sheet row (BSI ``is_locked``)." IncomeReconciliationCoverageNote: properties: statement_count: type: integer title: Statement Count default: 0 period_start: anyOf: - type: string - type: 'null' title: Period Start period_end: anyOf: - type: string - type: 'null' title: Period End full_year_implied: type: boolean title: Full Year Implied default: false type: object title: IncomeReconciliationCoverageNote description: Statement-side coverage metadata for a reconciliation row. FinancialAccountListResponse: properties: accounts: items: $ref: '#/components/schemas/FinancialAccountResponse' type: array title: Accounts total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true active_accounts: type: integer title: Active Accounts readOnly: true closed_accounts: type: integer title: Closed Accounts readOnly: true type: object required: - accounts - total - total_pages - active_accounts - closed_accounts title: FinancialAccountListResponse description: List response for financial accounts BalanceSheetListResponse: properties: items: items: $ref: '#/components/schemas/BalanceSheetItemResponse' type: array title: Items total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true type: object required: - items - total - total_pages title: BalanceSheetListResponse description: Paginated list of balance-sheet items in a dataset. datamodels__discovery__forensic__profiles__TaxPayerResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id tax_document_id: anyOf: - type: integer - type: 'null' title: Tax Document Id primary_name: type: string title: Primary Name primary_ssn_status: anyOf: - type: string - type: 'null' title: Primary Ssn Status spouse_name: anyOf: - type: string - type: 'null' title: Spouse Name spouse_ssn_status: anyOf: - type: string - type: 'null' title: Spouse Ssn Status address: anyOf: - type: string - type: 'null' title: Address phone: anyOf: - type: string - type: 'null' title: Phone filing_status: anyOf: - type: string - type: 'null' title: Filing Status exemptions: anyOf: - type: integer - type: 'null' title: Exemptions spouse_role: anyOf: - type: string - type: 'null' title: Spouse Role type: object required: - id - dataset_id - primary_name title: TaxPayerResponse description: Response model for taxpayers MatterFileSuggestionsResponse: properties: matter_intelligence_enabled: type: boolean title: Matter Intelligence Enabled default: false mode: type: string enum: - initial - incremental title: Mode default: initial cutoff_at: anyOf: - type: string format: date-time - type: 'null' title: Cutoff At documents: items: $ref: '#/components/schemas/MatterFileSuggestionDoc' type: array title: Documents type: object title: MatterFileSuggestionsResponse description: Candidate matter-level files to suggest after the Add Files step. ScoringCriteriaResponse: properties: id: type: integer title: Id name: type: string title: Name a_grade_revenue: type: string title: A Grade Revenue f_grade_revenue: type: string title: F Grade Revenue a_grade: type: string title: A Grade f_grade: type: string title: F Grade type: object required: - id - name - a_grade_revenue - f_grade_revenue - a_grade - f_grade title: ScoringCriteriaResponse description: One of our scoring criteria, we can have many of these associated with a contract category ProfileResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id petitioner_taxpayer_id: anyOf: - type: integer - type: 'null' title: Petitioner Taxpayer Id respondent_taxpayer_id: anyOf: - type: integer - type: 'null' title: Respondent Taxpayer Id jurisdiction: anyOf: - type: string - type: 'null' title: Jurisdiction party_role: anyOf: - type: string - type: 'null' title: Party Role marriage_date: anyOf: - type: string format: date-time - type: 'null' title: Marriage Date separation_date: anyOf: - type: string format: date-time - type: 'null' title: Separation Date date_of_filing: anyOf: - type: string format: date-time - type: 'null' title: Date Of Filing prior_separation_periods: anyOf: - items: additionalProperties: anyOf: - type: string - type: 'null' type: object type: array - type: 'null' title: Prior Separation Periods addresses: anyOf: - items: type: string type: array - type: 'null' title: Addresses allocation_config: anyOf: - additionalProperties: true type: object - type: 'null' title: Allocation Config type: object required: - id - dataset_id title: ProfileResponse description: Response model for forensic profile VehicleUpdateRequest: properties: vin: anyOf: - type: string maxLength: 32 - type: 'null' title: Vin year: anyOf: - type: integer maximum: 2100.0 minimum: 1900.0 - type: 'null' title: Year make: anyOf: - type: string maxLength: 64 - type: 'null' title: Make model: anyOf: - type: string maxLength: 128 - type: 'null' title: Model trim: anyOf: - type: string maxLength: 64 - type: 'null' title: Trim body_type: anyOf: - type: string maxLength: 64 - type: 'null' title: Body Type fuel_type: anyOf: - type: string maxLength: 32 - type: 'null' title: Fuel Type color: anyOf: - type: string maxLength: 32 - type: 'null' title: Color empty_weight_lb: anyOf: - type: integer minimum: 0.0 - type: 'null' title: Empty Weight Lb odometer_reading: anyOf: - type: integer minimum: 0.0 - type: 'null' title: Odometer Reading odometer_brand: anyOf: - type: string enum: - actual - exempt - not_actual - over_100k - type: 'null' title: Odometer Brand odometer_as_of: anyOf: - type: string format: date - type: 'null' title: Odometer As Of title_number: anyOf: - type: string maxLength: 64 - type: 'null' title: Title Number title_issuing_state: anyOf: - type: string maxLength: 2 - type: 'null' title: Title Issuing State title_issue_date: anyOf: - type: string format: date - type: 'null' title: Title Issue Date title_brands: anyOf: - items: type: string type: array - type: 'null' title: Title Brands has_lienholder: anyOf: - type: boolean - type: 'null' title: Has Lienholder lienholder_name: anyOf: - type: string maxLength: 255 - type: 'null' title: Lienholder Name lienholder_address: anyOf: - type: string - type: 'null' title: Lienholder Address estimated_value: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price business_id: anyOf: - type: integer - type: 'null' title: Business Id additionalProperties: false type: object title: VehicleUpdateRequest description: 'Body for ``PATCH /forensic/{dataset_id}/vehicles/{vehicle_id}``. All fields optional — only those the attorney explicitly sets are written. ``None`` means "don''t change"; the request schema cannot be used to clear a populated field (a future ``clear_fields`` parameter can add that when there''s a use case). Per the design call on ENG-12939: this endpoint does **not** lock the Vehicle row. A subsequent auto-extracted KBB / title with a newer ``as_of_date`` will run through the standard merge policy and may overwrite the attorney''s entry. If the attorney wants a value to stick, they lock the row on the balance sheet (BSI ``is_locked=True``), which prevents this endpoint''s BSI propagation from touching ``current_amount``. Manual ``estimated_value`` entries are recorded as ``valuation_source="owner_estimate"`` in the historical valuations list so the UI can render attorney-entered values alongside auto-extracted KBB / NADA / BeenVerified entries.' ProgressModel: properties: total: type: integer title: Total default: 0 processed: type: integer title: Processed default: 0 type: object title: ProgressModel description: Progress tracking for a job - matches ARQ format. ProcessingReason: type: string enum: - initial - files_added - files_deleted - files_changed ValuationFields: properties: manual_valuation: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Manual Valuation llm_estimated_valuation: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Llm Estimated Valuation llm_basis: anyOf: - additionalProperties: true type: object - type: 'null' title: Llm Basis llm_generated_at: anyOf: - type: string format: date-time - type: 'null' title: Llm Generated At book_equity_at_eop: anyOf: - $ref: '#/components/schemas/BookEquityAtEop' - type: 'null' type: object title: ValuationFields description: 'The valuation block on the GET response. ``manual_valuation`` is the lawyer''s override. ``llm_estimated_valuation`` is the cached output of POST .../valuation/estimate. ``book_equity_at_eop`` is the convenience headline value the balance-sheet integration defaults to when no manual/LLM valuation exists.' RentalPropertyResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id business_id: anyOf: - type: integer - type: 'null' title: Business Id business: anyOf: - $ref: '#/components/schemas/BusinessResponse' - type: 'null' taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id taxpayer: anyOf: - $ref: '#/components/schemas/datamodels__discovery__forensic__income__TaxPayerResponse' - type: 'null' description: anyOf: - type: string - type: 'null' title: Description address_full: anyOf: - type: string - type: 'null' title: Address Full street_number: anyOf: - type: integer - type: 'null' title: Street Number street_name: anyOf: - type: string - type: 'null' title: Street Name city: anyOf: - type: string - type: 'null' title: City state: anyOf: - type: string - type: 'null' title: State zip: anyOf: - type: string - type: 'null' title: Zip normalized_address_key: anyOf: - type: string - type: 'null' title: Normalized Address Key property_type_code: anyOf: - type: integer - type: 'null' title: Property Type Code property_type_description: anyOf: - type: string - type: 'null' title: Property Type Description acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price sold_date: anyOf: - type: string format: date - type: 'null' title: Sold Date sale_proceeds: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Sale Proceeds mortgage_holder: anyOf: - type: string - type: 'null' title: Mortgage Holder mortgage_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Mortgage Balance estimated_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of estimated_value_source: anyOf: - type: string - type: 'null' title: Estimated Value Source metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At ownership_type: type: string enum: - individual - entity - both - unknown title: Ownership Type description: 'Single-field summary of who/what owns this property. UI sentinel: render an "Individual" badge in green (direct marital asset), "Entity" in blue (held inside an S-Corp / partnership / LLC), "Both" in amber (manual review), or "Unknown" in grey (pending other docs).' readOnly: true entity_owner_type: anyOf: - type: string - type: 'null' title: Entity Owner Type description: 'When entity-owned, the business''s tax classification (``s_corp`` / ``partnership`` / ``c_corp`` / ``disregarded_entity`` / ``sole_proprietorship``) so the UI can disambiguate pass-through from C-Corp without a second lookup. Null when ownership_type is not ``entity`` / ``both``.' readOnly: true type: object required: - id - dataset_id - created_at - updated_at - ownership_type - entity_owner_type title: RentalPropertyResponse description: 'Rental property summary used in list views and as the base of detail responses. ``ownership_type`` is the at-a-glance signal for family-law analysis: individual ownership is typically a direct marital asset, while entity ownership requires drilling into the business''s shareholders.' PaginatedTimelineResponse: properties: events: items: $ref: '#/components/schemas/datamodels__discovery__facts__TimelineEventResponse' type: array title: Events pagination: $ref: '#/components/schemas/PaginationMetadata' timeline_sync: type: boolean title: Timeline Sync default: false legal_analysis: anyOf: - type: string - type: 'null' title: Legal Analysis facts_summary: anyOf: - type: string - type: 'null' title: Facts Summary type: object required: - events - pagination title: PaginatedTimelineResponse description: Paginated timeline events response. TimelineEventBulkUpdate: properties: events: items: $ref: '#/components/schemas/TimelineEventCreate' type: array title: Events type: object required: - events title: TimelineEventBulkUpdate description: Request model for bulk replacing all timeline events for a dataset. DatasetType: type: string enum: - contract - discovery - benchmark - facts - depositions - reliance - forensic_accounting - oral_argument_simulator title: DatasetType BusinessResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id name: type: string title: Name ein: anyOf: - type: string - type: 'null' title: Ein ein_last4: anyOf: - type: string - type: 'null' title: Ein Last4 taxpayer_id_kind: anyOf: - $ref: '#/components/schemas/TaxpayerIdKind' - type: 'null' state_of_formation: anyOf: - type: string - type: 'null' title: State Of Formation tax_classification: $ref: '#/components/schemas/TaxClassification' default: unknown legal_entity_type: $ref: '#/components/schemas/LegalEntityType' default: unknown source_tax_document_id: anyOf: - type: integer - type: 'null' title: Source Tax Document Id source_document_type: anyOf: - type: string - type: 'null' title: Source Document Type verified_by: items: type: string type: array title: Verified By principal_business_activity: anyOf: - type: string - type: 'null' title: Principal Business Activity naics_code: anyOf: - type: string - type: 'null' title: Naics Code accounting_method: anyOf: - type: string - type: 'null' title: Accounting Method formation_year: anyOf: - type: integer - type: 'null' title: Formation Year is_active_this_year: type: boolean title: Is Active This Year default: true business_address: anyOf: - type: string - type: 'null' title: Business Address taxpayer_ownership_pct: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Taxpayer Ownership Pct created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At type: object required: - id - dataset_id - name - created_at - updated_at title: BusinessResponse description: Single business-entity record (any tax classification, any legal wrapper). ValuationMethodWeights: properties: income: type: number title: Income market: type: number title: Market asset: type: number title: Asset type: object required: - income - market - asset title: ValuationMethodWeights description: Per-approach weights; should sum to 1.0. DatasetTaskIdResponse: properties: task_id: anyOf: - type: string - type: 'null' title: Task Id type: object title: DatasetTaskIdResponse description: Platform task id (Conversation.id) linked to this dataset, if any. Used for doc-hub integration. InvestmentHoldingResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id account_id: type: integer title: Account Id document_id: type: integer title: Document Id symbol: type: string title: Symbol security_name: anyOf: - type: string - type: 'null' title: Security Name asset_type: anyOf: - type: string - type: 'null' title: Asset Type quantity: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Quantity price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Price market_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Market Value cost_basis: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Cost Basis unrealized_gain_loss: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Unrealized Gain Loss unrealized_gain_loss_percent: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Unrealized Gain Loss Percent yield_rate: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Yield Rate maturity_date: anyOf: - type: string format: date-time - type: 'null' title: Maturity Date is_restricted: anyOf: - type: boolean - type: 'null' title: Is Restricted vesting_date: anyOf: - type: string format: date-time - type: 'null' title: Vesting Date source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id holding_date: anyOf: - type: string format: date-time - type: 'null' title: Holding Date metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex account: anyOf: - $ref: '#/components/schemas/InvestmentAccountResponse' - type: 'null' display_name: type: string title: Display Name readOnly: true formatted_market_value: type: string title: Formatted Market Value readOnly: true formatted_quantity: type: string title: Formatted Quantity readOnly: true formatted_price: anyOf: - type: string - type: 'null' title: Formatted Price readOnly: true unrealized_gain_loss_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Unrealized Gain Loss Amount readOnly: true is_profitable: anyOf: - type: boolean - type: 'null' title: Is Profitable readOnly: true is_bond_or_cd: type: boolean title: Is Bond Or Cd readOnly: true days_to_maturity: anyOf: - type: integer - type: 'null' title: Days To Maturity readOnly: true days_to_vesting: anyOf: - type: integer - type: 'null' title: Days To Vesting readOnly: true type: object required: - id - dataset_id - account_id - document_id - symbol - market_value - display_name - formatted_market_value - formatted_quantity - formatted_price - unrealized_gain_loss_amount - is_profitable - is_bond_or_cd - days_to_maturity - days_to_vesting title: InvestmentHoldingResponse description: Response model for investment holdings ExpenseRecordListResponse: properties: expenses: items: $ref: '#/components/schemas/ExpenseRecordResponse' type: array title: Expenses total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Amount readOnly: true total_tax: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax readOnly: true total_tips: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tips readOnly: true business_expenses_count: type: integer title: Business Expenses Count readOnly: true personal_expenses_count: type: integer title: Personal Expenses Count readOnly: true unique_expense_types: items: type: string type: array title: Unique Expense Types readOnly: true date_range_start: anyOf: - type: string format: date-time - type: 'null' title: Date Range Start readOnly: true date_range_end: anyOf: - type: string format: date-time - type: 'null' title: Date Range End readOnly: true type: object required: - expenses - total - total_pages - total_amount - total_tax - total_tips - business_expenses_count - personal_expenses_count - unique_expense_types - date_range_start - date_range_end title: ExpenseRecordListResponse description: List response for expense records BookEquityAtEop: properties: period_end: type: string format: date title: Period End value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Value statement_id: anyOf: - type: integer - type: 'null' title: Statement Id type: object required: - period_end - value title: BookEquityAtEop description: '``total_equity`` from the most recent Balance Sheet on file.' LiabilityCategoryDailySpendingSummaryResponse: properties: dataset_id: type: integer title: Dataset Id liability_type: type: string title: Liability Type liability_type_display_name: type: string title: Liability Type Display Name account_count: type: integer title: Account Count default: 0 date_range_start: type: string format: date-time title: Date Range Start date_range_end: type: string format: date-time title: Date Range End daily_spending: items: $ref: '#/components/schemas/DailySpendingDataPoint' type: array title: Daily Spending default: [] total_charges: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Charges default: '0.00' total_payments: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Payments default: '0.00' total_transactions: type: integer title: Total Transactions default: 0 net_activity: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Activity description: Net spending across all accounts (charges - payments) readOnly: true average_daily_charges: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Daily Charges description: Average charges per day across all accounts readOnly: true peak_spending_day: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Peak Spending Day description: Highest single-day spending amount across all accounts readOnly: true spending_trend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Spending Trend description: 'Trend: compare first week vs last week average' readOnly: true average_per_account: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Per Account description: Average spending per account readOnly: true type: object required: - dataset_id - liability_type - liability_type_display_name - date_range_start - date_range_end - net_activity - average_daily_charges - peak_spending_day - spending_trend - average_per_account title: LiabilityCategoryDailySpendingSummaryResponse description: Daily spending summary for a liability category (e.g., all credit cards) MerchantResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id name: type: string title: Name name_normalized: anyOf: - type: string - type: 'null' title: Name Normalized merchant_type: anyOf: - type: string - type: 'null' title: Merchant Type address: anyOf: - type: string - type: 'null' title: Address city: anyOf: - type: string - type: 'null' title: City state: anyOf: - type: string - type: 'null' title: State zip_code: anyOf: - type: string - type: 'null' title: Zip Code country: anyOf: - type: string - type: 'null' title: Country phone: anyOf: - type: string - type: 'null' title: Phone website: anyOf: - type: string - type: 'null' title: Website total_expenses: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Expenses transaction_count: anyOf: - type: integer - type: 'null' title: Transaction Count first_transaction_date: anyOf: - type: string format: date-time - type: 'null' title: First Transaction Date last_transaction_date: anyOf: - type: string format: date-time - type: 'null' title: Last Transaction Date metadata_ex: anyOf: - additionalProperties: anyOf: - type: string - type: integer - type: number - type: boolean - type: 'null' type: object - type: 'null' title: Metadata Ex display_name: type: string title: Display Name readOnly: true full_address: anyOf: - type: string - type: 'null' title: Full Address readOnly: true average_transaction_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Average Transaction Amount readOnly: true activity_period_days: anyOf: - type: integer - type: 'null' title: Activity Period Days readOnly: true type: object required: - id - dataset_id - name - display_name - full_address - average_transaction_amount - activity_period_days title: MerchantResponse description: Response model for merchants/vendors ContractCount: properties: name: type: string title: Name id: type: integer title: Id count: type: integer title: Count type: object required: - name - id - count title: ContractCount description: The name of the contract type and the count of how many we found BusinessValuationResponse: properties: business_id: type: integer title: Business Id marital_character: anyOf: - type: string enum: - marital - non_marital - disputed - type: 'null' title: Marital Character valuation: $ref: '#/components/schemas/ValuationFields' pretax_income_by_year: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: Pretax Income By Year net_income_by_year: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: Net Income By Year total_assets_by_year: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: Total Assets By Year total_equity_by_year: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: Total Equity By Year operating_cash_flow_by_year: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: Operating Cash Flow By Year owner_distributions_by_year: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: Owner Distributions By Year parties: items: $ref: '#/components/schemas/BusinessValuationParty' type: array title: Parties linked_statements: items: $ref: '#/components/schemas/LinkedStatement' type: array title: Linked Statements type: object required: - business_id title: BusinessValuationResponse description: 'Merged GET response: auto-fill values + lawyer overrides + statement aggregates. Year keys (``*_by_year``) use the ISO calendar year string (``"2024"``) when the statement''s ``period_end`` falls in the 12-29 → 01-03 window, otherwise the ISO date string (``"2024-06-30"``) so non-calendar fiscal years remain distinguishable.' DependentUpdateRequest: properties: id: anyOf: - type: integer - type: 'null' title: Id taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id tax_document_id: anyOf: - type: integer - type: 'null' title: Tax Document Id full_name: type: string title: Full Name date_of_birth: anyOf: - type: string format: date-time - type: 'null' title: Date Of Birth relationship_type: anyOf: - type: string - type: 'null' title: Relationship Type months_lived_with_taxpayer: anyOf: - type: integer - type: 'null' title: Months Lived With Taxpayer childcare_expenses: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Childcare Expenses childcare_provider_name: anyOf: - type: string - type: 'null' title: Childcare Provider Name educational_expenses: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Educational Expenses is_case_dependent: type: boolean title: Is Case Dependent default: true belongs_to_party: anyOf: - type: string - type: 'null' title: Belongs To Party petitioner_relationship: anyOf: - type: string - type: 'null' title: Petitioner Relationship respondent_relationship: anyOf: - type: string - type: 'null' title: Respondent Relationship parenting_time_percent: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Parenting Time Percent monthly_childcare_costs: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Monthly Childcare Costs monthly_child_support_payment: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Monthly Child Support Payment special_needs: type: boolean title: Special Needs default: false sex: anyOf: - type: string - type: 'null' title: Sex type: object required: - full_name title: DependentUpdateRequest description: Request model for creating or updating a dependent PagedResponse_ContractDetailResponse_: properties: items: items: $ref: '#/components/schemas/ContractDetailResponse' type: array title: Items pagination: $ref: '#/components/schemas/PaginationMeta' type: object required: - items - pagination title: PagedResponse[ContractDetailResponse] ContractDetailResponse: properties: contracts: items: $ref: '#/components/schemas/ContractDetails' type: array title: Contracts type: object required: - contracts title: ContractDetailResponse TransactionListResponse: properties: transactions: items: $ref: '#/components/schemas/TransactionResponse' type: array title: Transactions total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_credits: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Credits readOnly: true total_debits: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Debits readOnly: true net_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Amount readOnly: true type: object required: - transactions - total - total_pages - total_credits - total_debits - net_amount title: TransactionListResponse description: List response for transactions InvestigationListItemResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id investigation_type: type: string title: Investigation Type evidence_strength: type: string title: Evidence Strength total_flagged: type: integer title: Total Flagged total_suspicious_spending: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Suspicious Spending created_at: type: string format: date-time title: Created At error_message: anyOf: - type: string - type: 'null' title: Error Message metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex description: Additional metadata including report_path for PDF reports formatted_total_suspicious_spending: anyOf: - type: string - type: 'null' title: Formatted Total Suspicious Spending description: Format total suspicious spending as currency. readOnly: true type: object required: - id - dataset_id - investigation_type - evidence_strength - total_flagged - created_at - formatted_total_suspicious_spending title: InvestigationListItemResponse description: Minimal response model for investigation list items (excludes heavy fields like summary, timeline, etc.). AccountBalanceListResponse: properties: balances: items: $ref: '#/components/schemas/AccountBalanceResponse' type: array title: Balances total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true type: object required: - balances - total - total_pages title: AccountBalanceListResponse description: List response for account balances DatasetAttachFileResponse: properties: id: type: integer title: Id filename: type: string title: Filename type: object required: - id - filename title: DatasetAttachFileResponse description: Response model for attaching a file to a dataset. VehicleListResponse: properties: vehicles: items: $ref: '#/components/schemas/VehicleResponse' type: array title: Vehicles total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true type: object required: - vehicles - total - total_pages title: VehicleListResponse description: Paginated list of vehicles in a dataset. DatasetFillFormRequest: properties: form_schema: additionalProperties: true type: object title: Form Schema form_type: anyOf: - type: string - type: 'null' title: Form Type type: object required: - form_schema title: DatasetFillFormRequest description: 'Fill a caller-supplied form schema from this dataset''s Statement of Facts content. The dataset-sourced sibling of ``POST /form-filler/fill`` (matter-sourced): the caller owns the schema, the dataset supplies the source text.' ExpenseAllocationResponse: properties: members: items: $ref: '#/components/schemas/MemberAllocationRow' type: array title: Members total_spend: type: number title: Total Spend description: Total spend in the analysis window annualized_spend: type: number title: Annualized Spend description: Annualized projected spend (total_spend * 365.25 / days_in_window) default: 0.0 annualized_method: type: string enum: - last_30_days - last_90_days - last_6_months - last_12_months - ytd - custom title: Annualized Method description: Method used to compute the annualized window default: last_12_months annualized_days: type: integer title: Annualized Days description: Number of days in the analysis window default: 0 annualized_period_start: anyOf: - type: string format: date-time - type: 'null' title: Annualized Period Start description: Start of the analysis window annualized_period_end: anyOf: - type: string format: date-time - type: 'null' title: Annualized Period End description: End of the analysis window unallocated_spend: type: number title: Unallocated Spend description: Spend that could not be allocated default: 0.0 adult_pool: type: number title: Adult Pool description: Total ADULT-beneficiary spend before splitting default: 0.0 child_pool: type: number title: Child Pool description: Total CHILD-beneficiary spend before splitting default: 0.0 household_pool: type: number title: Household Pool description: Total HOUSEHOLD-beneficiary spend before splitting default: 0.0 general_pool: type: number title: General Pool description: Total GENERAL-beneficiary spend before splitting default: 0.0 specific_pool: type: number title: Specific Pool description: Total spend matched to specific person names default: 0.0 type: object required: - members - total_spend title: ExpenseAllocationResponse description: Full computed expense allocation across all family members. DatasetIncomeSummaryResponse: properties: dataset_id: type: integer title: Dataset Id total_documents: type: integer title: Total Documents default: 0 total_gross_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Gross Income default: '0.00' total_net_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Net Income default: '0.00' total_tax_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Withheld default: '0.00' total_tax_liability: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Liability default: '0.00' over_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Over Withheld default: '0.00' under_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Under Withheld default: '0.00' total_deductions: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Deductions default: '0.00' total_credits: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Credits default: '0.00' unique_taxpayers: type: integer title: Unique Taxpayers default: 0 unique_employers: type: integer title: Unique Employers default: 0 unique_corporate_entities: type: integer title: Unique Corporate Entities default: 0 red_flags: type: integer title: Red Flags default: 0 date_range_start: anyOf: - type: string format: date-time - type: 'null' title: Date Range Start date_range_end: anyOf: - type: string format: date-time - type: 'null' title: Date Range End tax_year_summaries: items: $ref: '#/components/schemas/TaxYearSummary' type: array title: Tax Year Summaries default: [] income_type_summaries: items: $ref: '#/components/schemas/IncomeTypeSummary' type: array title: Income Type Summaries default: [] top_employers: items: $ref: '#/components/schemas/EmployerIncomeSummary' type: array title: Top Employers default: [] taxpayer_breakdowns: items: $ref: '#/components/schemas/TaxpayerIncomeBreakdown' type: array title: Taxpayer Breakdowns default: [] effective_tax_rate: type: number title: Effective Tax Rate readOnly: true unique_income_sources: type: integer title: Unique Income Sources description: 'Distinct income-producing payers: employers (W-2/1099) + corporate entities (K-1).' readOnly: true analysis_period_days: anyOf: - type: integer - type: 'null' title: Analysis Period Days readOnly: true estimated_annual_income: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Annual Income readOnly: true type: object required: - dataset_id - effective_tax_rate - unique_income_sources - analysis_period_days - estimated_annual_income title: DatasetIncomeSummaryResponse description: Overall income summary for a dataset ContractGrade: properties: A: type: integer title: A default: 0 B: type: integer title: B default: 0 C: type: integer title: C default: 0 D: type: integer title: D default: 0 F: type: integer title: F default: 0 type: object title: ContractGrade description: Classic school grading system, count all the contracts for each grade category. SoFVersionUpdate: properties: title: anyOf: - type: string maxLength: 50 minLength: 1 - type: 'null' title: Title content: anyOf: - type: string - type: 'null' title: Content facts_summary: anyOf: - type: string - type: 'null' title: Facts Summary type: object title: SoFVersionUpdate LiabilityTypeSummary: properties: liability_type: type: string title: Liability Type account_count: type: integer title: Account Count default: 0 total_current_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Current Balance default: '0.00' total_original_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Original Amount default: '0.00' total_credit_limit: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Credit Limit default: '0.00' total_minimum_payments: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Minimum Payments default: '0.00' average_interest_rate: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Average Interest Rate average_balance_per_account: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Balance Per Account readOnly: true total_credit_utilization: anyOf: - type: number - type: 'null' title: Total Credit Utilization readOnly: true type: object required: - liability_type - average_balance_per_account - total_credit_utilization title: LiabilityTypeSummary description: Summary statistics for a specific liability type DatasetInvestmentSummaryResponse: properties: dataset_id: type: integer title: Dataset Id total_accounts: type: integer title: Total Accounts default: 0 active_accounts: type: integer title: Active Accounts default: 0 retirement_accounts: type: integer title: Retirement Accounts default: 0 total_current_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Current Value default: '0.00' total_cash_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Cash Balance default: '0.00' total_contributions: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Contributions default: '0.00' total_withdrawals: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Withdrawals default: '0.00' total_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Income default: '0.00' total_unrealized_gains_losses: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Unrealized Gains Losses default: '0.00' total_fees_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Fees Paid default: '0.00' unique_holdings: type: integer title: Unique Holdings default: 0 total_transactions: type: integer title: Total Transactions default: 0 date_range_start: anyOf: - type: string format: date-time - type: 'null' title: Date Range Start date_range_end: anyOf: - type: string format: date-time - type: 'null' title: Date Range End account_summaries: items: $ref: '#/components/schemas/datamodels__discovery__forensic__investments__AccountSummary' type: array title: Account Summaries default: [] top_holdings: items: $ref: '#/components/schemas/HoldingSummary' type: array title: Top Holdings default: [] net_contributions: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Contributions readOnly: true total_return: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Return readOnly: true total_return_percent: anyOf: - type: number - type: 'null' title: Total Return Percent readOnly: true analysis_period_days: anyOf: - type: integer - type: 'null' title: Analysis Period Days readOnly: true total_retirement_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Retirement Value description: 'Sum of ``current_value`` across accounts whose ``account_type`` marks them as retirement (TRAD/Roth IRA, SIMPLE IRA, SEP IRA, 401(k), 403(b), 457, TSP, pension, annuity). Uses the shared ``_is_retirement_account_type`` classifier so this number stays in lockstep with the retirement_accounts count and avoids the bucket- mismatch where the UI''s own filter excluded simple_ira.' readOnly: true total_taxable_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Taxable Value description: 'Sum of ``current_value`` across non-retirement accounts. Equals ``total_current_value - total_retirement_value`` by construction.' readOnly: true average_account_value: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Account Value readOnly: true type: object required: - dataset_id - net_contributions - total_return - total_return_percent - analysis_period_days - total_retirement_value - total_taxable_value - average_account_value title: DatasetInvestmentSummaryResponse description: Overall investment summary for a dataset TimelineResponse: properties: timeline: additionalProperties: true type: object title: Timeline description: The facts timeline data meta: $ref: '#/components/schemas/TimelineMetadata' description: Metadata about the timeline and compression type: object required: - timeline - meta title: TimelineResponse description: Response model for compressed timeline data. ExpenseLineItemResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id expense_record_id: type: integer title: Expense Record Id item_description: type: string title: Item Description item_category: anyOf: - type: string - type: 'null' title: Item Category quantity: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Quantity unit_price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Unit Price total_price: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Price product_code: anyOf: - type: string - type: 'null' title: Product Code brand: anyOf: - type: string - type: 'null' title: Brand size_description: anyOf: - type: string - type: 'null' title: Size Description is_essential: anyOf: - type: boolean - type: 'null' title: Is Essential age_group: anyOf: - type: string - type: 'null' title: Age Group notes: anyOf: - type: string - type: 'null' title: Notes metadata_ex: anyOf: - additionalProperties: anyOf: - type: string - type: integer - type: number - type: boolean - type: 'null' type: object - type: 'null' title: Metadata Ex display_description: type: string title: Display Description readOnly: true formatted_price: type: string title: Formatted Price readOnly: true price_per_unit: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Price Per Unit readOnly: true type: object required: - id - dataset_id - expense_record_id - item_description - total_price - display_description - formatted_price - price_per_unit title: ExpenseLineItemResponse description: Response model for expense line items ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError AllocationConfigResponse: properties: adults: items: $ref: '#/components/schemas/AdultAllocationMember' type: array title: Adults dependents: items: $ref: '#/components/schemas/DependentAllocationMember' type: array title: Dependents type: object title: AllocationConfigResponse description: 'Current allocation config stored on the profile. user_modified is stored in JSONB for server-side use (discovery staging) but is not exposed in this response so clients never send or receive it.' AgentAskRequest: properties: question: type: string title: Question description: User question to ask the agent account_id: anyOf: - type: integer - type: 'null' title: Account Id description: Optional account scope for the question reasoning_effort: type: string title: Reasoning Effort description: 'Reasoning effort level: ''minimal'' (fastest), ''low'', ''medium'', ''high'' (slowest/most thorough)' default: minimal type: object required: - question title: AgentAskRequest description: Agent question request for forensic financial data. TaxDeductionResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id tax_document_id: type: integer title: Tax Document Id deduction_type: type: string title: Deduction Type amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Amount description: anyOf: - type: string - type: 'null' title: Description schedule_reference: anyOf: - type: string - type: 'null' title: Schedule Reference formatted_amount: anyOf: - type: string - type: 'null' title: Formatted Amount readOnly: true display_description: type: string title: Display Description readOnly: true type: object required: - id - dataset_id - tax_document_id - deduction_type - formatted_amount - display_description title: TaxDeductionResponse description: Response model for tax deductions LiabilityAccountResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id institution_id: type: integer title: Institution Id description: ID of the financial institution document_id: type: integer title: Document Id description: ID of the source document account_number_masked: anyOf: - type: string - type: 'null' title: Account Number Masked description: Masked account number in format ****1234 (four asterisks + last 4 digits) account_number_full: anyOf: - type: string - type: 'null' title: Account Number Full description: Full account number (use carefully) liability_type: anyOf: - type: string - type: 'null' title: Liability Type description: Type of liability (credit_card, personal_loan, auto_loan, etc.) account_name: anyOf: - type: string - type: 'null' title: Account Name description: Account nickname or branded name (e.g., 'Discover It Rewards', 'Chase Freedom') primary_holder_name: anyOf: - type: string - type: 'null' title: Primary Holder Name description: Name of the primary account holder joint_holders: anyOf: - items: type: string type: array - type: 'null' title: Joint Holders description: List of joint account holders holder_kind: anyOf: - type: string - type: 'null' title: Holder Kind description: 'Business-vs-personal classification: ''personal'' / ''business'' / null. Null marks legacy rows that pre-date the column.' business_id: anyOf: - type: integer - type: 'null' title: Business Id description: FK to the resolved ``businesses`` row for business-titled accounts. Always NULL for personal accounts — the FE filter pivots on holder_kind. original_loan_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Original Loan Amount description: Original loan amount for loans opened_date: anyOf: - type: string format: date-time - type: 'null' title: Opened Date description: Date the account was opened maturity_date: anyOf: - type: string format: date-time - type: 'null' title: Maturity Date description: Maturity date for loans closed_date: anyOf: - type: string format: date-time - type: 'null' title: Closed Date description: Date the account was closed is_active: type: boolean title: Is Active description: Whether the account is currently active default: true interest_rate: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Interest Rate description: Annual interest rate as decimal (e.g., 18.99 for 18.99%) interest_type: anyOf: - type: string - type: 'null' title: Interest Type description: Type of interest (fixed, variable, promotional) term_months: anyOf: - type: integer - type: 'null' title: Term Months description: Loan term in months collateral_description: anyOf: - type: string - type: 'null' title: Collateral Description description: Description of collateral for secured loans collateral_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Collateral Value description: Value of collateral currency: type: string title: Currency description: Currency code default: USD metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex description: Additional account metadata institution: anyOf: - additionalProperties: true type: object - type: 'null' title: Institution display_name: type: string title: Display Name readOnly: true is_loan: type: boolean title: Is Loan readOnly: true is_credit_card: type: boolean title: Is Credit Card readOnly: true is_mortgage: type: boolean title: Is Mortgage readOnly: true account_status: type: string title: Account Status readOnly: true has_collateral: type: boolean title: Has Collateral readOnly: true formatted_original_amount: anyOf: - type: string - type: 'null' title: Formatted Original Amount readOnly: true formatted_interest_rate: anyOf: - type: string - type: 'null' title: Formatted Interest Rate readOnly: true term_years: anyOf: - type: number - type: 'null' title: Term Years readOnly: true days_to_maturity: anyOf: - type: integer - type: 'null' title: Days To Maturity readOnly: true type: object required: - id - dataset_id - institution_id - document_id - display_name - is_loan - is_credit_card - is_mortgage - account_status - has_collateral - formatted_original_amount - formatted_interest_rate - term_years - days_to_maturity title: LiabilityAccountResponse description: Response model for liability accounts TaskStatus: properties: start_time: type: string title: Start Time finish_time: anyOf: - type: string - type: 'null' title: Finish Time state: $ref: '#/components/schemas/JobState' default: Idle name: anyOf: - type: string - type: 'null' title: Name time_estimate_seconds: anyOf: - type: integer - type: 'null' title: Time Estimate Seconds progress: $ref: '#/components/schemas/ProgressModel' exceptions: items: $ref: '#/components/schemas/ExceptionEntry' type: array title: Exceptions warnings: items: type: string type: array title: Warnings status: items: $ref: '#/components/schemas/StatusEntry' type: array title: Status retry_count: type: integer title: Retry Count default: 0 type: object required: - start_time title: TaskStatus description: Status model for an individual task - matches ARQ format. UnifiedTransactionListResponse: properties: transactions: items: $ref: '#/components/schemas/UnifiedTransactionRow' type: array title: Transactions total: type: integer title: Total page: type: integer title: Page page_size: type: integer title: Page Size type: object required: - transactions - total - page - page_size title: UnifiedTransactionListResponse BusinessListResponse: properties: businesses: items: $ref: '#/components/schemas/BusinessWithCountsResponse' type: array title: Businesses total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true type: object required: - total - total_pages title: BusinessListResponse description: Paginated list response. LiabilityTransactionUpdate: properties: id: type: integer title: Id description: Transaction ID (from liability_transactions table) category: anyOf: - type: string - type: 'null' title: Category description: Expense category (e.g. Transportation) sub_category: anyOf: - type: string - type: 'null' title: Sub Category description: Expense sub-category (e.g. Gas) beneficiary: anyOf: - type: string - type: 'null' title: Beneficiary description: Beneficiary (e.g. CHILD, ADULT, or full name) merchant_name: anyOf: - type: string - type: 'null' title: Merchant Name description: Merchant or payee name notes: anyOf: - type: string - type: 'null' title: Notes description: Investigator notes is_disputed: anyOf: - type: boolean - type: 'null' title: Is Disputed description: Whether the transaction is disputed dispute_reason: anyOf: - type: string - type: 'null' title: Dispute Reason description: Reason for dispute if disputed type: object required: - id title: LiabilityTransactionUpdate description: Payload to update a single liability transaction. Only provided fields are updated. DocumentResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id filename: type: string title: Filename token_count: type: integer title: Token Count metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex HMAC: anyOf: - type: string - type: 'null' title: Hmac document_id: anyOf: - type: string - type: 'null' title: Document Id is_doc_hub: type: boolean title: Is Doc Hub default: false original_relative_path: anyOf: - type: string - type: 'null' title: Original Relative Path folder_path: anyOf: - type: string - type: 'null' title: Folder Path full_path: anyOf: - type: string - type: 'null' title: Full Path score: type: integer title: Score processed: type: boolean title: Processed type: object required: - id - dataset_id - filename - token_count - score - processed title: DocumentResponse description: The document modal response based on our SQLAlchemy model. StatusEntry: properties: timestamp: type: string title: Timestamp message: type: string title: Message developer: type: boolean title: Developer default: false type: object required: - timestamp - message title: StatusEntry description: Status message with timestamp - matches ARQ format. StatementOfFactsDraftStatusResponse: properties: status: type: string enum: - pending - ready - unavailable title: Status reason: anyOf: - type: string - type: 'null' title: Reason description: Set when status is unavailable (terminal), e.g. all hub docs failed processing. type: object required: - status title: StatementOfFactsDraftStatusResponse description: Lightweight readiness for the lightning SoF draft (no Gemini call). datamodels__discovery__facts__TimelineEventResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id known_date: anyOf: - type: string format: date - type: 'null' title: Known Date known_end_date: anyOf: - type: string format: date - type: 'null' title: Known End Date known_time: anyOf: - type: string format: time - type: 'null' title: Known Time date_precision: anyOf: - type: string - type: 'null' title: Date Precision fact: type: string title: Fact relevance: type: integer title: Relevance relevance_reason: type: string title: Relevance Reason filename: anyOf: - type: string - type: 'null' title: Filename full_path: anyOf: - type: string - type: 'null' title: Full Path attached_to: anyOf: - type: string - type: 'null' title: Attached To page: anyOf: - type: integer - type: 'null' title: Page attachment_id: anyOf: - type: integer - type: 'null' title: Attachment Id exhibit_label: anyOf: - type: string - type: 'null' title: Exhibit Label considered_important: type: boolean title: Considered Important default: false metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex attachment_doc_hub_doc_id: anyOf: - type: string format: uuid - type: 'null' title: Attachment Doc Hub Doc Id focus_area_scores: anyOf: - additionalProperties: true type: object - type: 'null' title: Focus Area Scores favorability: anyOf: - type: string - type: 'null' title: Favorability type: object required: - id - dataset_id - fact - relevance - relevance_reason title: TimelineEventResponse description: Single timeline event from the timeline_event table. LiabilityBalanceListResponse: properties: balances: items: $ref: '#/components/schemas/LiabilityBalanceResponse' type: array title: Balances total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_current_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Current Balance readOnly: true total_credit_limit: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Credit Limit readOnly: true total_minimum_payments: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Minimum Payments readOnly: true overdue_payments: type: integer title: Overdue Payments readOnly: true type: object required: - balances - total - total_pages - total_current_balance - total_credit_limit - total_minimum_payments - overdue_payments title: LiabilityBalanceListResponse description: List response for liability balances LiabilityBalanceResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id account_id: type: integer title: Account Id description: ID of the liability account document_id: type: integer title: Document Id description: ID of the source document balance_date: type: string format: date-time title: Balance Date description: Date of the balance snapshot current_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Current Balance description: Current outstanding balance (positive for debt) principal_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Principal Balance description: Principal balance for loans (excluding interest) credit_limit: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Credit Limit description: Credit limit for credit cards available_credit: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Available Credit description: Available credit (credit_limit - current_balance) minimum_payment_due: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Minimum Payment Due description: Minimum payment amount due payment_due_date: anyOf: - type: string format: date-time - type: 'null' title: Payment Due Date description: Due date for the minimum payment last_payment_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Last Payment Amount description: Amount of the last payment made last_payment_date: anyOf: - type: string format: date-time - type: 'null' title: Last Payment Date description: Date of the last payment interest_rate: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Interest Rate description: Annual interest rate as decimal (e.g., 18.99 for 18.99%) total_interest_paid: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Interest Paid description: Total interest paid during the period total_fees_paid: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Fees Paid description: Total fees paid during the period source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id description: Source node ID from document processing statement_period_start: anyOf: - type: string format: date-time - type: 'null' title: Statement Period Start description: Start date of the statement period statement_period_end: anyOf: - type: string format: date-time - type: 'null' title: Statement Period End description: End date of the statement period account: anyOf: - $ref: '#/components/schemas/LiabilityAccountResponse' - type: 'null' formatted_current_balance: type: string title: Formatted Current Balance readOnly: true formatted_credit_limit: anyOf: - type: string - type: 'null' title: Formatted Credit Limit readOnly: true formatted_available_credit: anyOf: - type: string - type: 'null' title: Formatted Available Credit readOnly: true formatted_minimum_payment: anyOf: - type: string - type: 'null' title: Formatted Minimum Payment readOnly: true credit_utilization_percent: anyOf: - type: number - type: 'null' title: Credit Utilization Percent readOnly: true principal_percent: anyOf: - type: number - type: 'null' title: Principal Percent readOnly: true days_until_due: anyOf: - type: integer - type: 'null' title: Days Until Due readOnly: true is_payment_overdue: type: boolean title: Is Payment Overdue readOnly: true statement_period_days: anyOf: - type: integer - type: 'null' title: Statement Period Days readOnly: true total_costs_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Costs Paid readOnly: true type: object required: - id - dataset_id - account_id - document_id - balance_date - current_balance - formatted_current_balance - formatted_credit_limit - formatted_available_credit - formatted_minimum_payment - credit_utilization_percent - principal_percent - days_until_due - is_payment_overdue - statement_period_days - total_costs_paid title: LiabilityBalanceResponse description: Response model for liability balances RunningInvestigationResponse: properties: dataset_id: type: integer title: Dataset Id description: Dataset ID has_running_investigation: type: boolean title: Has Running Investigation description: Whether any investigations are currently running running_workflows: items: $ref: '#/components/schemas/RunningWorkflowInfo' type: array title: Running Workflows description: List of running investigation workflows count: type: integer title: Count description: Number of running investigations type: object required: - dataset_id - has_running_investigation - running_workflows - count title: RunningInvestigationResponse description: Response when checking for running investigation workflows. BalanceSheetItemDetailResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id kind: type: string enum: - asset - liability title: Kind category: anyOf: - type: string enum: - bank_account - investment - retirement - real_property - vehicle - business_interest - life_insurance - crypto - other_asset - type: string enum: - mortgage - heloc - credit_card - personal_loan - vehicle_loan - student_loan - tax_liability - medical_debt - other_liability title: Category name: type: string title: Name institution_name: anyOf: - type: string - type: 'null' title: Institution Name account_last4: anyOf: - type: string - type: 'null' title: Account Last4 description: anyOf: - type: string - type: 'null' title: Description current_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Current Amount as_of_date: anyOf: - type: string format: date - type: 'null' title: As Of Date acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Amount owner: type: string enum: - petitioner - respondent - joint - unknown title: Owner marital_character: type: string enum: - marital - separate - mixed - unknown title: Marital Character source: type: string enum: - ai_inferred - human_entered title: Source source_tax_document_id: anyOf: - type: integer - type: 'null' title: Source Tax Document Id source_description: anyOf: - type: string - type: 'null' title: Source Description is_locked: type: boolean title: Is Locked normalized_dedup_key: anyOf: - type: string - type: 'null' title: Normalized Dedup Key secured_by_item_id: anyOf: - type: integer - type: 'null' title: Secured By Item Id rental_property_id: anyOf: - type: integer - type: 'null' title: Rental Property Id business_id: anyOf: - type: integer - type: 'null' title: Business Id financial_account_id: anyOf: - type: integer - type: 'null' title: Financial Account Id investment_account_id: anyOf: - type: integer - type: 'null' title: Investment Account Id liability_account_id: anyOf: - type: integer - type: 'null' title: Liability Account Id is_disputed: type: boolean title: Is Disputed dispute_notes: anyOf: - type: string - type: 'null' title: Dispute Notes is_active: type: boolean title: Is Active notes: anyOf: - type: string - type: 'null' title: Notes metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At secured_by_item: anyOf: - $ref: '#/components/schemas/BalanceSheetItemSummary' - type: 'null' securing_liabilities: items: $ref: '#/components/schemas/BalanceSheetItemSummary' type: array title: Securing Liabilities type: object required: - id - dataset_id - kind - category - name - owner - marital_character - source - is_locked - is_disputed - is_active - created_at - updated_at title: BalanceSheetItemDetailResponse description: "Single item with pairing eager-loaded for the detail page.\n\n- ``secured_by_item`` is set when this row is a liability secured by an\n asset (the mortgage row carries a reference to the house it's against).\n- ``securing_liabilities`` is the inverse list for assets (the house row\n carries the mortgage + HELOC that encumber it)." DatasetRequest: properties: name: type: string title: Name type: type: string title: Type context: type: string title: Context parent_id: anyOf: - type: integer - type: 'null' title: Parent Id case_background: anyOf: - type: string - type: 'null' title: Case Background case_anchors: anyOf: - additionalProperties: true type: object - type: 'null' title: Case Anchors case_considerations: anyOf: - type: string - type: 'null' title: Case Considerations preferred_format: anyOf: - type: string - type: 'null' title: Preferred Format expert_name: anyOf: - type: string - type: 'null' title: Expert Name type: object required: - name - type - context title: DatasetRequest TaxYearSummary: properties: tax_year: type: integer title: Tax Year document_count: type: integer title: Document Count default: 0 total_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Income default: '0.00' total_tax_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Withheld default: '0.00' total_tax_liability: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Liability default: '0.00' over_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Over Withheld default: '0.00' under_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Under Withheld default: '0.00' total_deductions: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Deductions default: '0.00' total_credits: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Credits default: '0.00' total_refunds: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Refunds default: '0.00' total_owed: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Owed default: '0.00' unique_taxpayers: type: integer title: Unique Taxpayers default: 0 unique_employers: type: integer title: Unique Employers default: 0 effective_tax_rate: type: number title: Effective Tax Rate readOnly: true net_tax_position: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Tax Position readOnly: true type: object required: - tax_year - effective_tax_rate - net_tax_position title: TaxYearSummary description: Summary statistics for a specific tax year BankingCategoryDailySpendingSummaryResponse: properties: dataset_id: type: integer title: Dataset Id account_type: type: string title: Account Type account_type_display_name: type: string title: Account Type Display Name account_count: type: integer title: Account Count date_range_start: type: string title: Date Range Start date_range_end: type: string title: Date Range End daily_spending: items: $ref: '#/components/schemas/DailyBankingDataPoint' type: array title: Daily Spending category_spending: items: $ref: '#/components/schemas/BankingCategorySpendingDataPoint' type: array title: Category Spending total_deposits: type: string title: Total Deposits total_withdrawals: type: string title: Total Withdrawals total_transactions: type: integer title: Total Transactions net_activity: type: string title: Net Activity average_daily_deposits: type: string title: Average Daily Deposits average_daily_withdrawals: type: string title: Average Daily Withdrawals peak_activity_day: type: string title: Peak Activity Day activity_trend: type: string title: Activity Trend average_per_account: type: string title: Average Per Account analysis_period_days: type: integer title: Analysis Period Days readOnly: true type: object required: - dataset_id - account_type - account_type_display_name - account_count - date_range_start - date_range_end - daily_spending - category_spending - total_deposits - total_withdrawals - total_transactions - net_activity - average_daily_deposits - average_daily_withdrawals - peak_activity_day - activity_trend - average_per_account - analysis_period_days title: BankingCategoryDailySpendingSummaryResponse description: Daily spending summary for a banking category (e.g., all checking accounts) FactsSummaryResponse: properties: facts_summary: type: string title: Facts Summary description: The facts summary in markdown format type: object required: - facts_summary title: FactsSummaryResponse description: Response model for facts summary operations. FinancialInstitutionListResponse: properties: institutions: items: $ref: '#/components/schemas/FinancialInstitutionResponse' type: array title: Institutions total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true type: object required: - institutions - total - total_pages title: FinancialInstitutionListResponse description: List response for financial institutions GroupSpendRow: properties: group: type: string title: Group description: Group name (organizational) categories: items: $ref: '#/components/schemas/CategorySpendRow' type: array title: Categories description: Categories under this group with spend and % category_count: type: integer title: Category Count description: Number of categories in this group with data annualized_spend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Annualized Spend description: Annualized spend across all categories in this group type: object required: - group - categories - category_count - annualized_spend title: GroupSpendRow description: One group (e.g. Living Expenses) with its categories and sub_category breakdown. LiabilityTransactionListResponse: properties: transactions: items: $ref: '#/components/schemas/LiabilityTransactionResponse' type: array title: Transactions total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_payments: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Payments readOnly: true total_charges: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Charges readOnly: true total_fees: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Fees readOnly: true total_interest_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Interest Paid readOnly: true total_principal_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Principal Paid readOnly: true disputed_transactions: type: integer title: Disputed Transactions readOnly: true transactions_with_late_fees: type: integer title: Transactions With Late Fees readOnly: true type: object required: - transactions - total - total_pages - total_payments - total_charges - total_fees - total_interest_paid - total_principal_paid - disputed_transactions - transactions_with_late_fees title: LiabilityTransactionListResponse description: List response for liability transactions StartInvestigationResponse: properties: workflow_id: type: string title: Workflow Id description: Workflow ID for tracking dataset_id: type: integer title: Dataset Id description: Dataset being investigated investigation_type: type: string title: Investigation Type description: Type of investigation message: type: string title: Message description: Status message type: object required: - workflow_id - dataset_id - investigation_type - message title: StartInvestigationResponse description: Response when starting an investigation workflow. ExceptionEntry: properties: timestamp: type: string title: Timestamp message: type: string title: Message traceback: anyOf: - type: string - type: 'null' title: Traceback type: object required: - timestamp - message title: ExceptionEntry description: Exception with timestamp - matches ARQ format. RelevanceDataResponse: properties: content: type: string title: Content type: object required: - content title: RelevanceDataResponse DependentListResponse: properties: dependents: items: $ref: '#/components/schemas/DependentResponse' type: array title: Dependents type: object required: - dependents title: DependentListResponse description: Response model for list of dependents DocumentDeleteRequest: properties: document_ids: additionalProperties: items: type: integer type: array type: object title: Document Ids description: Dictionary mapping dataset IDs to lists of document IDs to delete from that dataset examples: - '1': - 101 - 102 - 103 '2': - 201 - 202 type: object title: DocumentDeleteRequest description: 'Document Delete request, can delete one or more documents from multiple datasets. Format: {dataset_id: [document_id1, document_id2, ...], ...}' StatementOfFactsResponse: properties: statement_of_facts: type: string title: Statement Of Facts description: The generated statement of facts in markdown format type: object required: - statement_of_facts title: StatementOfFactsResponse description: Response model for statement of facts generation. BalanceSheetItemSummary: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id kind: type: string enum: - asset - liability title: Kind category: anyOf: - type: string enum: - bank_account - investment - retirement - real_property - vehicle - business_interest - life_insurance - crypto - other_asset - type: string enum: - mortgage - heloc - credit_card - personal_loan - vehicle_loan - student_loan - tax_liability - medical_debt - other_liability title: Category name: type: string title: Name current_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Current Amount owner: type: string enum: - petitioner - respondent - joint - unknown title: Owner is_locked: type: boolean title: Is Locked is_active: type: boolean title: Is Active type: object required: - id - dataset_id - kind - category - name - owner - is_locked - is_active title: BalanceSheetItemSummary description: 'Minimal balance-sheet item shape used for nested ``secured_by_item`` / ``securing_liabilities`` references on the detail response. Avoids unbounded recursion (a detail response embedding full detail of its paired items would be redundant and confusing).' DepositSlipResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id document_id: type: integer title: Document Id account_id: anyOf: - type: integer - type: 'null' title: Account Id account_number: anyOf: - type: string - type: 'null' title: Account Number deposit_date: anyOf: - type: string format: date-time - type: 'null' title: Deposit Date total_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Amount cash_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Cash Amount matched_transaction_id: anyOf: - type: integer - type: 'null' title: Matched Transaction Id source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id items: items: $ref: '#/components/schemas/DepositItemResponse' type: array title: Items account: anyOf: - $ref: '#/components/schemas/FinancialAccountResponse' - type: 'null' matched_transaction: anyOf: - $ref: '#/components/schemas/TransactionResponse' - type: 'null' has_matched_transaction: type: boolean title: Has Matched Transaction readOnly: true item_count: type: integer title: Item Count readOnly: true type: object required: - id - dataset_id - document_id - has_matched_transaction - item_count title: DepositSlipResponse description: Response model for a deposit slip / deposit ticket. DepositItemResponse: properties: id: type: integer title: Id item_type: anyOf: - type: string - type: 'null' title: Item Type amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Amount payer_name: anyOf: - type: string - type: 'null' title: Payer Name check_number: anyOf: - type: string - type: 'null' title: Check Number type: object required: - id title: DepositItemResponse description: Response model for one line on a deposit slip (a deposited check or cash). AccountValueResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id account_id: type: integer title: Account Id document_id: type: integer title: Document Id value_date: type: string format: date-time title: Value Date beginning_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Beginning Value ending_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Ending Value cash_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Cash Balance pending_trades: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Pending Trades total_contributions: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Contributions total_withdrawals: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Withdrawals total_fees: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Fees unrealized_gains_losses: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Unrealized Gains Losses realized_gains_losses: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Realized Gains Losses dividend_income: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Dividend Income interest_income: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Interest Income source_node_id: anyOf: - type: string - type: 'null' title: Source Node Id statement_period_start: anyOf: - type: string format: date-time - type: 'null' title: Statement Period Start statement_period_end: anyOf: - type: string format: date-time - type: 'null' title: Statement Period End account: anyOf: - $ref: '#/components/schemas/InvestmentAccountResponse' - type: 'null' net_change: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Net Change readOnly: true period_return_percent: anyOf: - type: number - type: 'null' title: Period Return Percent readOnly: true total_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Income readOnly: true net_cash_flow: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Cash Flow readOnly: true formatted_ending_value: anyOf: - type: string - type: 'null' title: Formatted Ending Value readOnly: true period_length_days: anyOf: - type: integer - type: 'null' title: Period Length Days readOnly: true type: object required: - id - dataset_id - account_id - document_id - value_date - net_change - period_return_percent - total_income - net_cash_flow - formatted_ending_value - period_length_days title: AccountValueResponse description: Response model for account values RealPropertyOwnerResponse: properties: id: type: integer title: Id real_property_id: type: integer title: Real Property Id taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id owner_name: type: string title: Owner Name role: anyOf: - type: string enum: - borrower - co_borrower - primary_filer - spouse - deed_holder - trust - corporate - other - type: 'null' title: Role ownership_percentage: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Ownership Percentage source_description: anyOf: - type: string - type: 'null' title: Source Description type: object required: - id - real_property_id - owner_name title: RealPropertyOwnerResponse description: 'One owner on a real property. Multiple owners per property are expected — joint mortgages, joint 1040 filings, co-tenants on a deed. ``taxpayer_id`` is null when the 1098 names a borrower we couldn''t tie to a ``taxpayers`` row (an unmarried partner, an unrepresented trust). ``owner_name`` is always populated so the UI label survives any detach.' LiabilityDailySpendingSummaryResponse: properties: account_id: type: integer title: Account Id dataset_id: type: integer title: Dataset Id account_name: anyOf: - type: string - type: 'null' title: Account Name liability_type: anyOf: - type: string - type: 'null' title: Liability Type date_range_start: type: string format: date-time title: Date Range Start date_range_end: type: string format: date-time title: Date Range End daily_spending: items: $ref: '#/components/schemas/DailySpendingDataPoint' type: array title: Daily Spending default: [] category_spending: items: $ref: '#/components/schemas/CategorySpendingDataPoint' type: array title: Category Spending default: [] total_charges: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Charges default: '0.00' total_payments: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Payments default: '0.00' total_transactions: type: integer title: Total Transactions default: 0 disputed_transactions: type: integer title: Disputed Transactions default: 0 net_activity: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Activity description: Net spending (charges - payments) readOnly: true average_daily_charges: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Daily Charges description: Average charges per day readOnly: true peak_spending_day: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Peak Spending Day description: Highest single-day spending amount readOnly: true spending_trend: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Spending Trend description: 'Trend: compare first week vs last week average' readOnly: true type: object required: - account_id - dataset_id - date_range_start - date_range_end - net_activity - average_daily_charges - peak_spending_day - spending_trend title: LiabilityDailySpendingSummaryResponse description: Daily spending summary for a single liability account BankCheckListResponse: properties: checks: items: $ref: '#/components/schemas/BankCheckResponse' type: array title: Checks total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true cleared_count: type: integer title: Cleared Count readOnly: true matched_count: type: integer title: Matched Count readOnly: true type: object required: - checks - total - total_pages - cleared_count - matched_count title: BankCheckListResponse description: Paginated list of check images. TaxDocumentResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id document_id: type: integer title: Document Id document_type: type: string title: Document Type tax_year: anyOf: - type: integer - type: 'null' title: Tax Year extraction_confidence: anyOf: - type: number - type: 'null' title: Extraction Confidence processing_notes: anyOf: - type: string - type: 'null' title: Processing Notes form_data: anyOf: - additionalProperties: true type: object - type: 'null' title: Form Data validation_findings: anyOf: - items: additionalProperties: true type: object type: array - type: 'null' title: Validation Findings total_income: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Income adjusted_gross_income: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Adjusted Gross Income taxable_income: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Taxable Income total_tax_liability: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Tax Liability total_payments: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Payments refund_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Refund Amount amount_owed: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Amount Owed total_deductions: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Deductions total_credits: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Credits statement_date: anyOf: - type: string format: date-time - type: 'null' title: Statement Date statement_period_start: anyOf: - type: string format: date-time - type: 'null' title: Statement Period Start statement_period_end: anyOf: - type: string format: date-time - type: 'null' title: Statement Period End created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At taxpayers: items: $ref: '#/components/schemas/datamodels__discovery__forensic__income__TaxPayerResponse' type: array title: Taxpayers default: [] employers: items: $ref: '#/components/schemas/EmployerResponse' type: array title: Employers default: [] income_records: items: $ref: '#/components/schemas/IncomeRecordResponse' type: array title: Income Records default: [] deductions: items: $ref: '#/components/schemas/TaxDeductionResponse' type: array title: Deductions default: [] credits: items: $ref: '#/components/schemas/TaxCreditResponse' type: array title: Credits default: [] primary_taxpayer_name: anyOf: - type: string - type: 'null' title: Primary Taxpayer Name business_id: anyOf: - type: integer - type: 'null' title: Business Id business: anyOf: - $ref: '#/components/schemas/BusinessResponse' - type: 'null' display_type: type: string title: Display Type readOnly: true is_tax_return: type: boolean title: Is Tax Return readOnly: true is_income_statement: type: boolean title: Is Income Statement readOnly: true is_income_source: type: boolean title: Is Income Source description: 'Document directly produces IncomeRecord rows (evidence of income). Includes W-2/1099/pay stub plus the schedules whose source docs we treat as income evidence: Schedule C (self-employment), Schedule E Part I (direct rentals/royalties), and Schedule K-1 (pass-through). Excludes tax returns (1040, 1120, 1120-S, 1065) and validation-only schedules (Schedule 1/2/3/B/SE/8812). Used by the UI to populate the Income Documents tab.' readOnly: true total_gross_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Gross Income readOnly: true total_tax_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Withheld readOnly: true net_tax_position: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Net Tax Position description: Calculate net tax position (refund positive, owed negative) readOnly: true statement_period_days: anyOf: - type: integer - type: 'null' title: Statement Period Days readOnly: true type: object required: - id - dataset_id - document_id - document_type - created_at - updated_at - display_type - is_tax_return - is_income_statement - is_income_source - total_gross_income - total_tax_withheld - net_tax_position - statement_period_days title: TaxDocumentResponse description: Response model for tax documents TaxonomyGroupRow: properties: group: type: string title: Group categories: items: $ref: '#/components/schemas/TaxonomyCategoryRow' type: array title: Categories category_count: type: integer title: Category Count type: object required: - group - categories - category_count title: TaxonomyGroupRow description: Group with its categories and sub_category examples (structure only). TaxDeductionListResponse: properties: deductions: items: $ref: '#/components/schemas/TaxDeductionResponse' type: array title: Deductions total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_deduction_amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Deduction Amount readOnly: true type: object required: - deductions - total - total_pages - total_deduction_amount title: TaxDeductionListResponse description: List response for tax deductions IncomeTypeSummary: properties: income_type: type: string title: Income Type record_count: type: integer title: Record Count default: 0 total_gross: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Gross default: '0.00' total_net: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Net default: '0.00' total_tax_withheld: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Tax Withheld default: '0.00' average_gross: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Average Gross default: '0.00' unique_payers: type: integer title: Unique Payers default: 0 total_income: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Income description: Total income for this type - always uses gross for family law (more objective) readOnly: true effective_tax_rate: type: number title: Effective Tax Rate readOnly: true type: object required: - income_type - total_income - effective_tax_rate title: IncomeTypeSummary description: Summary statistics for a specific income type BulkUpdateTransactionsRequest: properties: banking: items: $ref: '#/components/schemas/BankingTransactionUpdate' type: array title: Banking description: Banking transactions to update (from financial_accounts / transactions table) liabilities: items: $ref: '#/components/schemas/LiabilityTransactionUpdate' type: array title: Liabilities description: Liability transactions to update (from liability_accounts / liability_transactions table) type: object title: BulkUpdateTransactionsRequest description: 'Request body: two lists, one for banking and one for liabilities. Each list can be empty.' RelevanceDetailResponse: properties: id: type: integer title: Id score: type: integer title: Score tags: items: type: string type: array title: Tags page: type: integer title: Page content_type: type: string title: Content Type summary: type: string title: Summary segment_score: anyOf: - type: number - type: 'null' title: Segment Score priority_score: anyOf: - type: number - type: 'null' title: Priority Score smoking_gun_type: anyOf: - type: string - type: 'null' title: Smoking Gun Type sg_force: anyOf: - type: number - type: 'null' title: Sg Force sg_thread: anyOf: - type: string - type: 'null' title: Sg Thread type: object required: - id - score - tags - page - content_type - summary title: RelevanceDetailResponse description: The relevance record related to a requested document_id ContractFilters: properties: amendment: anyOf: - type: boolean - type: 'null' title: Amendment parties_involved: items: type: string type: array title: Parties Involved effective_date: anyOf: - type: string format: date - type: 'null' title: Effective Date expiration_date: anyOf: - type: string format: date - type: 'null' title: Expiration Date reconciled: anyOf: - type: boolean - type: 'null' title: Reconciled type: object title: ContractFilters description: Filter allow the user to tell us what fields in the database they care about at the time BusinessValuationEstimate: properties: estimated_value: type: number title: Estimated Value low: anyOf: - type: number - type: 'null' title: Low high: anyOf: - type: number - type: 'null' title: High method_weights: $ref: '#/components/schemas/ValuationMethodWeights' reasoning: type: string title: Reasoning type: object required: - estimated_value - low - high - method_weights - reasoning title: BusinessValuationEstimate description: 'LLM valuation output stored on the inputs row. Every field is required (nullable where the model may decline) — OpenAI strict structured output demands all properties appear in ``required``, and free-form dicts are rejected, hence the fixed-key weights model. Amounts are ``float``, not ``Decimal``, and must stay that way. Pydantic renders ``Decimal`` as an ``anyOf`` carrying a regex with a negative lookahead, which is outside the schema subset strict structured output accepts. The request is then rejected before the model runs, and the API reports it as ``status=incomplete incomplete_reason=max_output_tokens`` with zero tokens used — which reads like a token-limit problem and is not one. Nothing is lost: the JSON on the wire is IEEE-754 either way. Convert to ``Decimal`` at the point of persistence instead.' DatasetImportRequest: properties: expert_name: anyOf: - type: string - type: 'null' title: Expert Name preferred_format: anyOf: - type: string - type: 'null' title: Preferred Format case_anchors: anyOf: - additionalProperties: true type: object - type: 'null' title: Case Anchors use_doc_hub: anyOf: - type: boolean - type: 'null' title: Use Doc Hub type: object title: DatasetImportRequest DatasetScoringCriteriaRequest: properties: revenue: items: $ref: '#/components/schemas/DatasetScoringCriteria' type: array title: Revenue non_revenue: items: $ref: '#/components/schemas/DatasetScoringCriteria' type: array title: Non Revenue type: object required: - revenue - non_revenue title: DatasetScoringCriteriaRequest description: This represents the users request to have criteria set on all their revenue/non-revenue contract categories. DatasetListPaginatedResponse: properties: datasets: items: $ref: '#/components/schemas/DatasetListResponse' type: array title: Datasets pagination: $ref: '#/components/schemas/PaginationMetadata' type: object required: - datasets - pagination title: DatasetListPaginatedResponse description: Paginated response for dataset list. FinancialAccountResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id institution_id: type: integer title: Institution Id document_id: type: integer title: Document Id account_number_masked: anyOf: - type: string - type: 'null' title: Account Number Masked account_type: anyOf: - type: string - type: 'null' title: Account Type account_name: anyOf: - type: string - type: 'null' title: Account Name primary_holder_name: anyOf: - type: string - type: 'null' title: Primary Holder Name joint_holders: anyOf: - items: type: string type: array - type: 'null' title: Joint Holders holder_kind: anyOf: - type: string - type: 'null' title: Holder Kind business_id: anyOf: - type: integer - type: 'null' title: Business Id opened_date: anyOf: - type: string format: date-time - type: 'null' title: Opened Date closed_date: anyOf: - type: string format: date-time - type: 'null' title: Closed Date is_active: type: boolean title: Is Active default: true credit_limit: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Credit Limit interest_rate: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Interest Rate currency: type: string title: Currency default: USD institution: anyOf: - $ref: '#/components/schemas/FinancialInstitutionResponse' - type: 'null' display_name: type: string title: Display Name readOnly: true is_credit_account: type: boolean title: Is Credit Account readOnly: true account_status: type: string title: Account Status readOnly: true type: object required: - id - dataset_id - institution_id - document_id - display_name - is_credit_account - account_status title: FinancialAccountResponse description: Response model for financial accounts ExpenseTaxonomyResponse: properties: groups: items: $ref: '#/components/schemas/TaxonomyGroupRow' type: array title: Groups description: Top-level groups with categories and example sub-categories (for UI/organization) type: object required: - groups title: ExpenseTaxonomyResponse description: 'Expense taxonomy structure: groups → categories → sub_category examples. No DB data.' DatasetUpdateSoFSummaryRequest: properties: sof_summary: type: string title: Sof Summary type: object required: - sof_summary title: DatasetUpdateSoFSummaryRequest description: Update the statement of facts for this dataset. LinkedDatasetInfo: properties: id: type: integer title: Id name: type: string title: Name dataset_type: $ref: '#/components/schemas/DatasetType' document_source: anyOf: - $ref: '#/components/schemas/DatasetDocumentSource' - type: 'null' type: object required: - id - name - dataset_type title: LinkedDatasetInfo description: Basic information about a linked dataset InvestigationListResponse: properties: investigations: items: $ref: '#/components/schemas/InvestigationListItemResponse' type: array title: Investigations total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages description: Calculate total number of pages. readOnly: true type: object required: - investigations - total - total_pages title: InvestigationListResponse description: List response for investigations. ReasoningEffort: type: string enum: - minimal - medium - high title: ReasoningEffort description: Reasoning effort levels for LLM investigations. PriorSeparationPeriod: properties: start_date: type: string title: Start Date description: Start date in MM/DD/YYYY format end_date: type: string title: End Date description: End date in MM/DD/YYYY format type: object required: - start_date - end_date title: PriorSeparationPeriod description: Date range for a prior separation period. Dates stored as MM/DD/YYYY strings. BalanceSheetItemUpdateRequest: properties: category: anyOf: - type: string enum: - bank_account - investment - retirement - real_property - vehicle - business_interest - life_insurance - crypto - other_asset - type: string enum: - mortgage - heloc - credit_card - personal_loan - vehicle_loan - student_loan - tax_liability - medical_debt - other_liability - type: 'null' title: Category name: anyOf: - type: string maxLength: 255 minLength: 1 - type: 'null' title: Name institution_name: anyOf: - type: string maxLength: 255 - type: 'null' title: Institution Name account_last4: anyOf: - type: string maxLength: 8 - type: 'null' title: Account Last4 description: anyOf: - type: string - type: 'null' title: Description current_amount: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Current Amount as_of_date: anyOf: - type: string format: date - type: 'null' title: As Of Date acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_amount: anyOf: - type: number - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Amount owner: anyOf: - type: string enum: - petitioner - respondent - joint - unknown - type: 'null' title: Owner marital_character: anyOf: - type: string enum: - marital - separate - mixed - unknown - type: 'null' title: Marital Character secured_by_item_id: anyOf: - type: integer - type: 'null' title: Secured By Item Id is_disputed: anyOf: - type: boolean - type: 'null' title: Is Disputed dispute_notes: anyOf: - type: string - type: 'null' title: Dispute Notes notes: anyOf: - type: string - type: 'null' title: Notes metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex additionalProperties: false type: object title: BalanceSheetItemUpdateRequest description: 'Body for ``PATCH /balance-sheet/items/{item_id}`` — partial update. ``kind`` and ``dataset_id`` are deliberately not present: a row''s asset-vs-liability nature is fixed at creation (changing it would silently flip the sign on net-worth math). ``source``, ``is_locked``, and ``is_active`` are also not present — the server sets ``is_locked=True`` on every successful PATCH; the lock cannot be cleared via this endpoint, and active state is managed by DELETE. ``category`` is allowed to change for misclassification fixes (e.g. an AI-tagged ``investment`` that''s actually a ``retirement`` 401(k)).' FlaggedTransactionDetailResponse: properties: transaction_id: type: integer title: Transaction Id description: Transaction ID table_name: type: string title: Table Name description: 'Source table: transactions, liability_transactions, or investment_transactions' flag_reason: anyOf: - type: string - type: 'null' title: Flag Reason description: Why this transaction was flagged pattern_type: anyOf: - type: string - type: 'null' title: Pattern Type description: 'Pattern category: gambling, gifts, hotels, cash, dining, etc.' transaction_date: anyOf: - type: string format: date-time - type: 'null' title: Transaction Date amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Amount merchant_name: anyOf: - type: string - type: 'null' title: Merchant Name description: anyOf: - type: string - type: 'null' title: Description account_id: anyOf: - type: integer - type: 'null' title: Account Id masked_account_number: anyOf: - type: string - type: 'null' title: Masked Account Number description: Masked account number (e.g., ****1234) posted_date: anyOf: - type: string format: date-time - type: 'null' title: Posted Date running_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Running Balance description_raw: anyOf: - type: string - type: 'null' title: Description Raw description_cleaned: anyOf: - type: string - type: 'null' title: Description Cleaned category: anyOf: - type: string - type: 'null' title: Category transaction_type: anyOf: - type: string - type: 'null' title: Transaction Type location: anyOf: - type: string - type: 'null' title: Location payment_date: anyOf: - type: string format: date-time - type: 'null' title: Payment Date payment_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Payment Amount payment_type: anyOf: - type: string - type: 'null' title: Payment Type settlement_date: anyOf: - type: string format: date-time - type: 'null' title: Settlement Date symbol: anyOf: - type: string - type: 'null' title: Symbol security_name: anyOf: - type: string - type: 'null' title: Security Name type: object required: - transaction_id - table_name title: FlaggedTransactionDetailResponse description: Response model for a flagged transaction with full details. InvestigationResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id investigation_type: type: string title: Investigation Type reasoning_effort: anyOf: - type: string - type: 'null' title: Reasoning Effort account_filtered: type: boolean title: Account Filtered default: false summary: type: string title: Summary evidence_strength: type: string title: Evidence Strength total_flagged: type: integer title: Total Flagged total_suspicious_spending: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Total Suspicious Spending key_findings: anyOf: - items: type: string type: array - type: 'null' title: Key Findings recommendations: anyOf: - items: type: string type: array - type: 'null' title: Recommendations timeline: anyOf: - items: $ref: '#/components/schemas/datamodels__discovery__forensic__investigation__TimelineEventResponse' type: array - type: 'null' title: Timeline processing_time_seconds: anyOf: - type: number - type: 'null' title: Processing Time Seconds token_usage: anyOf: - additionalProperties: additionalProperties: anyOf: - type: integer - type: string type: object type: object - type: 'null' title: Token Usage error_message: anyOf: - type: string - type: 'null' title: Error Message metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex description: Additional metadata including report_path for PDF reports pattern_findings: anyOf: - additionalProperties: true type: object - type: 'null' title: Pattern Findings description: Pattern analysis findings from Phase 2 (behavioral shifts, recurring patterns, temporal clusters) created_at: type: string format: date-time title: Created At formatted_total_suspicious_spending: anyOf: - type: string - type: 'null' title: Formatted Total Suspicious Spending description: Format total suspicious spending as currency. readOnly: true type: object required: - id - dataset_id - investigation_type - summary - evidence_strength - total_flagged - created_at - formatted_total_suspicious_spending title: InvestigationResponse description: Response model for an investigation record. ContractSummaryResponse: properties: revenue: additionalProperties: items: $ref: '#/components/schemas/ContractCount' type: array type: object title: Revenue description: Dictionary of all the revenue summary information non_revenue: additionalProperties: items: $ref: '#/components/schemas/ContractCount' type: array type: object title: Non Revenue description: Dictionary of all the non-revenue summary information type: object title: ContractSummaryResponse description: The contract summary response contains all contract types and the total amount of contracts of that type. RentalPropertyDetailResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id business_id: anyOf: - type: integer - type: 'null' title: Business Id business: anyOf: - $ref: '#/components/schemas/BusinessResponse' - type: 'null' taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id taxpayer: anyOf: - $ref: '#/components/schemas/datamodels__discovery__forensic__income__TaxPayerResponse' - type: 'null' description: anyOf: - type: string - type: 'null' title: Description address_full: anyOf: - type: string - type: 'null' title: Address Full street_number: anyOf: - type: integer - type: 'null' title: Street Number street_name: anyOf: - type: string - type: 'null' title: Street Name city: anyOf: - type: string - type: 'null' title: City state: anyOf: - type: string - type: 'null' title: State zip: anyOf: - type: string - type: 'null' title: Zip normalized_address_key: anyOf: - type: string - type: 'null' title: Normalized Address Key property_type_code: anyOf: - type: integer - type: 'null' title: Property Type Code property_type_description: anyOf: - type: string - type: 'null' title: Property Type Description acquired_date: anyOf: - type: string format: date - type: 'null' title: Acquired Date purchase_price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Purchase Price sold_date: anyOf: - type: string format: date - type: 'null' title: Sold Date sale_proceeds: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Sale Proceeds mortgage_holder: anyOf: - type: string - type: 'null' title: Mortgage Holder mortgage_balance: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Mortgage Balance estimated_value: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Estimated Value estimated_value_as_of: anyOf: - type: string format: date - type: 'null' title: Estimated Value As Of estimated_value_source: anyOf: - type: string - type: 'null' title: Estimated Value Source metadata_ex: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata Ex created_at: type: string format: date-time title: Created At updated_at: type: string format: date-time title: Updated At year_data: items: $ref: '#/components/schemas/RentalPropertyYearDataResponse' type: array title: Year Data default: [] source_documents: items: $ref: '#/components/schemas/TaxDocumentResponse' type: array title: Source Documents default: [] ownership_type: type: string enum: - individual - entity - both - unknown title: Ownership Type description: 'Single-field summary of who/what owns this property. UI sentinel: render an "Individual" badge in green (direct marital asset), "Entity" in blue (held inside an S-Corp / partnership / LLC), "Both" in amber (manual review), or "Unknown" in grey (pending other docs).' readOnly: true entity_owner_type: anyOf: - type: string - type: 'null' title: Entity Owner Type description: 'When entity-owned, the business''s tax classification (``s_corp`` / ``partnership`` / ``c_corp`` / ``disregarded_entity`` / ``sole_proprietorship``) so the UI can disambiguate pass-through from C-Corp without a second lookup. Null when ownership_type is not ``entity`` / ``both``.' readOnly: true type: object required: - id - dataset_id - created_at - updated_at - ownership_type - entity_owner_type title: RentalPropertyDetailResponse description: 'Single property with all per-year financial snapshots and source documents. ``year_data`` is ordered tax_year-desc so the most-recent year is first. ``source_documents`` is the de-duplicated set of tax_documents that contributed any year_data row for this property — typically a Form 8825, later joined by Schedule E rows / 1098 mortgage statements / 1099-S sale rows / deed scans as those land.' datamodels__discovery__forensic__income__TaxPayerResponse: properties: id: type: integer title: Id dataset_id: type: integer title: Dataset Id tax_document_id: anyOf: - type: integer - type: 'null' title: Tax Document Id primary_name: type: string title: Primary Name default: '' primary_ssn_status: anyOf: - type: string - type: 'null' title: Primary Ssn Status spouse_name: anyOf: - type: string - type: 'null' title: Spouse Name spouse_ssn_status: anyOf: - type: string - type: 'null' title: Spouse Ssn Status address: anyOf: - type: string - type: 'null' title: Address phone: anyOf: - type: string - type: 'null' title: Phone filing_status: anyOf: - type: string - type: 'null' title: Filing Status exemptions: anyOf: - type: integer - type: 'null' title: Exemptions dependents: anyOf: - items: type: string type: array - type: 'null' title: Dependents display_name: type: string title: Display Name readOnly: true is_joint_filing: type: boolean title: Is Joint Filing readOnly: true has_dependents: type: boolean title: Has Dependents readOnly: true dependent_count: type: integer title: Dependent Count readOnly: true type: object required: - id - dataset_id - display_name - is_joint_filing - has_dependents - dependent_count title: TaxPayerResponse description: 'Response model for taxpayers. Tolerates missing/invalid production data: primary_name and spouse_name are coerced from None to empty string so /discovery/forensic/.../income/documents does not 500 when DB has legacy or malformed rows.' ContractDetails: properties: id: type: integer title: Id description: Unique identifier for the contract. revenue: type: boolean title: Revenue description: Indicates if the contract is revenue-generating. amendment: type: boolean title: Amendment description: Indicates if this contract is an amendment. contract_type: type: string title: Contract Type description: Type of the contract. category_name: anyOf: - type: string - type: 'null' title: Category Name description: Name of the contract category, default is unknown. default: '?' effective_date: anyOf: - type: string format: date - type: 'null' title: Effective Date description: The effective start date of the contract. expiration_date: anyOf: - type: string format: date - type: 'null' title: Expiration Date description: The expiration date of the contract. parties_involved: items: type: string type: array title: Parties Involved description: List of parties involved in the contract. our_parties: items: type: string type: array title: Our Parties description: The party the user has selected that represents them counterparties: items: type: string type: array title: Counterparties description: The contract counterparti(ies). revenue_party: anyOf: - type: string - type: 'null' title: Revenue Party description: Name of the party responsible for revenue. principle: type: boolean title: Principle description: Indicates if this is a master contract to which others are derived or amended, scheduled, etc. default: false non_final_agreement_category: anyOf: - type: string - type: 'null' title: Non Final Agreement Category description: Defines the type of non-final (e.g., Amendment, LOI, Schedule, etc.). industry: type: string title: Industry description: The industry associated with this contract. default: Other sub_industry: anyOf: - type: string - type: 'null' title: Sub Industry description: The sub-industry associated with this contract. terms: items: type: string type: array title: Terms description: List of terms associated with the contract. grade: anyOf: - type: string - type: 'null' title: Grade description: The grade assigned to this contract. criteria_scores: additionalProperties: type: string type: object title: Criteria Scores description: A dictionary of score details, can be empty. mdata: items: additionalProperties: true type: object type: array title: Mdata description: List of metadata related to the contract. filename: anyOf: - type: string - type: 'null' title: Filename description: Filename associated with the contract document. token_count: type: integer title: Token Count description: The total token count for this contract. default: 0 supplements: items: type: string type: array title: Supplements description: List of supplemental contracts associated with a master contract. type: object required: - id - revenue - amendment - contract_type title: ContractDetails description: 'The contract details, extracted from our database, that we wish to send to the API. This may not include all database fields, only the ones we need that we believe the API / UI can use to get their job done.' Body_dataset_file_attach_discovery_dataset__dataset_id__file_attachments_post: properties: file: type: string contentMediaType: application/octet-stream title: File filename: type: string title: Filename type: object required: - file - filename title: Body_dataset_file_attach_discovery_dataset__dataset_id__file_attachments_post UnifiedTransactionRow: properties: id: type: integer title: Id account_id: type: integer title: Account Id account_label: anyOf: - type: string - type: 'null' title: Account Label source: anyOf: - type: string - type: 'null' title: Source date: anyOf: - type: string format: date-time - type: 'null' title: Date type: anyOf: - type: string - type: 'null' title: Type description: anyOf: - type: string - type: 'null' title: Description merchant: anyOf: - type: string - type: 'null' title: Merchant category: anyOf: - type: string - type: 'null' title: Category sub_category: anyOf: - type: string - type: 'null' title: Sub Category beneficiary: anyOf: - type: string - type: 'null' title: Beneficiary symbol: anyOf: - type: string - type: 'null' title: Symbol quantity: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Quantity price: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Price fees: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Fees amount: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Amount has_check_image: type: boolean title: Has Check Image default: false matched_check_id: anyOf: - type: integer - type: 'null' title: Matched Check Id matched_deposit_slip_id: anyOf: - type: integer - type: 'null' title: Matched Deposit Slip Id type: object required: - id - account_id - amount title: UnifiedTransactionRow description: 'One transaction row in the domain-agnostic listing shape. Domain-specific fields are null where they don''t apply (e.g. category on investments).' MatterFileSuggestionDoc: properties: id: type: string title: Id name: type: string title: Name date_added: anyOf: - type: string format: date-time - type: 'null' title: Date Added size: anyOf: - type: integer - type: 'null' title: Size kind: anyOf: - type: string - type: 'null' title: Kind category: anyOf: - type: string - type: 'null' title: Category is_relevant: anyOf: - type: boolean - type: 'null' title: Is Relevant description: LLM relevance verdict for this matter document w.r.t. the task. True = recommended preselect; False = scored but not relevant; None = relevance was not computed (gate off, no candidates, LLM timeout/error). FE preselects only is_relevant=True. type: object required: - id - name title: MatterFileSuggestionDoc description: One candidate matter-level document surfaced in the suggestion modal. DatasetExportEntry: properties: doc_hub_doc_id: anyOf: - type: string - type: 'null' title: Doc Hub Doc Id description: DocMetadata id when the export is registered in DocHub; None for legacy pre-DocHub exports that exist only as a blob. filename: type: string title: Filename description: Display name (no dataset-id prefix). export_type: anyOf: - type: string - type: 'null' title: Export Type description: Discriminator from DocMetadata.additional_info — e.g. 'master_transaction_export'. None for legacy blobs that have no DocHub metadata. created_at: anyOf: - type: string format: date-time - type: 'null' title: Created At description: DocMetadata.upload_datetime, or blob.last_modified for legacy. download_url: type: string title: Download Url description: Absolute path on this API host that streams the file. The backend chooses ?doc_hub_doc_id=... (new) or ?filename=... (legacy) — clients hit this URL verbatim. type: object required: - filename - download_url title: DatasetExportEntry description: 'One discoverable export file for a dataset. Returned by ``GET /discovery/dataset/{id}/exports`` for both the new DocHub-tagged exports (``doc_hub_doc_id`` populated) AND the pre-DocHub legacy blobs (``doc_hub_doc_id`` is ``None``). ``download_url`` is pre-built by the backend with the correct query parameter for each variant, so the FE doesn''t have to branch on which one to use.' datamodels__discovery__forensic__liabilities__AccountSummary: properties: account_id: type: integer title: Account Id account_name: anyOf: - type: string - type: 'null' title: Account Name liability_type: anyOf: - type: string - type: 'null' title: Liability Type account_number_masked: anyOf: - type: string - type: 'null' title: Account Number Masked current_balance: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Current Balance default: '0.00' credit_limit: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Credit Limit minimum_payment_due: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Minimum Payment Due total_payments: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Payments default: '0.00' total_charges: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Charges default: '0.00' total_interest_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Interest Paid default: '0.00' total_fees_paid: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Fees Paid default: '0.00' transactions_count: type: integer title: Transactions Count default: 0 last_payment_date: anyOf: - type: string format: date-time - type: 'null' title: Last Payment Date last_payment_amount: anyOf: - type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ - type: 'null' title: Last Payment Amount net_activity: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Activity description: Net of charges minus payments readOnly: true total_costs: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Costs description: Total interest and fees paid readOnly: true credit_utilization_percent: anyOf: - type: number - type: 'null' title: Credit Utilization Percent readOnly: true type: object required: - account_id - net_activity - total_costs - credit_utilization_percent title: AccountSummary description: Summary statistics for a liability account MerchantListResponse: properties: merchants: items: $ref: '#/components/schemas/MerchantResponse' type: array title: Merchants total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true total_spending: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Spending readOnly: true unique_merchant_types: items: type: string type: array title: Unique Merchant Types readOnly: true type: object required: - merchants - total - total_pages - total_spending - unique_merchant_types title: MerchantListResponse description: List response for merchants BalanceSheetSummaryResponse: properties: dataset_id: type: integer title: Dataset Id total_assets: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Assets default: '0' total_liabilities: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Total Liabilities default: '0' pending_secured_debt: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Pending Secured Debt default: '0' pending_valuation_count: type: integer title: Pending Valuation Count default: 0 by_asset_category: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: By Asset Category by_liability_category: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: By Liability Category by_owner: additionalProperties: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ type: object title: By Owner item_count: type: integer title: Item Count default: 0 net_worth: type: string pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ title: Net Worth readOnly: true type: object required: - dataset_id - net_worth title: BalanceSheetSummaryResponse description: 'Roll-up totals for the dataset''s balance sheet. Liability totals are stored and returned as **positive balances owed**; ``net_worth`` is ``total_assets - total_liabilities``. The UI does not compute these — it reads them straight from this endpoint so a filter change can''t desync the totals.' MemberAllocationRow: properties: member_type: type: string title: Member Type description: '''adult'' or ''dependent''' taxpayer_id: anyOf: - type: integer - type: 'null' title: Taxpayer Id description: Set for adults dependent_id: anyOf: - type: integer - type: 'null' title: Dependent Id description: Set for dependents label: type: string title: Label adult_amount: type: number title: Adult Amount description: $ from ADULT-beneficiary transactions default: 0.0 child_amount: type: number title: Child Amount description: $ from CHILD-beneficiary transactions default: 0.0 household_amount: type: number title: Household Amount description: $ from HOUSEHOLD-beneficiary transactions default: 0.0 general_amount: type: number title: General Amount description: $ from GENERAL-beneficiary transactions default: 0.0 specific_amount: type: number title: Specific Amount description: $ from transactions matching this person's name default: 0.0 total_amount: type: number title: Total Amount description: Sum of all allocation buckets default: 0.0 annualized_total_amount: type: number title: Annualized Total Amount description: Annualized projected total for this member (total_amount * 365.25 / days_in_window) default: 0.0 type: object required: - member_type - label title: MemberAllocationRow description: Computed dollar allocation for one family member. DepositSlipListResponse: properties: deposit_slips: items: $ref: '#/components/schemas/DepositSlipResponse' type: array title: Deposit Slips total: type: integer title: Total page: type: integer title: Page default: 1 page_size: type: integer title: Page Size default: 100 total_pages: type: integer title: Total Pages readOnly: true matched_count: type: integer title: Matched Count readOnly: true type: object required: - deposit_slips - total - total_pages - matched_count title: DepositSlipListResponse description: Paginated list of deposit slips.