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

# Summarise a scenario

> What a scenario's tab on the scenarios screen shows, per month or for the whole window,
per period or per category. Give `period`, or both `from` and `to`, or neither for the
scenario's own months.

The window widens to whole months and is clipped to the scenario's months. A window
outside them is rejected with 400. Amounts are in the workspace currency and are never
converted. Outflows are negative.

Without `group_by` there is one row per period with `inflow`, `outflow` and `net`, and
the balance lines of the tab. `final_balance` is `starting_balance` plus `net`, as the
tab computes it. `opened_accounts`, `transfers` and `excluded` appear beside it and do
not enter it. A dynamic scenario has every line. A snapshot has `opened_accounts`,
`transfers` and `excluded` unless the line is zero in every month. A blank scenario has
only `final_balance`. Lines the tab does not show are `null`.

`totals` covers the whole window: the flows and the balance lines added up, the first
period's `starting_balance` and the last period's `final_balance`.

With `group_by=category` there is one row per category per period, nested as on the
screen. A parent category's row is its whole branch, so adding a parent and its
children counts the children twice. `edited` is `true` where the scenario sets the
amount itself rather than taking it from the cash flow. A category appears in a period
when it has an amount or the scenario edited it. `category_id` narrows the rows and
`totals` to those categories and the ones nested under them, and the balance fields
are then `null`.

**A scenario month by month**

```http
GET /scenarios/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/summary
```

**A scenario by category over its whole window**

```http
GET /scenarios/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/summary?interval=total&group_by=category
```




## OpenAPI

````yaml /openapi/v1.yaml get /scenarios/{id}/summary
openapi: 3.1.0
info:
  title: ThinkOut API
  version: '1.0'
  description: >
    Read access to the data of a ThinkOut workspace.


    Every endpoint in version 1 is a `GET`. Lists share one envelope and page
    with a cursor

    wherever they can grow. Every response carries `X-RateLimit-Limit`,
    `X-RateLimit-Remaining`

    and `X-RateLimit-Reset`.


    Version 1 changes additively: new endpoints, optional parameters, response
    fields and enum

    values can appear at any time. Tolerate unknown fields and never treat an
    enum as closed.
  contact:
    name: ThinkOut developer support
    url: https://developers.thinkout.io/guides/support
servers:
  - url: https://api.thinkout.io/v1
security:
  - apiKey: []
tags:
  - name: Banks
    description: The workspace's bank connections and the state of each one.
  - name: Accounts
    description: Manual, bank-synced and delegated accounts with computed balances.
  - name: Transactions
    description: Booked and pending movements on the workspace's accounts.
  - name: Categories
    description: The workspace category tree, split by direction and business activity.
  - name: Counterparties
    description: Customers and suppliers that transactions and forecasts are attributed to.
  - name: Labels
    description: Free-form tags grouped by label type.
  - name: Forecasts
    description: Planned inflows and outflows and the transactions that realised them.
  - name: Budgets
    description: >-
      Monthly budgets per category beside what has moved and what is still
      expected, as the budgets screen shows them.
  - name: Scenarios
    description: >-
      The what-ifs built on the scenarios screen and the figures the screen
      shows for them.
  - name: Reports
    description: >-
      Totals rather than rows. Summaries over transactions, forecasts and cash
      flow, and balances per account.
