> ## Documentation Index
> Fetch the complete documentation index at: https://entendre.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get financial insights

> Returns selected financial metrics and their formulas, including revenue, profit, expenses, spending, burn rate, runway and cash flow.



## OpenAPI

````yaml openapi-public-preview.json GET /v1/reports/financial-insights
openapi: 3.1.0
info:
  title: Entendre API
  version: 1.0.0
  description: Programmatic access to crypto-native accounting and treasury operations.
servers:
  - url: https://api.entendre.finance
    description: Production API.
security:
  - ApiKey: []
tags:
  - name: Cost Basis
    description: >-
      Read and configure the organization cost-basis method and lot-tracking
      scope.
  - name: Organization
    description: Read your organization profile and find members for agent assignments.
  - name: Transactions
    description: Find transactions, inspect their details and create manual records.
  - name: Sources
    description: >-
      Manage wallets, exchange accounts, bank accounts and other transaction
      sources.
  - name: Assets
    description: Inspect asset acquisitions, remaining quantities and cost basis.
  - name: Journals
    description: >-
      Create and post journal entries, correct eligible entries and sync posted
      journals to a connected general ledger.
  - name: Documents
    description: >-
      Upload documents, check processing status and link supporting evidence to
      transactions.
  - name: Legal Entities
    description: Manage the legal entities used in your accounting records.
  - name: Ledger Accounts
    description: Manage your chart of accounts and find accounts for journal entries.
  - name: Tags
    description: Create and manage tags to classify your records.
  - name: Accruals
    description: >-
      Create and post accruals, inspect their status and reverse eligible
      entries.
  - name: Cash Application
    description: Match deposits to invoices and manage the resulting cash applications.
  - name: Classification
    description: >-
      Classify transactions in a batch, post eligible entries and inspect the
      results.
  - name: Revaluation
    description: Run asset revaluations for an accounting period and check their results.
  - name: Accounting Periods
    description: Check whether a period is ready to close, then close or reopen it.
  - name: Income Statement
    description: View revenue, expenses and net income for a reporting period.
  - name: Balance Sheet
    description: View assets, liabilities and equity as of a reporting date.
  - name: Trial Balance
    description: Review ledger account balances and debit and credit totals.
  - name: Closing Positions
    description: View asset positions at the end of a reporting period.
  - name: Treasury Balances
    description: Review treasury balances by asset and source.
  - name: Realized Gains & Losses
    description: Review realized gains and losses from asset dispositions.
  - name: Asset Tax Lots
    description: Inspect asset tax lots, remaining quantities and cost basis.
  - name: Schedule of Dispositions
    description: >-
      Review asset dispositions and their proceeds, cost basis and gains or
      losses.
  - name: Financial Insights
    description: Review financial insights for your selected reporting context.
  - name: Agents
    description: Create agents, schedule their work and inspect their runs.
  - name: Memory
    description: Read, search and maintain the memory files your agents use.
  - name: Connections
    description: Connect providers, manage authorization and disconnect.
  - name: GL Mapping
    description: >-
      Map ledger accounts and legal entities to your ERP. Import legal entities,
      tags and chart of accounts.
  - name: Request
    description: Request information, documents or connections from a client.
  - name: Client
    description: Manage your firm’s client relationships.
  - name: Team
    description: Invite team members and manage their access to your firm.
  - name: Settings
    description: Read and update your firm settings.
  - name: Purpose Accounts
    description: >-
      Read accounting purpose assignments and set the realized gain or loss
      account.
externalDocs:
  description: Versioning, deprecation, and rate-limit policy
  url: https://entendre.ai/docs/get-started/versioning
