---
title: "XBRL calculation linkbase with filer and verifier weights (premium)"
method: GET
path: "/api/v1/filings/{filing_id}/calculation-tree"
tags: ["Filings"]
---

# XBRL calculation linkbase with filer and verifier weights (premium)

`GET /api/v1/filings/{filing_id}/calculation-tree`

## Request

- Base URL: `https://api.hub-equity.com`
- URL: `https://api.hub-equity.com/api/v1/filings/{filing_id}/calculation-tree`
- Auth: HTTP bearer

Returns the **calculation arcs** declared by the filer in the XBRL calculation linkbase, augmented with Hub-Equity's verifier output. Each arc carries both `weight` (filer-declared ±1) and `corrected_weight` (verifier output when the filer's sign drifts from the actual filed values). `is_corrected=true` flags an individual sign drift. `corrected_count` on the tree gives the aggregate.

**Two modes**:
- Omit `link_role` → returns the list of calc sections (`{link_role, section_name, edge_count}[]`). Pick one and re-query with `link_role=…`.
- Pass `link_role` → returns the full tree of edges for that section.

## Path parameters

- `filing_id` string, required

## Query parameters

- `link_role` string, nullable: XBRL extended link role URI. Omit to list available sections, pass to fetch the tree for one section.

## Response `200`

Calculation sections list OR one section's tree.

- ApiResponseUnionCalculationTreeCalculationSectionsResponse
  - `success` boolean, required
  - `data` union
    - CalculationTree: Calculation tree response (one link_role).
      - `filing_id` string, required
      - `link_role` string, required
      - `section_name` string, nullable
      - `edges` CalculationEdge[]
        - `from_concept` string, required: Parent qname (the total). E.g. `us-gaap:Assets` rolls up `us-gaap:AssetsCurrent` + `us-gaap:AssetsNoncurrent`.
        - `to_concept` string, required: Child qname (the component).
        - `from_namespace` string, nullable
        - `to_namespace` string, nullable
        - `weight` number, nullable: Filer-declared weight from the calculation linkbase. ±1 in 99% of cases. `+1` means the child is added to the parent, `-1` means it is subtracted (treasury stock, accumulated depreciation).
        - `corrected_weight` number, nullable: The sign the filed values support, when the declared signs do not add up and another combination does (a sign drift, such as treasury stock declared +1). Null when the declared weight stands. Compare against `weight` to spot a filer's mistake.
        - `correction_status` string, nullable: Outcome of checking the arc's whole group (its total and components) against the filed values: `correct` (the declared signs add up), `rounding` (they add up within rounding), `corrected` (another sign combination adds up; the arcs whose sign changed carry `corrected_weight`), `structural_error` (no sign combination adds up, e.g. a double-counted component), `skipped` (the values needed to check are not in the filing).
        - `is_corrected` boolean: Convenience flag — true iff `corrected_weight IS NOT NULL` AND `corrected_weight != weight`. Lets SDK callers filter `tree.edges | where .is_corrected` to surface filer bugs.
        - `order_index` number, nullable
        - `is_extension` boolean
        - `preferred_label` string, nullable
      - `edge_count` integer, required
      - `corrected_count` integer, required: Number of edges with `is_corrected=true`. Quick sanity check for the consumer — if non-zero, the filer's calc linkbase had at least one sign drift the verifier caught.
    - CalculationSectionsResponse: List of calculation sections available on a filing.
      - `filing_id` string, required
      - `sections` CalculationSection[]
        - `link_role` string, required: XBRL extended link role URI, e.g. `http://www.apple.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONS`. Pass it back as `link_role=` to fetch the tree for that section.
        - `section_name` string, nullable: Human-readable label parsed from the role's roleType arc.
        - `edge_count` integer, required: Number of calculation arcs in this section.
      - `total` integer, required
  - `error` ApiError: API error details.
    - `code` string, required
    - `message` string, required
    - `details` object, nullable
  - `meta` ApiMeta: API response metadata. Pagination fields (``page`` / ``per_page`` / ``total``) are populated on collection endpoints only. They are omitted from the payload on single-resource endpoints.
    - `timestamp` string, date-time
    - `request_id` string, nullable
    - `page` integer, nullable
    - `per_page` integer, nullable
    - `total` integer, nullable
  - `links` ApiLinks: HATEOAS-style pagination cursors. Host-relative path + query links for a collection page. Present on collection endpoints, ``null`` fields where a page doesn't exist (``next`` on the last page, ``prev`` on the first). The whole ``links`` object is omitted from single-resource responses (see ``ApiResponse`` serializer).
    - `self` string, nullable
    - `first` string, nullable
    - `prev` string, nullable
    - `next` string, nullable
    - `last` string, nullable

## Other responses

- `404`: Filing not found.
- `422`: Validation Error

---

[API](https://skmtc.dev/hub-equity/apis/hub-equity-api.md) · [All operations](https://skmtc.dev/hub-equity/apis/hub-equity-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hub-equity/apis/hub-equity-api/revisions/e8eeda5dc13e?raw)