paths:
  /scenarios/{id}/summary:
    get:
      tags:
        - Scenarios
      summary: Summarise a scenario
      description: >
        What a scenario's tab on the scenarios screen shows, per month or for
        the whole window,

        per period or per category. Give `period`, or both `from` and `to`, or
        neither for the

        scenario's own months.


        The window widens to whole months and is clipped to the scenario's
        months. A window

        outside them is rejected with 400. Amounts are in the workspace currency
        and are never

        converted. Outflows are negative.


        Without `group_by` there is one row per period with `inflow`, `outflow`
        and `net`, and

        the balance lines of the tab. `final_balance` is `starting_balance` plus
        `net`, as the

        tab computes it. `opened_accounts`, `transfers` and `excluded` appear
        beside it and do

        not enter it. A dynamic scenario has every line. A snapshot has
        `opened_accounts`,

        `transfers` and `excluded` unless the line is zero in every month. A
        blank scenario has

        only `final_balance`. Lines the tab does not show are `null`.


        `totals` covers the whole window: the flows and the balance lines added
        up, the first

        period's `starting_balance` and the last period's `final_balance`.


        With `group_by=category` there is one row per category per period,
        nested as on the

        screen. A parent category's row is its whole branch, so adding a parent
        and its

        children counts the children twice. `edited` is `true` where the
        scenario sets the

        amount itself rather than taking it from the cash flow. A category
        appears in a period

        when it has an amount or the scenario edited it. `category_id` narrows
        the rows and

        `totals` to those categories and the ones nested under them, and the
        balance fields

        are then `null`.


        **A scenario month by month**


        ```http

        GET /scenarios/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/summary

        ```


        **A scenario by category over its whole window**


        ```http

        GET
        /scenarios/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/summary?interval=total&group_by=category

        ```
      operationId: summariseScenario
      parameters:
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/period'
        - $ref: '#/components/parameters/window_from'
        - $ref: '#/components/parameters/window_to'
        - $ref: '#/components/parameters/planning_interval'
        - name: group_by
          in: query
          description: >-
            `category` for one row per category per period. Omit it for one row
            per period.
          schema:
            type: string
            enum:
              - category
        - $ref: '#/components/parameters/planning_category_id'
      responses:
        '200':
          description: The scenario's tab.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScenarioSummary'
              examples:
                By month:
                  summary: One row per month with the tab's balance lines
                  value:
                    object: scenario_summary
                    scenario:
                      id: 2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f
                      name: Pessimistic
                      type: dynamic
                    period:
                      from: '2026-11-01'
                      to: '2026-12-31'
                      macro: null
                      interval: month
                    currency: RON
                    group_by: null
                    has_data: true
                    totals:
                      period_start: '2026-11-01'
                      period_end: '2026-12-31'
                      currency: RON
                      inflow: '160000.00'
                      outflow: '-127500.00'
                      net: '32500.00'
                      starting_balance: '208159.50'
                      opened_accounts: '0.00'
                      transfers: '0.00'
                      excluded: '-1500.00'
                      final_balance: '240659.50'
                    data:
                      - period_start: '2026-11-01'
                        period_end: '2026-11-30'
                        currency: RON
                        inflow: '82000.00'
                        outflow: '-61500.00'
                        net: '20500.00'
                        starting_balance: '208159.50'
                        opened_accounts: '0.00'
                        transfers: '0.00'
                        excluded: '-1500.00'
                        final_balance: '228659.50'
                      - period_start: '2026-12-01'
                        period_end: '2026-12-31'
                        currency: RON
                        inflow: '78000.00'
                        outflow: '-66000.00'
                        net: '12000.00'
                        starting_balance: '228659.50'
                        opened_accounts: '0.00'
                        transfers: '0.00'
                        excluded: '0.00'
                        final_balance: '240659.50'
                By category, in total:
                  summary: One row per category for the scenario's whole window
                  value:
                    object: scenario_summary
                    scenario:
                      id: 2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f
                      name: Pessimistic
                      type: dynamic
                    period:
                      from: '2026-11-01'
                      to: '2027-10-31'
                      macro: null
                      interval: total
                    currency: RON
                    group_by: category
                    has_data: true
                    totals:
                      period_start: '2026-11-01'
                      period_end: '2027-10-31'
                      currency: RON
                      inflow: '912000.00'
                      outflow: '-588000.00'
                      net: '324000.00'
                      starting_balance: '208159.50'
                      opened_accounts: '0.00'
                      transfers: '0.00'
                      excluded: '-1500.00'
                      final_balance: '532159.50'
                    data:
                      - period_start: '2026-11-01'
                        period_end: '2027-10-31'
                        direction: inflow
                        group:
                          dimension: category
                          id: 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                          label: Sales
                          parent_id: null
                        currency: RON
                        amount: '912000.00'
                        edited: true
                        note: null
                      - period_start: '2026-11-01'
                        period_end: '2027-10-31'
                        direction: outflow
                        group:
                          dimension: category
                          id: 8c9d0e1f-2a3b-4c4d-9e5f-6a7b8c9d0e1f
                          label: Salaries
                          parent_id: null
                        currency: RON
                        amount: '-540000.00'
                        edited: false
                        note: null
                      - period_start: '2026-11-01'
                        period_end: '2027-10-31'
                        direction: outflow
                        group:
                          dimension: category
                          id: 6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d
                          label: Marketing
                          parent_id: null
                        currency: RON
                        amount: '-48000.00'
                        edited: true
                        note: null
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/RequestTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    id:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    period:
      name: period
      in: query
      description: >-
        A named window, resolved against the workspace's local day and echoed in
        the response. Takes precedence over `from` and `to`.
      schema:
        $ref: '#/components/schemas/PeriodMacro'
    window_from:
      name: from
      in: query
      description: >-
        First day of the window, inclusive. Give it with `to`. Leave out
        `period`, `from` and `to` for the default window.
      schema:
        type: string
        format: date
    window_to:
      name: to
      in: query
      description: >-
        Last day of the window, inclusive. Give it with `from`. Leave out
        `period`, `from` and `to` for the default window.
      schema:
        type: string
        format: date
    planning_interval:
      name: interval
      in: query
      description: >-
        The period rows are grouped into. `month` for each calendar month,
        `total` for the whole window as one period.
      schema:
        $ref: '#/components/schemas/PlanningInterval'
    planning_category_id:
      name: category_id
      in: query
      description: >-
        Only these categories and the categories nested under them.
        Comma-separated for several.
      style: form
      explode: false
      schema:
        type: array
        items:
          type: string
          format: uuid
  schemas:
    ScenarioSummary:
      type: object
      required:
        - object
        - scenario
        - period
        - currency
        - group_by
        - has_data
        - totals
        - data
      properties:
        object:
          type: string
          const: scenario_summary
        scenario:
          $ref: '#/components/schemas/ScenarioReference'
        period:
          $ref: '#/components/schemas/ResolvedPlanningPeriod'
        currency:
          $ref: '#/components/schemas/Currency'
          description: The workspace currency. Scenario amounts are never converted.
        group_by:
          type:
            - string
            - 'null'
          enum:
            - category
            - null
        has_data:
          type: boolean
          description: >-
            `false` when `totals.inflow`, `totals.outflow` and
            `totals.final_balance` are all zero or absent.
        totals:
          $ref: '#/components/schemas/ScenarioPeriod'
        data:
          type: array
          description: >-
            One `ScenarioPeriod` per period without `group_by`. One
            `ScenarioCategoryRow` per category per period with
            `group_by=category`.
          items:
            oneOf:
              - $ref: '#/components/schemas/ScenarioPeriod'
              - $ref: '#/components/schemas/ScenarioCategoryRow'
    PeriodMacro:
      type: string
      description: >-
        A named window resolved on the server. `last_30_days` and `last_90_days`
        end today and include it; `last_12_months` starts the day after today
        minus twelve months. `next_month`, `next_quarter` and `next_year` cover
        the whole next calendar month, quarter or year.
      enum:
        - this_month
        - last_month
        - this_quarter
        - last_quarter
        - this_year
        - last_year
        - month_to_date
        - quarter_to_date
        - year_to_date
        - last_30_days
        - last_90_days
        - last_12_months
        - next_month
        - next_quarter
        - next_year
    PlanningInterval:
      type: string
      description: >-
        A period bucket for budget and scenario rows, which are monthly. `total`
        reports the whole window as one period, as the budgets screen's Total
        column does.
      enum:
        - month
        - total
      default: month
    ScenarioReference:
      type: object
      description: The scenario reported.
      required:
        - id
        - name
        - type
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: Pessimistic
        type:
          $ref: '#/components/schemas/ScenarioType'
    ResolvedPlanningPeriod:
      type: object
      description: The window actually computed, widened to whole months.
      required:
        - from
        - to
        - macro
        - interval
      properties:
        from:
          type: string
          format: date
          description: First day of the first month.
        to:
          type: string
          format: date
          description: Last day of the last month.
        macro:
          oneOf:
            - $ref: '#/components/schemas/PeriodMacro'
            - type: 'null'
          description: >-
            The macro that produced the window, or `null` when the dates were
            given directly or the endpoint's default window applied.
        interval:
          $ref: '#/components/schemas/PlanningInterval'
    Currency:
      type: string
      description: ISO 4217 alphabetic currency code.
      pattern: ^[A-Z]{3}$
      example: RON
    ScenarioPeriod:
      type: object
      description: >-
        One period of a scenario's tab, or its whole window in `totals`.
        Outflows are negative.
      required:
        - period_start
        - period_end
        - currency
        - inflow
        - outflow
        - net
        - starting_balance
        - opened_accounts
        - transfers
        - excluded
        - final_balance
      properties:
        period_start:
          type: string
          format: date
        period_end:
          type: string
          format: date
        currency:
          $ref: '#/components/schemas/Currency'
        inflow:
          $ref: '#/components/schemas/Money'
        outflow:
          $ref: '#/components/schemas/Money'
        net:
          $ref: '#/components/schemas/Money'
          description: '`inflow` plus `outflow`.'
        starting_balance:
          oneOf:
            - $ref: '#/components/schemas/Money'
            - type: 'null'
          description: >-
            The scenario's balance at the start of the period. `null` on a blank
            scenario and with `category_id`.
        opened_accounts:
          oneOf:
            - $ref: '#/components/schemas/Money'
            - type: 'null'
          description: >-
            The opening balances of accounts opened in the period. Shown beside
            the final balance and not part of it. `null` where the tab has no
            such line and with `category_id`.
        transfers:
          oneOf:
            - $ref: '#/components/schemas/Money'
            - type: 'null'
          description: >-
            Net of transfers between the workspace's own accounts in the period.
            Shown beside the final balance and not part of it. `null` where the
            tab has no such line and with `category_id`.
        excluded:
          oneOf:
            - $ref: '#/components/schemas/Money'
            - type: 'null'
          description: >-
            Net of movements excluded from cash flow in the period. Shown beside
            the final balance and not part of it. `null` where the tab has no
            such line and with `category_id`.
        final_balance:
          oneOf:
            - $ref: '#/components/schemas/Money'
            - type: 'null'
          description: >-
            The scenario's balance at the end of the period as its tab shows it,
            which is the balance at the start of the period plus `net`. `null`
            with `category_id`.
    ScenarioCategoryRow:
      type: object
      description: One category of one period of a scenario's tab.
      required:
        - period_start
        - period_end
        - direction
        - group
        - currency
        - amount
        - edited
        - note
      properties:
        period_start:
          type: string
          format: date
        period_end:
          type: string
          format: date
        direction:
          $ref: '#/components/schemas/Direction'
        group:
          $ref: '#/components/schemas/PlanningCategory'
        currency:
          $ref: '#/components/schemas/Currency'
        amount:
          $ref: '#/components/schemas/Money'
          description: >-
            The scenario's amount for the category in the period. Negative for
            outflows.
        edited:
          type: boolean
          description: >-
            `true` where the scenario sets the amount itself in the period,
            `false` where a dynamic scenario takes it from the cash flow.
        note:
          type:
            - string
            - 'null'
          description: The note written on the cell. Set only with `interval=month`.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - authentication
                - not_found
                - rate_limit
                - server
            code:
              type: string
              description: >
                Stable machine-readable reason. Branch on this, not on
                `message`. One of

                `invalid_parameter`, `invalid_cursor`, `limit_out_of_range`,
                `invalid_expand`,

                `as_of_in_future`, `unauthorized`, `forbidden`,
                `resource_not_found`,

                `too_many_groups`, `period_too_long`, `rate_limited`,
                `internal_error`.
            message:
              type: string
              description: Human-readable explanation. Wording may change.
            param:
              type:
                - string
                - 'null'
              description: The query parameter at fault, when there is one.
            request_id:
              type: string
              description: Quote this when contacting support.
    ScenarioType:
      type: string
      description: >-
        `dynamic` is the cash flow, actual and still expected, with the
        scenario's edits on top, and moves with the data. `snapshot` is a copy
        of the cash flow taken when the scenario was created, then edited.
        `blank` holds only the amounts typed into it, starting from its initial
        balance.
      enum:
        - dynamic
        - snapshot
        - blank
    Money:
      type: string
      description: >-
        Decimal amount as a string with two decimals. Negative means an outflow
        on transactions, forecasts and report figures.
      pattern: ^-?[0-9]+\.[0-9]{2}$
      example: '-1250.00'
    Direction:
      type: string
      description: >-
        Whether money comes in or goes out. On a transaction or forecast it
        follows the sign of `amount`.
      enum:
        - inflow
        - outflow
    PlanningCategory:
      type: object
      description: >-
        The category a budget or scenario row stands for. Rows nest as on the
        screen, so a parent category's row covers its whole branch. A row whose
        `id` equals its `parent_id` is the money booked on the parent category
        itself, which the budgets screen shows as "Others for" the parent.
      required:
        - dimension
        - id
        - label
        - parent_id
      properties:
        dimension:
          type: string
          const: category
        id:
          type: string
          format: uuid
        label:
          type: string
          example: Marketing
        parent_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The id of the category this row is nested under. `null` for a
            top-level category.
  responses:
    BadRequest:
      description: A parameter is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request
              code: invalid_parameter
              message: direction must be 'inflow' or 'outflow'
              param: direction
              request_id: 0HNF8K3QJL2VM:00000001
    Unauthorized:
      description: The API key is missing, malformed, unknown or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: authentication
              code: unauthorized
              message: Missing, malformed, unknown or revoked API key
              param: null
              request_id: 0HNF8K3QJL2VM:00000001
    Forbidden:
      description: >-
        The key is valid but the company's ThinkOut plan does not include the
        API.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: authentication
              code: forbidden
              message: >-
                The API is not included in this company's ThinkOut plan. Contact
                support@thinkout.io to enable it.
              param: null
              request_id: 0HNF8K3QJL2VM:00000001
    NotFound:
      description: No object with this id exists in the key's workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: not_found
              code: resource_not_found
              message: Transaction not found
              param: null
              request_id: 0HNF8K3QJL2VM:00000001
    RequestTooLarge:
      description: >
        The report would exceed 1000 rows. `period_too_long` is raised from the
        window and

        interval alone, `too_many_groups` after grouping. Narrow the window,
        coarsen the

        interval or add filters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request
              code: too_many_groups
              message: >-
                Grouping by counterparty over this period produces 1240 groups.
                The maximum is 1000. Narrow the period or the filters.
              param: group_by
              request_id: 0HNF8K3QJL2VM:00000001
    RateLimited:
      description: >-
        More than 120 requests in the current minute for this key. Wait for the
        seconds in `Retry-After`.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds until the minute window resets.
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Requests allowed per minute.
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests left in the current minute.
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Seconds until the minute window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: rate_limit
              code: rate_limited
              message: Too many requests
              param: null
              request_id: 0HNF8K3QJL2VM:00000001
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A workspace API key created in ThinkOut settings. One key reads one
        workspace.

````

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