---
title: "Get a backtest's per-deal results"
method: GET
path: "/api/policy_version/{version}/backtest/{heron_id}/results"
tags: ["Policy Backtests"]
---

# Get a backtest's per-deal results

`GET /api/policy_version/{version}/backtest/{heron_id}/results`

## Request

- Base URL: `https://app.herondata.io`
- URL: `https://app.herondata.io/api/policy_version/{version}/backtest/{heron_id}/results`
- Auth: API key in header `x-api-key`

One page of deals, each carrying its evaluation_result, both versions' results, the checks that moved, and the note explaining the classification. Pass `after_id` to fetch rows recorded after that cursor in ascending row-ID order. Cursor-mode `_meta` keeps `total` and `per_page`, sets `next_url` and `prev_url` to null, and omits `page` and `pages`.

## Path parameters

- `version` integer, required
- `heron_id` string, required

## Query parameters

- `page` integer
- `limit` integer
- `after_id` integer
- `evaluation_result` string
- `detail` 'full'
- `include_lendsaas_deal_ids` boolean

## Response `200`

OK

- object
  - `_meta` Pagination
    - `next_url` string, url, nullable: the URL of the next page
    - `num_results` integer: the number of results on this page
    - `page` integer: current page
    - `pages` integer: the number of pages
    - `per_page` integer: the max number of results per page
    - `prev_url` string, url, nullable: the URL of the last page
    - `total` integer: the number of results across all pages
  - `backtest_deals` BacktestDealSchema[]
    - `baseline` BacktestBaselineSection[], nullable
      - `evaluated_at` string, nullable
      - `heron_id` string
      - `name` string
      - `policy_version` integer, nullable
    - `baseline_crm_queue` CrmQueue
      - `crm_integration_heron_id` string
      - `node_id` string: The CRM sync step that sets the queue
      - `status_id` string, nullable: The status the sync step sends, which the CRM may not apply (e.g. under a priority order)
      - `status_name` string, nullable
    - `baseline_result` unknown
    - `candidate_crm_queue` CrmQueue
      - `crm_integration_heron_id` string
      - `node_id` string: The CRM sync step that sets the queue
      - `status_id` string, nullable: The status the sync step sends, which the CRM may not apply (e.g. under a priority order)
      - `status_name` string, nullable
    - `candidate_result` unknown
    - `check_flips` CheckFlip[]
      - `baseline_result` string: Baseline result: passed, failed, review_required, or missing_data
      - `baseline_threshold_value` string, nullable: The compared variable's value. Absent for a check against a fixed number
      - `baseline_value` string, nullable
      - `candidate_result` string: Candidate result: passed, failed, review_required, or missing_data
      - `candidate_threshold_value` string, nullable: The compared variable's value. Absent for a check against a fixed number
      - `candidate_value` string, nullable
      - `check_identity` string: Prefixed identity: attribute:, sql:, sql_legacy:, or composite:
      - `check_name` string, nullable
      - `section_name` string
    - `crm_queue_result` unknown
    - `end_user_created` string, date-time: When the deal arrived; the live evaluation clock for a deal the policy never ran on
    - `end_user_heron_id` string
    - `end_user_name` string, nullable
    - `evaluated_as_of` string, date-time: The clock both sides were read under
    - `evaluation_result` 'same_outcome' | 'outcome_changed' | 'cannot_compare' | 'diverged'
    - `id` integer: Cursor for fetching rows recorded after this one
    - `lendsaas_deal_ids` string[]: LendSaaS deal IDs linked to the deal. Empty unless include_lendsaas_deal_ids is requested.
    - `note` string: Why the deal was classified this way, in English
    - `route` BacktestRoute
      - `diverged` boolean: Whether a policy step takes a different branch under the candidate
      - `stopped_at` BacktestRouteStop
        - `reason` string: One of: never_ran, branch_unknown, inputs_changed, js_inputs_unavailable, js_error, unknown_node, node_failed_in_original_run, unwired_handle
        - `step_label` string, nullable: The step's name on the policies page workflow, null for steps customers don't see
    - `sections` BacktestSection[]
      - `baseline_result` string, nullable
      - `candidate_result` string, nullable
      - `checks` BacktestSectionCheck[]
        - `baseline` BacktestCheckSide
          - `availability` string, nullable
          - `definition` BacktestCheckDefinition
            - `auto_decline` boolean
            - `ignore_metric_availability` boolean
            - `is_mandatory` boolean
            - `on_failure` string
            - `type` string, nullable
            - `value` unknown
          - `effective_result` string
          - `result` string
          - `source` 'reused' | 'recomputed' | 'live'
          - `threshold_value` string: The compared variable's value. Absent for a check against a fixed number
          - `value` string, nullable
          - `value_type` string, nullable
        - `candidate` BacktestCheckSide
          - `availability` string, nullable
          - `definition` BacktestCheckDefinition
            - `auto_decline` boolean
            - `ignore_metric_availability` boolean
            - `is_mandatory` boolean
            - `on_failure` string
            - `type` string, nullable
            - `value` unknown
          - `effective_result` string
          - `result` string
          - `source` 'reused' | 'recomputed' | 'live'
          - `threshold_value` string: The compared variable's value. Absent for a check against a fixed number
          - `value` string, nullable
          - `value_type` string, nullable
        - `change` 'unchanged' | 'threshold_changed' | 'added' | 'dropped' | 'flags_changed'
        - `check_identity` string
        - `check_name` string, nullable
        - `flipped` boolean
      - `heron_id` string
      - `name` string
    - `source` BacktestDealSource
      - `name` string, nullable: The ISO for an API deal; the sender's display name for an email deal
      - `sender_address` string, nullable: Who emailed the deal in
      - `sender_domain` string, nullable: The sender's domain, lowercased
      - `source_type` string, nullable: How the deal arrived, e.g. api or email

## Other responses

- `404`: Policy version or backtest not found
- `422`: Invalid filters or after_id combined with page

## Changes

- **2026-11-03** `bd8008e49534`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/herondata/apis/heron-data-api/changes/api/policy_version/:version/backtest/:heron_id/results/get.md)

---

[API](https://skmtc.dev/herondata/apis/heron-data-api.md) - [All operations](https://skmtc.dev/herondata/apis/heron-data-api/llms.txt) - [OpenAPI document](https://skmtc.dev/herondata/apis/heron-data-api/revisions/1ec936e17fef?raw)