paths:
  /v1/reports/financial-insights:
    get:
      tags:
        - Financial Insights
      summary: Get financial insights
      description: >-
        Returns selected financial metrics and their formulas, including
        revenue, profit, expenses, spending, burn rate, runway, cash flow, and
        treasury flow: money in and money out of the bank accounts, wallets and
        exchange accounts. Not paginated — this is a computed report, not a
        resource list; request only the metrics a question needs.
      operationId: get_financial_insights
      parameters:
        - name: legal_entity_id
          in: query
          required: false
          description: Legal entity ID (`le_…`). Can be combined with `legal_entity_ids`.
          schema:
            type: string
            example: le_507f1f77bcf86cd799439011
        - name: legal_entity_ids
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              description: Legal entity ID (`le_…`).
              example: le_507f1f77bcf86cd799439011
            maxItems: 100
            uniqueItems: true
          style: form
          explode: true
          description: Legal entities to include (`le_…`). Omit to include all.
        - name: account_ids
          in: query
          required: false
          description: >-
            Comma-separated fac_ financial account IDs. Ignored when
            `basis=ledger`; `meta.account_ids_ignored` is then set.
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
        - name: start_date
          in: query
          required: true
          description: Inclusive interval start.
          schema:
            type: string
            format: date-time
            example: '2026-08-31T12:00:00Z'
        - name: end_date
          in: query
          required: true
          description: Inclusive interval end; start must not exceed end.
          schema:
            type: string
            format: date-time
            example: '2026-08-31T12:00:00Z'
        - name: metrics
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
              description: Metric identifier.
              enum:
                - revenue
                - profit
                - expenses
                - spending
                - burn_rate
                - runway
                - cash_flow
                - treasury_flow
            minItems: 1
            maxItems: 8
          style: form
          explode: true
          description: Metrics to return.
        - name: basis
          in: query
          required: true
          description: >-
            Required. `ledger` for the posted books, or `transactions` for
            observed cash movements.
          schema:
            type: string
            enum:
              - ledger
              - transactions
        - name: granularity
          in: query
          required: false
          description: >-
            Bucket size. For `basis=ledger`, the response shows the monthly
            buckets used.
          schema:
            type: string
            enum:
              - daily
              - weekly
              - monthly
      responses:
        '200':
          description: The request succeeded.
          headers:
            X-Request-Id:
              description: Support correlation ID.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Not paginated. Each item has its own `meta`. Burn rate and
                  runway always use monthly buckets, whatever the `granularity`.
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/FinancialInsight'
                    description: The records.
                required:
                  - data
                additionalProperties: false
              example:
                data:
                  - metric: expenses
                    value: '100.00'
                    unit: USD
                    formula: sum(expense account balances)
                    reason: null
                    details:
                      total: '100.00'
                      by_category:
                        - category: Software
                          amount: '100.00'
                      currency: USD
                      time_series:
                        - period_start: '2026-08-01T00:00:00Z'
                          period_end: '2026-08-31T23:59:59.999Z'
                          total: '100.00'
                          categories:
                            - category: Software
                              amount: '100.00'
                    meta:
                      source: gl
                      granularity: monthly
                      start_date: '2026-08-01T00:00:00Z'
                      end_date: '2026-08-31T23:59:59.999Z'
                      currency: USD
                      granularity_note: null
                      period_snapped_note: null
                      account_ids_ignored: false
                      account_ids_ignored_reason: null
                      basis: accrual
                      cash_basis_caveat: null
        '400':
          description: >-
            The request is invalid. `error.fields` lists the fields to correct.
            Nothing was changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: VALIDATION_ERROR
                  message: Invalid path, query or request body.
                  request_id: req_example
        '401':
          description: The API key is missing, invalid or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UNAUTHORIZED
                  message: Invalid or expired API Key
                  request_id: req_example
                  suggested_action: >-
                    Send an API key in X-API-Key, or an OAuth access token as
                    Authorization: Bearer. Refresh an expired access token.
                  documentation_url: https://entendre.ai/docs/get-started/authentication
          headers:
            WWW-Authenticate:
              $ref: '#/components/headers/WWW-Authenticate'
        '403':
          description: >-
            The API key does not have the required scope or is not associated
            with a user, or the action needs a review in the dashboard.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: FORBIDDEN
                  message: Insufficient access to organization
                  request_id: req_example
        '404':
          description: The resource does not exist, or your organization cannot access it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RESOURCE_NOT_FOUND
                  message: Resource not found
                  request_id: req_example
        '429':
          description: >-
            Too many requests. If the response has a `Retry-After` header, wait
            that many seconds before you retry. Otherwise, read `error.message`.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RATE_LIMITED
                  message: Rate limit exceeded. Retry after 30s.
                  request_id: req_example
        '500':
          description: >-
            An unexpected error occurred. A write can still have taken effect;
            check the resource before you retry. Give the `request_id` to
            support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: INTERNAL_ERROR
                  message: Internal server error
                  request_id: req_example
        '503':
          description: >-
            A service that this operation needs is unavailable. If the response
            has a `Retry-After` header, wait that many seconds. Check for
            earlier accepted work before you send the request again.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: SERVICE_UNAVAILABLE
                  message: Service unavailable.
                  request_id: req_example
components:
  schemas:
    FinancialInsight:
      oneOf:
        - type: object
          properties:
            metric:
              type: string
              const: revenue
              description: Metric name.
            value:
              type:
                - string
                - 'null'
              description: >-
                Summary decimal value; null for unavailable or inapplicable
                metrics.
            unit:
              type: string
              description: Unit of the value, such as `USD` or `months`.
            formula:
              type: string
              description: Formula and effective calculation basis.
            reason:
              type:
                - string
                - 'null'
              description: Why a value is unavailable or qualified.
            details:
              type: object
              required:
                - total
                - currency
                - time_series
              properties:
                data_quality:
                  $ref: '#/components/schemas/TransactionInsightDataQuality'
                total:
                  type: string
                  description: Total income over the window (decimal string).
                currency:
                  type: string
                  example: USD
                  description: Currency of the amounts.
                time_series:
                  type: array
                  items:
                    $ref: '#/components/schemas/V1FinancialInsightSeriesPoint'
                  description: Values for each bucket.
              description: Values of the metric.
            meta:
              $ref: '#/components/schemas/V1FinancialInsightMeta'
          required:
            - metric
            - value
            - unit
            - formula
            - reason
            - details
            - meta
          additionalProperties: false
        - type: object
          properties:
            metric:
              type: string
              const: profit
              description: Metric name.
            value:
              type:
                - string
                - 'null'
              description: >-
                Summary decimal value; null for unavailable or inapplicable
                metrics.
            unit:
              type: string
              description: Unit of the value, such as `USD` or `months`.
            formula:
              type: string
              description: Formula and effective calculation basis.
            reason:
              type:
                - string
                - 'null'
              description: Why a value is unavailable or qualified.
            details:
              type: object
              required:
                - total_revenue
                - total_expenses
                - total_profit
                - currency
                - time_series
              properties:
                data_quality:
                  $ref: '#/components/schemas/TransactionInsightDataQuality'
                total_revenue:
                  type: string
                  description: Total income (decimal string).
                total_expenses:
                  type: string
                  description: Total expenses (decimal string).
                total_profit:
                  type: string
                  description: total_revenue minus total_expenses (decimal string).
                currency:
                  type: string
                  example: USD
                  description: Currency of the amounts.
                time_series:
                  type: array
                  items:
                    type: object
                    required:
                      - period_start
                      - period_end
                      - revenue
                      - expenses
                      - profit
                    properties:
                      period_start:
                        type: string
                        format: date-time
                        description: Start of the bucket.
                      period_end:
                        type: string
                        format: date-time
                        description: End of the bucket.
                      revenue:
                        type: string
                        description: Revenue in the bucket (decimal string).
                      expenses:
                        type: string
                        description: Expenses in the bucket (decimal string).
                      profit:
                        type: string
                        description: Revenue minus expenses in the bucket (decimal string).
                  description: Values for each bucket.
              description: Values of the metric.
            meta:
              $ref: '#/components/schemas/V1FinancialInsightMeta'
          required:
            - metric
            - value
            - unit
            - formula
            - reason
            - details
            - meta
          additionalProperties: false
        - type: object
          properties:
            metric:
              type: string
              const: expenses
              description: Metric name.
            value:
              type:
                - string
                - 'null'
              description: >-
                Summary decimal value; null for unavailable or inapplicable
                metrics.
            unit:
              type: string
              description: Unit of the value, such as `USD` or `months`.
            formula:
              type: string
              description: Formula and effective calculation basis.
            reason:
              type:
                - string
                - 'null'
              description: Why a value is unavailable or qualified.
            details:
              type: object
              required:
                - total
                - by_category
                - currency
                - time_series
              properties:
                data_quality:
                  $ref: '#/components/schemas/TransactionInsightDataQuality'
                total:
                  type: string
                  description: Total expenses over the window (decimal string).
                by_category:
                  type: array
                  items:
                    $ref: '#/components/schemas/V1FinancialInsightCategoryAmount'
                  description: Totals by category.
                currency:
                  type: string
                  example: USD
                  description: Currency of the amounts.
                time_series:
                  type: array
                  items:
                    type: object
                    required:
                      - period_start
                      - period_end
                      - total
                      - categories
                    properties:
                      period_start:
                        type: string
                        format: date-time
                        description: Start of the bucket.
                      period_end:
                        type: string
                        format: date-time
                        description: End of the bucket.
                      total:
                        type: string
                        description: Total in the bucket (decimal string).
                      categories:
                        type: array
                        items:
                          $ref: >-
                            #/components/schemas/V1FinancialInsightCategoryAmount
                        description: Totals by category in the bucket.
                  description: Values for each bucket.
              description: Values of the metric.
            meta:
              $ref: '#/components/schemas/V1FinancialInsightMeta'
          required:
            - metric
            - value
            - unit
            - formula
            - reason
            - details
            - meta
          additionalProperties: false
        - type: object
          properties:
            metric:
              type: string
              const: spending
              description: Metric name.
            value:
              type:
                - string
                - 'null'
              description: >-
                Summary decimal value; null for unavailable or inapplicable
                metrics.
            unit:
              type: string
              description: Unit of the value, such as `USD` or `months`.
            formula:
              type: string
              description: Formula and effective calculation basis.
            reason:
              type:
                - string
                - 'null'
              description: Why a value is unavailable or qualified.
            details:
              type: object
              required:
                - total
                - by_source_type
                - by_classification
                - currency
                - time_series
              properties:
                data_quality:
                  $ref: '#/components/schemas/TransactionInsightDataQuality'
                total:
                  type: string
                  description: Total spending over the window (decimal string).
                by_source_type:
                  type: array
                  items:
                    $ref: '#/components/schemas/V1FinancialInsightSpendingEntry'
                  description: Totals by source type.
                by_classification:
                  type: array
                  items:
                    $ref: '#/components/schemas/V1FinancialInsightSpendingEntry'
                  description: Totals by transaction type.
                currency:
                  type: string
                  example: USD
                  description: Currency of the amounts.
                time_series:
                  type: array
                  items:
                    type: object
                    required:
                      - period_start
                      - period_end
                      - total
                      - by_source_type
                      - by_classification
                    properties:
                      period_start:
                        type: string
                        format: date-time
                        description: Start of the bucket.
                      period_end:
                        type: string
                        format: date-time
                        description: End of the bucket.
                      total:
                        type: string
                        description: Total in the bucket (decimal string).
                      by_source_type:
                        type: array
                        items:
                          $ref: '#/components/schemas/V1FinancialInsightSpendingEntry'
                        description: Totals by source type in the bucket.
                      by_classification:
                        type: array
                        items:
                          $ref: '#/components/schemas/V1FinancialInsightSpendingEntry'
                        description: Totals by transaction type in the bucket.
                  description: Values for each bucket.
              description: Values of the metric.
            meta:
              $ref: '#/components/schemas/V1FinancialInsightMeta'
          required:
            - metric
            - value
            - unit
            - formula
            - reason
            - details
            - meta
          additionalProperties: false
        - type: object
          properties:
            metric:
              type: string
              const: burn_rate
              description: Metric name.
            value:
              type:
                - string
                - 'null'
              description: >-
                Summary decimal value; null for unavailable or inapplicable
                metrics.
            unit:
              type: string
              description: Unit of the value, such as `USD` or `months`.
            formula:
              type: string
              description: Formula and effective calculation basis.
            reason:
              type:
                - string
                - 'null'
              description: Why a value is unavailable or qualified.
            details:
              type: object
              required:
                - average_monthly_burn
                - cash_flow_positive
                - total_expenses
                - total_income
                - months_analyzed
                - currency
                - trend
                - no_data
              properties:
                data_quality:
                  $ref: '#/components/schemas/TransactionInsightDataQuality'
                average_monthly_burn:
                  type: string
                  description: >-
                    Net burn (total outflows minus inflows) divided by months in
                    the window (decimal string). Negative when the organization
                    is net cash-flow positive.
                cash_flow_positive:
                  type: boolean
                  description: >-
                    True when net burn is <= 0 (inflows cover outflows over the
                    window).
                total_expenses:
                  type: string
                  description: Total expenses (outflows) over the window (decimal string).
                total_income:
                  type: string
                  description: Total income (inflows) over the window (decimal string).
                months_analyzed:
                  type: integer
                  description: >-
                    Number of whole months in the window. Normally >= 1; 0 only
                    when basis=ledger and the window overlaps no accounting
                    period (see no_data).
                currency:
                  type: string
                  example: USD
                  description: Currency of the amounts.
                trend:
                  type: array
                  description: >-
                    Per-bucket net burn (outflows minus inflows) as
                    single-amount series points.
                  items:
                    $ref: '#/components/schemas/V1FinancialInsightSeriesPoint'
                no_data:
                  type: boolean
                  description: >-
                    `true` when `basis=ledger` and the window has no accounting
                    periods.
              description: Values of the metric.
            meta:
              $ref: '#/components/schemas/V1FinancialInsightMeta'
          required:
            - metric
            - value
            - unit
            - formula
            - reason
            - details
            - meta
          additionalProperties: false
        - type: object
          properties:
            metric:
              type: string
              const: runway
              description: Metric name.
            value:
              type:
                - string
                - 'null'
              description: >-
                Summary decimal value; null for unavailable or inapplicable
                metrics.
            unit:
              type: string
              description: Unit of the value, such as `USD` or `months`.
            formula:
              type: string
              description: Formula and effective calculation basis.
            reason:
              type:
                - string
                - 'null'
              description: Why a value is unavailable or qualified.
            details:
              type: object
              required:
                - months_remaining
                - cash_flow_positive
                - current_cash
                - average_monthly_burn
                - currency
                - no_data
              properties:
                data_quality:
                  $ref: '#/components/schemas/TransactionInsightDataQuality'
                months_remaining:
                  type:
                    - string
                    - 'null'
                  description: >-
                    `current_cash` divided by `average_monthly_burn` (decimal
                    string). `null` when the organization is cash-flow positive.
                cash_flow_positive:
                  type: boolean
                  description: >-
                    True when net burn (outflows minus inflows) is <= 0. When
                    true, months_remaining is null and runway is not applicable.
                current_cash:
                  type: string
                  description: Current cash position (decimal string).
                average_monthly_burn:
                  type: string
                  description: >-
                    Net burn (total outflows minus inflows) divided by months in
                    the window (decimal string). Negative when the organization
                    is net cash-flow positive.
                currency:
                  type: string
                  example: USD
                  description: Currency of the amounts.
                no_data:
                  type: boolean
                  description: >-
                    `true` when `basis=ledger` and the window has no accounting
                    periods, so runway cannot be calculated.
              description: Values of the metric.
            meta:
              $ref: '#/components/schemas/V1FinancialInsightMeta'
          required:
            - metric
            - value
            - unit
            - formula
            - reason
            - details
            - meta
          additionalProperties: false
        - type: object
          properties:
            metric:
              type: string
              const: cash_flow
              description: Metric name.
            value:
              type:
                - string
                - 'null'
              description: >-
                Summary decimal value; null for unavailable or inapplicable
                metrics.
            unit:
              type: string
              description: Unit of the value, such as `USD` or `months`.
            formula:
              type: string
              description: Formula and effective calculation basis.
            reason:
              type:
                - string
                - 'null'
              description: Why a value is unavailable or qualified.
            details:
              type: object
              required:
                - net_flow
                - total_inflows
                - total_outflows
                - currency
                - time_series
              properties:
                net_flow:
                  type: string
                  description: total_inflows minus total_outflows (decimal string).
                total_inflows:
                  type: string
                  description: Total income over the window (decimal string).
                total_outflows:
                  type: string
                  description: Total expenses over the window (decimal string).
                currency:
                  type: string
                  example: USD
                  description: Currency of the amounts.
                time_series:
                  type: array
                  items:
                    type: object
                    required:
                      - period_start
                      - period_end
                      - inflows
                      - outflows
                      - net
                      - cumulative_net
                    properties:
                      period_start:
                        type: string
                        format: date-time
                        description: Start of the bucket.
                      period_end:
                        type: string
                        format: date-time
                        description: End of the bucket.
                      inflows:
                        type: string
                        description: Money in during the bucket (decimal string).
                      outflows:
                        type: string
                        description: Money out during the bucket (decimal string).
                      net:
                        type: string
                        description: Inflows minus outflows in the bucket (decimal string).
                      cumulative_net:
                        type: string
                        description: >-
                          Net flow from the window start through this bucket
                          (decimal string).
                  description: Values for each bucket.
                data_quality:
                  $ref: '#/components/schemas/TransactionInsightDataQuality'
              description: Values of the metric.
            meta:
              $ref: '#/components/schemas/V1FinancialInsightMeta'
          required:
            - metric
            - value
            - unit
            - formula
            - reason
            - details
            - meta
          additionalProperties: false
        - type: object
          properties:
            metric:
              type: string
              const: treasury_flow
              description: Metric name.
            value:
              type:
                - string
                - 'null'
              description: >-
                Summary decimal value; null for unavailable or inapplicable
                metrics.
            unit:
              type: string
              description: Unit of the value, such as `USD` or `months`.
            formula:
              type: string
              description: Formula and effective calculation basis.
            reason:
              type:
                - string
                - 'null'
              description: Why a value is unavailable or qualified.
            details:
              $ref: '#/components/schemas/TreasuryFlowDetails'
            meta:
              $ref: '#/components/schemas/V1FinancialInsightMeta'
          required:
            - metric
            - value
            - unit
            - formula
            - reason
            - details
            - meta
          additionalProperties: false
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Technical description for developers.
            fields:
              type: object
              additionalProperties:
                type: string
              description: >-
                Present only on VALIDATION_ERROR. Maps failing field paths to
                reason strings.
            details:
              type: object
              additionalProperties: true
              description: >-
                Optional redacted diagnostic details. Request validation uses
                fields or field_errors.
            suggested_action:
              type: string
              description: A suggested next step.
            documentation_url:
              type: string
              format: uri
              description: Link to documentation about this error.
            request_id:
              type: string
              description: Unique request ID for support escalation.
          description: Error details.
    TransactionInsightDataQuality:
      type: object
      description: >-
        Transactions that the figures exclude, and why. Bank removals and
        amounts without a USD value are excluded.
      required:
        - status
        - window_transaction_count
        - excluded_spam_count
        - excluded_spam_by_currency
        - excluded_non_pl_classification_count
        - excluded_non_pl_classification_by_currency
        - no_posted_journal_entry_count
        - warnings
        - excluded_bank_removed_count
        - excluded_bank_removed_by_currency
        - excluded_currency_valuation_count
        - excluded_currency_valuation_by_currency
        - bank_correction_review_count
        - plaid_enrichment
      properties:
        status:
          type: string
          enum:
            - ok
            - warnings
            - unavailable
          description: >-
            `ok`, `warnings`, or `unavailable` when the exclusions could not be
            calculated.
        window_transaction_count:
          type: integer
          description: Transactions in the window, including excluded ones.
        excluded_spam_count:
          type: integer
          description: Spam-flagged transactions excluded from the figures.
        excluded_spam_by_currency:
          type: array
          items:
            $ref: '#/components/schemas/TransactionInsightExclusionByCurrency'
          description: >-
            Excluded spam transactions, by currency. Amounts are decimal
            strings.
        excluded_non_pl_classification_count:
          type: integer
          description: >-
            Transactions excluded because their type is not income or expense,
            such as transfers and swaps.
        excluded_non_pl_classification_by_currency:
          type: array
          items:
            $ref: '#/components/schemas/TransactionInsightExclusionByCurrency'
          description: >-
            Excluded transfers and other non-income, non-expense transactions,
            by currency.
        no_posted_journal_entry_count:
          type: integer
          description: >-
            Transactions in the window with no posted journal. Same as the
            `has_posted_journal_entry=false` filter.
        warnings:
          type: array
          items:
            type: string
          description: >-
            [WARNING]-prefixed prose for each non-zero excluded bucket. Surface
            these whenever material.
        excluded_bank_removed_count:
          type: integer
          minimum: 0
          description: Transactions excluded because the bank removed them.
        excluded_bank_removed_by_currency:
          type: array
          items:
            $ref: '#/components/schemas/TransactionInsightExclusionByCurrency'
          description: Bank removals grouped by currency.
        excluded_currency_valuation_count:
          type: integer
          minimum: 0
          description: Transactions excluded because they have no USD value.
        excluded_currency_valuation_by_currency:
          type: array
          items:
            $ref: '#/components/schemas/TransactionInsightExclusionByCurrency'
          description: Transactions without a USD value, grouped by currency.
        bank_correction_review_count:
          type: integer
          minimum: 0
          description: Transactions with a bank correction to review.
        plaid_enrichment:
          type: object
          description: Coverage of Plaid enrichment in the window.
          required:
            - transaction_count
            - merchant_identity_count
            - running_balance_count
            - category_versions
            - category_confidence
          properties:
            transaction_count:
              type: integer
              minimum: 0
              description: Transactions with Plaid enrichment.
            merchant_identity_count:
              type: integer
              minimum: 0
              description: Transactions with a Plaid merchant ID.
            running_balance_count:
              type: integer
              minimum: 0
              description: Transactions with a running balance.
            category_versions:
              type: array
              items:
                type: object
                required:
                  - version
                  - transaction_count
                properties:
                  version:
                    type: string
                    description: Plaid category version.
                  transaction_count:
                    type: integer
                    minimum: 0
                    description: Transactions with this version.
              description: Transactions by Plaid category version.
            category_confidence:
              type: array
              items:
                type: object
                required:
                  - confidence
                  - transaction_count
                properties:
                  confidence:
                    type: string
                    description: Plaid confidence level.
                  transaction_count:
                    type: integer
                    minimum: 0
                    description: Transactions with this confidence.
              description: Transactions by Plaid category confidence.
    V1FinancialInsightSeriesPoint:
      type: object
      required:
        - period_start
        - period_end
        - amount
      description: >-
        One bucket of a single-amount financial-insight time series (used by
        revenue `time_series` and burn-rate `trend`). Monetary amounts are
        decimal strings.
      properties:
        period_start:
          type: string
          format: date-time
          description: Start of the bucket.
        period_end:
          type: string
          format: date-time
          description: End of the bucket.
        amount:
          type: string
          description: >-
            Decimal-string amount for the bucket (revenue: income; burn-rate:
            expenses).
    V1FinancialInsightMeta:
      type: object
      required:
        - source
        - granularity
        - start_date
        - end_date
        - currency
      properties:
        source:
          type: string
          enum:
            - gl
            - transactions
          description: >-
            Data source: `gl` for `basis=ledger`, `transactions` for
            `basis=transactions`.
        granularity:
          type: string
          enum:
            - daily
            - weekly
            - monthly
          description: Bucket size.
        start_date:
          type: string
          format: date-time
          description: Start of the window.
        end_date:
          type: string
          format: date-time
          description: End of the window.
        currency:
          type: string
          example: USD
          description: Currency of the amounts.
        granularity_note:
          type:
            - string
            - 'null'
          description: Note when the bucket size differs from the request.
        period_snapped_note:
          type:
            - string
            - 'null'
          description: >-
            Present when `basis=ledger` and the window is not whole months. The
            totals then cover the full accounting periods.
        account_ids_ignored:
          type:
            - boolean
            - 'null'
          description: '`true` when `account_ids` was ignored.'
        account_ids_ignored_reason:
          type:
            - string
            - 'null'
          description: Why `account_ids` was ignored.
        basis:
          type: string
          enum:
            - cash
            - accrual
          description: >-
            Accounting basis of the figures: cash (basis=transactions, settled
            cash movements) or accrual (basis=ledger, the posted double-entry
            ledger).
        cash_basis_caveat:
          type:
            - string
            - 'null'
          description: >-
            Present when `basis=transactions`. Expenses do not include unpaid
            bills, accruals or non-cash journals.
    V1FinancialInsightCategoryAmount:
      type: object
      required:
        - category
        - amount
      description: A named category total. `amount` is a decimal string.
      properties:
        category:
          type: string
          description: Category name.
        amount:
          type: string
          description: Category total (decimal string).
    V1FinancialInsightSpendingEntry:
      type: object
      required:
        - key
        - amount
      description: >-
        A keyed spending total (by source type or classification). `amount` is a
        decimal string.
      properties:
        key:
          type: string
          description: Source type or transaction type.
        amount:
          type: string
          description: Spending total (decimal string).
    TreasuryFlowDetails:
      type: object
      additionalProperties: false
      required:
        - status
        - total_credits
        - total_debits
        - net_flow
        - currency
        - source_count
        - time_series
        - by_counterparty
        - by_category
        - recent_activity
        - data_quality
      description: >-
        Money in and money out of the cash sources in scope: Plaid depository
        accounts, internal wallets and exchange accounts.
      properties:
        status:
          type: string
          enum:
            - complete
            - partial
            - unavailable
          description: >-
            `partial`: some movements have no USD value or no price, so a total
            can be too low. `unavailable`: the totals are null; never read them
            as zero.
        total_credits:
          type:
            - string
            - 'null'
          description: Money in. Null when `status` is `unavailable`.
        total_debits:
          type:
            - string
            - 'null'
          description: Money out. Null when `status` is `unavailable`.
        net_flow:
          type:
            - string
            - 'null'
          description: total_credits minus total_debits.
        currency:
          type: string
          enum:
            - USD
          description: Currency of the amounts.
        source_count:
          type: integer
          description: Cash sources in scope.
        time_series:
          type: array
          items:
            $ref: '#/components/schemas/TreasuryFlowBucket'
          description: Separate credit and debit series by `granularity`.
        by_counterparty:
          type: object
          additionalProperties: false
          required:
            - credit
            - debit
          description: >-
            Up to 10 counterparties per direction, ranked by amount, then
            `Other`.
          properties:
            credit:
              type: array
              items:
                $ref: '#/components/schemas/TreasuryFlowCounterparty'
              description: Where money in came from.
            debit:
              type: array
              items:
                $ref: '#/components/schemas/TreasuryFlowCounterparty'
              description: Where money out went.
        by_category:
          type: object
          additionalProperties: false
          required:
            - credit
            - debit
          description: Money in and money out by transaction type, ranked by amount.
          properties:
            credit:
              type: array
              items:
                $ref: '#/components/schemas/TreasuryFlowCategory'
              description: Money in by transaction type.
            debit:
              type: array
              items:
                $ref: '#/components/schemas/TreasuryFlowCategory'
              description: Money out by transaction type.
        recent_activity:
          type: array
          items:
            $ref: '#/components/schemas/TreasuryFlowActivity'
          description: >-
            The 10 newest cash movements of the window, internal transfers
            included.
        data_quality:
          $ref: '#/components/schemas/TreasuryFlowDataQuality'
    TransactionInsightExclusionByCurrency:
      type: object
      required:
        - currency
        - transaction_count
        - amount
      properties:
        currency:
          type: string
          description: >-
            Currency code from the excluded transaction rows. `UNKNOWN` means
            the source row has no currency.
        transaction_count:
          type: integer
          description: Excluded transactions in this currency block.
        amount:
          type: string
          description: Gross value for this currency (decimal string, 2 decimal places).
    TreasuryFlowBucket:
      type: object
      additionalProperties: false
      required:
        - period_start
        - period_end
        - credits
        - debits
        - net
      description: >-
        Money in and money out of one period bucket. Buckets with no movement
        are absent.
      properties:
        period_start:
          type: string
          format: date-time
          description: Bucket start (UTC), clamped to the window.
        period_end:
          type: string
          format: date-time
          description: Bucket end (UTC), clamped to the window.
        credits:
          type: string
          description: Money in of the bucket.
        debits:
          type: string
          description: Money out of the bucket.
        net:
          type: string
          description: credits minus debits.
    TreasuryFlowCounterparty:
      type: object
      additionalProperties: false
      required:
        - key
        - name
        - source_id
        - placeholder_name
        - external_source_id
        - address
        - chain
        - amount
        - transaction_count
        - send_history
      description: >-
        One counterparty of one direction. The last row can be `Other`, the
        remainder of the direction total.
      properties:
        key:
          type: string
          description: >-
            Stable across windows: `source:<fac_ id>`, `wallet:<id>`,
            `address:<chain>:<address>`, `name:<lowercase name>`, or `other`.
        name:
          type: string
          description: >-
            Display name. An address that the organization saved as an external
            source shows the name of that source. Bank and card rows use the
            transaction `vendor` rule. An exchange row with no trade data and no
            counterparty address is named for its exchange and direction, for
            example `Kraken deposit` or `Kraken withdrawal`.
        source_id:
          type:
            - string
            - 'null'
          description: >-
            `fac_` ID when the counterparty is a cash source of the organization
            outside the scope.
        placeholder_name:
          type: boolean
          description: >-
            True when `name` is a generic label, such as `Bank transaction`, and
            not the name of a counterparty. Do not present such a name as a
            counterparty.
        external_source_id:
          type:
            - string
            - 'null'
          description: >-
            `wal_` ID of the external source that names this counterparty. Use
            it with `GET`, `PATCH`, or `DELETE /v1/sources/{id}`.
        address:
          type:
            - string
            - 'null'
          description: >-
            The counterparty address in its original case, for an `address:`
            row. The key holds it in lowercase. Null for every other row, and
            for an exchange ID that is not an address.
        chain:
          type:
            - string
            - 'null'
          description: >-
            The chain of `address`. Null when `address` is null or the
            transaction has no chain.
        amount:
          type: string
          description: USD amount.
        transaction_count:
          type: integer
          description: Number of transactions.
        send_history:
          oneOf:
            - $ref: '#/components/schemas/SendHistory'
            - type: 'null'
          description: >-
            All-time sends of the whole organization to this counterparty,
            outside the window and the scope too. Set on `address:` and
            `wallet:` rows. Null on source, name and `Other` rows, on an own
            address, and when the history could not be read.
    TreasuryFlowCategory:
      type: object
      additionalProperties: false
      required:
        - category
        - amount
        - transaction_count
      description: Money in or money out of one transaction type.
      properties:
        category:
          type: string
          description: Transaction type.
        amount:
          type: string
          description: USD amount.
        transaction_count:
          type: integer
          description: Number of transactions.
    TreasuryFlowActivity:
      type: object
      additionalProperties: false
      required:
        - transaction
        - direction
        - source_id
        - amount
      description: One of the newest cash movements of the scope.
      properties:
        transaction:
          $ref: '#/components/schemas/Transaction'
        direction:
          type: string
          enum:
            - credit
            - debit
            - internal
          description: >-
            Direction for the cash source of the scope. `internal` is a transfer
            between two cash sources of the scope; it is in no total.
        source_id:
          type: string
          description: >-
            `fac_` ID of the cash source of the scope that the movement belongs
            to. For a Ramp or Stripe row of a Plaid merge, this is the bank.
        amount:
          type: string
          description: USD amount.
    TreasuryFlowDataQuality:
      type: object
      additionalProperties: false
      required:
        - status
        - internal_transfers
        - unmatched_transfers
        - unpriced_count
        - excluded_conversions
        - excluded_currency_valuation
        - excluded_bank_removed_count
        - counterparty_ranking_truncated
        - warnings
      description: What the totals leave out, and why.
      properties:
        status:
          type: string
          enum:
            - ok
            - warnings
            - unavailable
          description: '`unavailable` when the totals could not be computed.'
        internal_transfers:
          type: object
          additionalProperties: false
          required:
            - transaction_count
            - amount
          description: >-
            Transfers between two cash sources of the scope. They are in no
            total. The amount covers USD rows only.
          properties:
            transaction_count:
              type: integer
              description: Number of transactions.
            amount:
              type: string
              description: USD amount (decimal string).
        unmatched_transfers:
          type: object
          additionalProperties: false
          required:
            - transaction_count
            - amount
          description: >-
            Transfers with no matching side in a connected cash source. They
            count as money in or money out.
          properties:
            transaction_count:
              type: integer
              description: Number of transactions.
            amount:
              type: string
              description: USD amount (decimal string).
        unpriced_count:
          type: integer
          description: Movements with no price. They count as 0.00 USD.
        excluded_conversions:
          type: array
          items:
            $ref: '#/components/schemas/TreasuryFlowExclusion'
          description: Swap, conversion and bridge legs inside a cash source.
        excluded_currency_valuation:
          type: array
          items:
            $ref: '#/components/schemas/TreasuryFlowExclusion'
          description: Movements with no USD value.
        excluded_bank_removed_count:
          type: integer
          description: Transactions that the bank removed.
        counterparty_ranking_truncated:
          type: boolean
          description: >-
            True when a window has more counterparty groups than the ranking
            reads. A named counterparty amount can then be too low. The totals
            are complete.
        warnings:
          type: array
          items:
            type: string
          description: >-
            Disclosures for a reader. `[WARNING]` marks one that can make a
            total too low.
    SendHistory:
      type: object
      additionalProperties: false
      required:
        - send_count
        - total_sent
        - currency
        - unpriced_send_count
        - first_sent_at
        - last_sent_at
      description: >-
        The sends of the organization to one destination, over all time and
        every source of the organization. A send is a debit of a wallet,
        exchange or Fireblocks source. Spam, conversions (swaps, bridges), fees,
        and internal or intercompany transfers are not sends. A send to an
        address of an own wallet is an internal transfer.
      properties:
        send_count:
          type: integer
          description: Number of sends.
        total_sent:
          type: string
          description: USD value at the time of each send, of the sends that have one.
        currency:
          type: string
          enum:
            - USD
          description: The currency of `total_sent`.
        unpriced_send_count:
          type: integer
          description: >-
            The sends that `total_sent` leaves out because they have no USD
            value.
        first_sent_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Date of the first send. Null when `send_count` is 0.
        last_sent_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Date of the last send. Null when `send_count` is 0.
    Transaction:
      type: object
      required:
        - id
        - account_id
        - organization_id
        - legal_entity_id
        - source_class
        - external
        - internal
      properties:
        id:
          type: string
          examples:
            - txn_abc123
          description: Transaction ID (`txn_…`).
        sequence_number:
          type:
            - string
            - 'null'
          description: >-
            Sequence number, such as `OT-1234`. It is assigned shortly after
            creation, so it is `null` in the create response.
        account_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the source of the transaction. Use it in the `account_id`
            filter of List transactions.
        organization_id:
          type: string
          description: Organization ID (`org_…`).
        legal_entity_id:
          type: string
          description: Legal entity ID (`le_…`).
        source_class:
          type: string
          enum:
            - crypto
            - fiat
            - card
            - exchange
            - other
          description: 'Kind of source: `crypto`, `fiat`, `card`, `exchange` or `other`.'
        provider:
          type: string
          enum:
            - wallet
            - fireblocks
            - plaid
            - ramp
            - rain
            - kraken
            - binance
            - coinbase
            - coinbase_prime
            - coinbase_exchange
            - coinbase_international
            - deribit
            - bitmex
            - bybit
            - kucoin
            - gate
            - mexc
            - gemini
            - woo
            - okx
            - bitfinex
            - circle
            - canton
            - niural
            - finch_payroll
          description: Provider that the transaction came from.
        vendor:
          type:
            - string
            - 'null'
          description: >-
            Counterparty name, or `null` when unknown. Can be bank text when
            there is no merchant name.
        provider_category:
          type:
            - string
            - 'null'
          description: >-
            Raw category metadata assigned by Ramp or Plaid. It is not
            accounting treatment.
        external:
          type: object
          properties:
            timestamp:
              type: string
              format: date-time
              description: Time of the transaction (ISO 8601).
            description:
              type: string
              description: Description from the provider.
            direction:
              type: string
              enum:
                - credit
                - debit
              description: >-
                `credit` for money in, `debit` for money out, relative to the
                source.
            quantity:
              type:
                - object
                - 'null'
              description: >-
                Token quantity breakdown (crypto only). `null` for fiat/card
                transactions.
              properties:
                gross:
                  type: string
                  description: >-
                    Gross token quantity before fees. For a 1.5 ETH transfer
                    with 0.003 ETH gas, `gross` is `"1.5"`.
                fee:
                  type: string
                  description: >-
                    Token fee deducted (such as gas in native token). Same unit
                    as `currency`.
                net:
                  type: string
                  description: Net token quantity after fees (`gross - fee`).
            currency:
              type: string
              description: Token symbol (crypto) or ISO 4217 (fiat).
            value_fiat:
              $ref: '#/components/schemas/ValueFiat'
          description: The transaction as the provider reported it.
        crypto:
          type:
            - object
            - 'null'
          description: Present when `source_class` is `crypto`. `null` otherwise.
          properties:
            chain:
              type: string
              description: Blockchain network, such as `eth`.
            asset_type:
              type: string
              description: Asset symbol, such as `ETH`.
            from_address:
              type: string
              description: Sending address.
            to_address:
              type: string
              description: Receiving address.
            hash:
              type: string
              description: On-chain transaction hash.
        bank:
          type:
            - object
            - 'null'
          description: Bank details for fiat transactions.
          properties:
            bank_name:
              type: string
              description: Bank name.
            account_last4:
              type: string
              description: Last four digits of the bank account.
            counterparty_name:
              type: string
              description: Counterparty name from the bank.
            merchant_id:
              type: string
              description: >-
                Stable merchant ID from Plaid. Use it to group transactions by
                merchant.
            category_version:
              type: string
              description: Version of the Plaid category taxonomy.
            category_confidence:
              type: string
              description: Plaid confidence in the category.
            running_balance:
              type: string
              description: >-
                Account balance after the transaction, when the bank reports it
                (decimal string).
            correction_status:
              type: string
              description: Status of a bank correction to this transaction.
            correction_reason:
              type: string
              description: Reason for the bank correction.
            bank_removed:
              type: boolean
              description: '`true` when the bank removed the transaction.'
            counterparties:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    nullable: true
                    description: Counterparty name.
                  entity_id:
                    type: string
                    nullable: true
                    description: Plaid entity ID of the counterparty.
                  type:
                    type: string
                    nullable: true
                    description: >-
                      Counterparty type, such as merchant or payment
                      intermediary.
                  confidence:
                    type: string
                    nullable: true
                    description: Plaid confidence in the counterparty.
              description: Counterparties that Plaid identified.
        card:
          type:
            - object
            - 'null'
          description: Present when `source_class` is `card`. `null` otherwise.
          properties:
            merchant_name:
              type: string
              description: Merchant name.
            merchant_category:
              type: string
              description: Merchant category.
            card_last4:
              type: string
              description: Last four digits of the card.
            employee_name:
              type: string
              description: Cardholder name.
        internal:
          type: object
          properties:
            transaction_type:
              allOf:
                - $ref: '#/components/schemas/TransactionCategory'
              description: >-
                Economic transaction type. The linked journal shows the
                accounting treatment.
            status:
              type: string
              enum:
                - pending
                - posted
                - spam
              description: '`pending`, `posted` or `spam`.'
            memo:
              type:
                - string
                - 'null'
              description: Memo.
            journal_entry_id:
              type:
                - string
                - 'null'
              description: >-
                Prefixed ID of the associated journal entry (such as
                `je_abc123`). `null` if no journal entry has been posted.
          description: How Entendre records the transaction.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Time the transaction was imported (ISO 8601).
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 timestamp of the last update.
        tag_ids:
          type: array
          items:
            type: string
            description: Tag ID (`tag_…`).
            example: tag_507f1f77bcf86cd799439011
          maxItems: 100
          uniqueItems: true
          description: Tag IDs (`tag_…`).
    TreasuryFlowExclusion:
      type: object
      additionalProperties: false
      required:
        - currency
        - transaction_count
        - amount
      description: Excluded movements of one currency.
      properties:
        currency:
          type: string
          description: Currency of the amount.
        transaction_count:
          type: integer
          description: Number of transactions.
        amount:
          type: string
          description: Amount in `currency`.
    ValueFiat:
      type: object
      description: >-
        Fiat values as decimal strings: `gross` is quantity × unit price, `fee`
        is token fee × unit price, and `net` is gross − fee.
      required:
        - gross
        - net
        - currency
      properties:
        gross:
          type: string
          description: >-
            Total fiat value before fees (`quantity × unit price`). Used as the
            line amount for journal entries.
        fee:
          type: string
          description: >-
            Fee in fiat terms (`token fee × unit price`). `"0.00"` if no fee.
            When non-zero, the fee is typically posted as a separate
            FEE-classified transaction.
        net:
          type: string
          description: Fiat value after fees (`gross − fee`).
        currency:
          type: string
          description: ISO 4217 currency code (such as `USD`, `EUR`).
    TransactionCategory:
      type: string
      description: >-
        Economic transaction type. Some values contain spaces, such as `INTERNAL
        TRANSFER`.
      enum:
        - DEPOSIT
        - WITHDRAWAL
        - SWAP
        - NON_TAXABLE_CONVERSION
        - BRIDGE
        - INTERCOMPANY TRANSFER
        - INTERNAL TRANSFER
        - FEE
        - MINTING
        - STAKING_REWARD
        - VALIDATOR_REWARD
        - INVOICE
        - BILL
        - CLAIM REWARD
        - BORROW
        - REPAYMENT
        - RESERVES CHANGE
        - REALIZED_PNL
        - INCOME
        - EXPENSE
        - REFUND
        - CHARGEBACK
        - NFT
        - SPAM
        - UNKNOWN
  headers:
    WWW-Authenticate:
      description: >-
        Bearer challenge with `realm="entendre"` and `resource_metadata`, the
        URL of the protected-resource metadata (RFC 9728).
        `error="invalid_token"` is added when the credential that was sent is
        invalid or expired.
      schema:
        type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your organization API key. See
        [Authentication](/get-started/authentication).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.